stripe_core/payment_intent/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListPaymentIntentBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    created: Option<stripe_types::RangeQueryTs>,
9    #[serde(skip_serializing_if = "Option::is_none")]
10    customer: Option<String>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    ending_before: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    expand: Option<Vec<String>>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    limit: Option<i64>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    starting_after: Option<String>,
19}
20impl ListPaymentIntentBuilder {
21    fn new() -> Self {
22        Self {
23            created: None,
24            customer: None,
25            ending_before: None,
26            expand: None,
27            limit: None,
28            starting_after: None,
29        }
30    }
31}
32/// Returns a list of PaymentIntents.
33#[derive(Clone, Debug, serde::Serialize)]
34pub struct ListPaymentIntent {
35    inner: ListPaymentIntentBuilder,
36}
37impl ListPaymentIntent {
38    /// Construct a new `ListPaymentIntent`.
39    pub fn new() -> Self {
40        Self { inner: ListPaymentIntentBuilder::new() }
41    }
42    /// A filter on the list, based on the object `created` field.
43    /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options.
44    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
45        self.inner.created = Some(created.into());
46        self
47    }
48    /// Only return PaymentIntents for the customer that this customer ID specifies.
49    pub fn customer(mut self, customer: impl Into<String>) -> Self {
50        self.inner.customer = Some(customer.into());
51        self
52    }
53    /// A cursor for use in pagination.
54    /// `ending_before` is an object ID that defines your place in the list.
55    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
56    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
57        self.inner.ending_before = Some(ending_before.into());
58        self
59    }
60    /// Specifies which fields in the response should be expanded.
61    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
62        self.inner.expand = Some(expand.into());
63        self
64    }
65    /// A limit on the number of objects to be returned.
66    /// Limit can range between 1 and 100, and the default is 10.
67    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
68        self.inner.limit = Some(limit.into());
69        self
70    }
71    /// A cursor for use in pagination.
72    /// `starting_after` is an object ID that defines your place in the list.
73    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
74    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
75        self.inner.starting_after = Some(starting_after.into());
76        self
77    }
78}
79impl Default for ListPaymentIntent {
80    fn default() -> Self {
81        Self::new()
82    }
83}
84impl ListPaymentIntent {
85    /// Send the request and return the deserialized response.
86    pub async fn send<C: StripeClient>(
87        &self,
88        client: &C,
89    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
90        self.customize().send(client).await
91    }
92
93    /// Send the request and return the deserialized response, blocking until completion.
94    pub fn send_blocking<C: StripeBlockingClient>(
95        &self,
96        client: &C,
97    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
98        self.customize().send_blocking(client)
99    }
100
101    pub fn paginate(
102        &self,
103    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::PaymentIntent>> {
104        stripe_client_core::ListPaginator::new_list("/payment_intents", &self.inner)
105    }
106}
107
108impl StripeRequest for ListPaymentIntent {
109    type Output = stripe_types::List<stripe_shared::PaymentIntent>;
110
111    fn build(&self) -> RequestBuilder {
112        RequestBuilder::new(StripeMethod::Get, "/payment_intents").query(&self.inner)
113    }
114}
115#[derive(Clone, Debug, serde::Serialize)]
116struct RetrievePaymentIntentBuilder {
117    #[serde(skip_serializing_if = "Option::is_none")]
118    client_secret: Option<String>,
119    #[serde(skip_serializing_if = "Option::is_none")]
120    expand: Option<Vec<String>>,
121}
122impl RetrievePaymentIntentBuilder {
123    fn new() -> Self {
124        Self { client_secret: None, expand: None }
125    }
126}
127/// Retrieves the details of a PaymentIntent that has previously been created.
128///
129/// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string.
130///
131///
132/// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties.
133/// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details.
134#[derive(Clone, Debug, serde::Serialize)]
135pub struct RetrievePaymentIntent {
136    inner: RetrievePaymentIntentBuilder,
137    intent: stripe_shared::PaymentIntentId,
138}
139impl RetrievePaymentIntent {
140    /// Construct a new `RetrievePaymentIntent`.
141    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
142        Self { intent: intent.into(), inner: RetrievePaymentIntentBuilder::new() }
143    }
144    /// The client secret of the PaymentIntent.
145    /// We require it if you use a publishable key to retrieve the source.
146    pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
147        self.inner.client_secret = Some(client_secret.into());
148        self
149    }
150    /// Specifies which fields in the response should be expanded.
151    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
152        self.inner.expand = Some(expand.into());
153        self
154    }
155}
156impl RetrievePaymentIntent {
157    /// Send the request and return the deserialized response.
158    pub async fn send<C: StripeClient>(
159        &self,
160        client: &C,
161    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
162        self.customize().send(client).await
163    }
164
165    /// Send the request and return the deserialized response, blocking until completion.
166    pub fn send_blocking<C: StripeBlockingClient>(
167        &self,
168        client: &C,
169    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
170        self.customize().send_blocking(client)
171    }
172}
173
174impl StripeRequest for RetrievePaymentIntent {
175    type Output = stripe_shared::PaymentIntent;
176
177    fn build(&self) -> RequestBuilder {
178        let intent = &self.intent;
179        RequestBuilder::new(StripeMethod::Get, format!("/payment_intents/{intent}"))
180            .query(&self.inner)
181    }
182}
183#[derive(Clone, Debug, serde::Serialize)]
184struct SearchPaymentIntentBuilder {
185    #[serde(skip_serializing_if = "Option::is_none")]
186    expand: Option<Vec<String>>,
187    #[serde(skip_serializing_if = "Option::is_none")]
188    limit: Option<i64>,
189    #[serde(skip_serializing_if = "Option::is_none")]
190    page: Option<String>,
191    query: String,
192}
193impl SearchPaymentIntentBuilder {
194    fn new(query: impl Into<String>) -> Self {
195        Self { expand: None, limit: None, page: None, query: query.into() }
196    }
197}
198/// Search for PaymentIntents you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language).
199/// Don’t use search in read-after-write flows where strict consistency is necessary.
200/// Under normal operating.
201/// conditions, data is searchable in less than a minute.
202/// Occasionally, propagation of new or updated data can be up.
203/// to an hour behind during outages. Search functionality is not available to merchants in India.
204#[derive(Clone, Debug, serde::Serialize)]
205pub struct SearchPaymentIntent {
206    inner: SearchPaymentIntentBuilder,
207}
208impl SearchPaymentIntent {
209    /// Construct a new `SearchPaymentIntent`.
210    pub fn new(query: impl Into<String>) -> Self {
211        Self { inner: SearchPaymentIntentBuilder::new(query.into()) }
212    }
213    /// Specifies which fields in the response should be expanded.
214    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
215        self.inner.expand = Some(expand.into());
216        self
217    }
218    /// A limit on the number of objects to be returned.
219    /// Limit can range between 1 and 100, and the default is 10.
220    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
221        self.inner.limit = Some(limit.into());
222        self
223    }
224    /// A cursor for pagination across multiple pages of results.
225    /// Don't include this parameter on the first call.
226    /// Use the next_page value returned in a previous response to request subsequent results.
227    pub fn page(mut self, page: impl Into<String>) -> Self {
228        self.inner.page = Some(page.into());
229        self
230    }
231}
232impl SearchPaymentIntent {
233    /// Send the request and return the deserialized response.
234    pub async fn send<C: StripeClient>(
235        &self,
236        client: &C,
237    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
238        self.customize().send(client).await
239    }
240
241    /// Send the request and return the deserialized response, blocking until completion.
242    pub fn send_blocking<C: StripeBlockingClient>(
243        &self,
244        client: &C,
245    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
246        self.customize().send_blocking(client)
247    }
248
249    pub fn paginate(
250        &self,
251    ) -> stripe_client_core::ListPaginator<stripe_types::SearchList<stripe_shared::PaymentIntent>>
252    {
253        stripe_client_core::ListPaginator::new_search_list("/payment_intents/search", &self.inner)
254    }
255}
256
257impl StripeRequest for SearchPaymentIntent {
258    type Output = stripe_types::SearchList<stripe_shared::PaymentIntent>;
259
260    fn build(&self) -> RequestBuilder {
261        RequestBuilder::new(StripeMethod::Get, "/payment_intents/search").query(&self.inner)
262    }
263}
264#[derive(Clone, Debug, serde::Serialize)]
265struct CreatePaymentIntentBuilder {
266    amount: i64,
267    #[serde(skip_serializing_if = "Option::is_none")]
268    amount_details: Option<CreatePaymentIntentAmountDetails>,
269    #[serde(skip_serializing_if = "Option::is_none")]
270    application_fee_amount: Option<i64>,
271    #[serde(skip_serializing_if = "Option::is_none")]
272    automatic_payment_methods: Option<CreatePaymentIntentAutomaticPaymentMethods>,
273    #[serde(skip_serializing_if = "Option::is_none")]
274    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
275    #[serde(skip_serializing_if = "Option::is_none")]
276    confirm: Option<bool>,
277    #[serde(skip_serializing_if = "Option::is_none")]
278    confirmation_method: Option<stripe_shared::PaymentIntentConfirmationMethod>,
279    #[serde(skip_serializing_if = "Option::is_none")]
280    confirmation_token: Option<String>,
281    currency: stripe_types::Currency,
282    #[serde(skip_serializing_if = "Option::is_none")]
283    customer: Option<String>,
284    #[serde(skip_serializing_if = "Option::is_none")]
285    description: Option<String>,
286    #[serde(skip_serializing_if = "Option::is_none")]
287    error_on_requires_action: Option<bool>,
288    #[serde(skip_serializing_if = "Option::is_none")]
289    excluded_payment_method_types:
290        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
291    #[serde(skip_serializing_if = "Option::is_none")]
292    expand: Option<Vec<String>>,
293    #[serde(skip_serializing_if = "Option::is_none")]
294    hooks: Option<AsyncWorkflowsParam>,
295    #[serde(skip_serializing_if = "Option::is_none")]
296    mandate: Option<String>,
297    #[serde(skip_serializing_if = "Option::is_none")]
298    mandate_data: Option<CreatePaymentIntentMandateData>,
299    #[serde(skip_serializing_if = "Option::is_none")]
300    metadata: Option<std::collections::HashMap<String, String>>,
301    #[serde(skip_serializing_if = "Option::is_none")]
302    off_session: Option<CreatePaymentIntentOffSession>,
303    #[serde(skip_serializing_if = "Option::is_none")]
304    on_behalf_of: Option<String>,
305    #[serde(skip_serializing_if = "Option::is_none")]
306    payment_details: Option<CreatePaymentIntentPaymentDetails>,
307    #[serde(skip_serializing_if = "Option::is_none")]
308    payment_method: Option<String>,
309    #[serde(skip_serializing_if = "Option::is_none")]
310    payment_method_configuration: Option<String>,
311    #[serde(skip_serializing_if = "Option::is_none")]
312    payment_method_data: Option<CreatePaymentIntentPaymentMethodData>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    payment_method_options: Option<CreatePaymentIntentPaymentMethodOptions>,
315    #[serde(skip_serializing_if = "Option::is_none")]
316    payment_method_types: Option<Vec<String>>,
317    #[serde(skip_serializing_if = "Option::is_none")]
318    radar_options: Option<CreatePaymentIntentRadarOptions>,
319    #[serde(skip_serializing_if = "Option::is_none")]
320    receipt_email: Option<String>,
321    #[serde(skip_serializing_if = "Option::is_none")]
322    return_url: Option<String>,
323    #[serde(skip_serializing_if = "Option::is_none")]
324    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
325    #[serde(skip_serializing_if = "Option::is_none")]
326    shipping: Option<CreatePaymentIntentShipping>,
327    #[serde(skip_serializing_if = "Option::is_none")]
328    statement_descriptor: Option<String>,
329    #[serde(skip_serializing_if = "Option::is_none")]
330    statement_descriptor_suffix: Option<String>,
331    #[serde(skip_serializing_if = "Option::is_none")]
332    transfer_data: Option<CreatePaymentIntentTransferData>,
333    #[serde(skip_serializing_if = "Option::is_none")]
334    transfer_group: Option<String>,
335    #[serde(skip_serializing_if = "Option::is_none")]
336    use_stripe_sdk: Option<bool>,
337}
338impl CreatePaymentIntentBuilder {
339    fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
340        Self {
341            amount: amount.into(),
342            amount_details: None,
343            application_fee_amount: None,
344            automatic_payment_methods: None,
345            capture_method: None,
346            confirm: None,
347            confirmation_method: None,
348            confirmation_token: None,
349            currency: currency.into(),
350            customer: None,
351            description: None,
352            error_on_requires_action: None,
353            excluded_payment_method_types: None,
354            expand: None,
355            hooks: None,
356            mandate: None,
357            mandate_data: None,
358            metadata: None,
359            off_session: None,
360            on_behalf_of: None,
361            payment_details: None,
362            payment_method: None,
363            payment_method_configuration: None,
364            payment_method_data: None,
365            payment_method_options: None,
366            payment_method_types: None,
367            radar_options: None,
368            receipt_email: None,
369            return_url: None,
370            setup_future_usage: None,
371            shipping: None,
372            statement_descriptor: None,
373            statement_descriptor_suffix: None,
374            transfer_data: None,
375            transfer_group: None,
376            use_stripe_sdk: None,
377        }
378    }
379}
380/// Provides industry-specific information about the amount.
381#[derive(Clone, Debug, serde::Serialize)]
382pub struct CreatePaymentIntentAmountDetails {
383    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
384    /// An integer greater than 0.
385    ///
386    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
387    #[serde(skip_serializing_if = "Option::is_none")]
388    pub discount_amount: Option<i64>,
389    /// A list of line items, each containing information about a product in the PaymentIntent.
390    /// There is a maximum of 100 line items.
391    #[serde(skip_serializing_if = "Option::is_none")]
392    pub line_items: Option<Vec<CreatePaymentIntentAmountDetailsLineItems>>,
393    /// Contains information about the shipping portion of the amount.
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub shipping: Option<AmountDetailsShippingParam>,
396    /// Contains information about the tax portion of the amount.
397    #[serde(skip_serializing_if = "Option::is_none")]
398    pub tax: Option<AmountDetailsTaxParam>,
399}
400impl CreatePaymentIntentAmountDetails {
401    pub fn new() -> Self {
402        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
403    }
404}
405impl Default for CreatePaymentIntentAmountDetails {
406    fn default() -> Self {
407        Self::new()
408    }
409}
410/// A list of line items, each containing information about a product in the PaymentIntent.
411/// There is a maximum of 100 line items.
412#[derive(Clone, Debug, serde::Serialize)]
413pub struct CreatePaymentIntentAmountDetailsLineItems {
414    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
415    /// An integer greater than 0.
416    ///
417    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
418    #[serde(skip_serializing_if = "Option::is_none")]
419    pub discount_amount: Option<i64>,
420    /// Payment method-specific information for line items.
421    #[serde(skip_serializing_if = "Option::is_none")]
422    pub payment_method_options:
423        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
424    /// The product code of the line item, such as an SKU.
425    /// Required for L3 rates.
426    /// At most 12 characters long.
427    #[serde(skip_serializing_if = "Option::is_none")]
428    pub product_code: Option<String>,
429    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
430    ///
431    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
432    /// For Paypal, this field is truncated to 127 characters.
433    pub product_name: String,
434    /// The quantity of items. Required for L3 rates. An integer greater than 0.
435    pub quantity: u64,
436    /// Contains information about the tax on the item.
437    #[serde(skip_serializing_if = "Option::is_none")]
438    pub tax: Option<AmountDetailsLineItemTaxParam>,
439    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
440    /// Required for L3 rates.
441    /// An integer greater than or equal to 0.
442    pub unit_cost: i64,
443    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub unit_of_measure: Option<String>,
446}
447impl CreatePaymentIntentAmountDetailsLineItems {
448    pub fn new(
449        product_name: impl Into<String>,
450        quantity: impl Into<u64>,
451        unit_cost: impl Into<i64>,
452    ) -> Self {
453        Self {
454            discount_amount: None,
455            payment_method_options: None,
456            product_code: None,
457            product_name: product_name.into(),
458            quantity: quantity.into(),
459            tax: None,
460            unit_cost: unit_cost.into(),
461            unit_of_measure: None,
462        }
463    }
464}
465/// Payment method-specific information for line items.
466#[derive(Clone, Debug, serde::Serialize)]
467pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
468    /// This sub-hash contains line item details that are specific to `card` payment method."
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub card: Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
471    /// This sub-hash contains line item details that are specific to `card_present` payment method."
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub card_present:
474        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
475    /// This sub-hash contains line item details that are specific to `klarna` payment method."
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
478    /// This sub-hash contains line item details that are specific to `paypal` payment method."
479    #[serde(skip_serializing_if = "Option::is_none")]
480    pub paypal: Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
481}
482impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
483    pub fn new() -> Self {
484        Self { card: None, card_present: None, klarna: None, paypal: None }
485    }
486}
487impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
488    fn default() -> Self {
489        Self::new()
490    }
491}
492/// This sub-hash contains line item details that are specific to `card` payment method."
493#[derive(Clone, Debug, serde::Serialize)]
494pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
495    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub commodity_code: Option<String>,
498}
499impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
500    pub fn new() -> Self {
501        Self { commodity_code: None }
502    }
503}
504impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
505    fn default() -> Self {
506        Self::new()
507    }
508}
509/// This sub-hash contains line item details that are specific to `card_present` payment method."
510#[derive(Clone, Debug, serde::Serialize)]
511pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
512    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
513    #[serde(skip_serializing_if = "Option::is_none")]
514    pub commodity_code: Option<String>,
515}
516impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
517    pub fn new() -> Self {
518        Self { commodity_code: None }
519    }
520}
521impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
522    fn default() -> Self {
523        Self::new()
524    }
525}
526/// This sub-hash contains line item details that are specific to `paypal` payment method."
527#[derive(Clone, Debug, serde::Serialize)]
528pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
529    /// Type of the line item.
530    #[serde(skip_serializing_if = "Option::is_none")]
531    pub category:
532        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
533    /// Description of the line item.
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub description: Option<String>,
536    /// The Stripe account ID of the connected account that sells the item.
537    #[serde(skip_serializing_if = "Option::is_none")]
538    pub sold_by: Option<String>,
539}
540impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
541    pub fn new() -> Self {
542        Self { category: None, description: None, sold_by: None }
543    }
544}
545impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
546    fn default() -> Self {
547        Self::new()
548    }
549}
550/// Type of the line item.
551#[derive(Copy, Clone, Eq, PartialEq)]
552pub enum CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
553    DigitalGoods,
554    Donation,
555    PhysicalGoods,
556}
557impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
558    pub fn as_str(self) -> &'static str {
559        use CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
560        match self {
561            DigitalGoods => "digital_goods",
562            Donation => "donation",
563            PhysicalGoods => "physical_goods",
564        }
565    }
566}
567
568impl std::str::FromStr
569    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
570{
571    type Err = stripe_types::StripeParseError;
572    fn from_str(s: &str) -> Result<Self, Self::Err> {
573        use CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
574        match s {
575            "digital_goods" => Ok(DigitalGoods),
576            "donation" => Ok(Donation),
577            "physical_goods" => Ok(PhysicalGoods),
578            _ => Err(stripe_types::StripeParseError),
579        }
580    }
581}
582impl std::fmt::Display
583    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
584{
585    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
586        f.write_str(self.as_str())
587    }
588}
589
590impl std::fmt::Debug
591    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
592{
593    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
594        f.write_str(self.as_str())
595    }
596}
597impl serde::Serialize
598    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
599{
600    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
601    where
602        S: serde::Serializer,
603    {
604        serializer.serialize_str(self.as_str())
605    }
606}
607#[cfg(feature = "deserialize")]
608impl<'de> serde::Deserialize<'de>
609    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
610{
611    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
612        use std::str::FromStr;
613        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
614        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
615    }
616}
617/// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters.
618#[derive(Copy, Clone, Debug, serde::Serialize)]
619pub struct CreatePaymentIntentAutomaticPaymentMethods {
620    /// Controls whether this PaymentIntent will accept redirect-based payment methods.
621    ///
622    /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
623    /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
624    #[serde(skip_serializing_if = "Option::is_none")]
625    pub allow_redirects: Option<CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects>,
626    /// Whether this feature is enabled.
627    pub enabled: bool,
628}
629impl CreatePaymentIntentAutomaticPaymentMethods {
630    pub fn new(enabled: impl Into<bool>) -> Self {
631        Self { allow_redirects: None, enabled: enabled.into() }
632    }
633}
634/// Controls whether this PaymentIntent will accept redirect-based payment methods.
635///
636/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
637/// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
638#[derive(Copy, Clone, Eq, PartialEq)]
639pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
640    Always,
641    Never,
642}
643impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
644    pub fn as_str(self) -> &'static str {
645        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
646        match self {
647            Always => "always",
648            Never => "never",
649        }
650    }
651}
652
653impl std::str::FromStr for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
654    type Err = stripe_types::StripeParseError;
655    fn from_str(s: &str) -> Result<Self, Self::Err> {
656        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
657        match s {
658            "always" => Ok(Always),
659            "never" => Ok(Never),
660            _ => Err(stripe_types::StripeParseError),
661        }
662    }
663}
664impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
665    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
666        f.write_str(self.as_str())
667    }
668}
669
670impl std::fmt::Debug for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
672        f.write_str(self.as_str())
673    }
674}
675impl serde::Serialize for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
676    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
677    where
678        S: serde::Serializer,
679    {
680        serializer.serialize_str(self.as_str())
681    }
682}
683#[cfg(feature = "deserialize")]
684impl<'de> serde::Deserialize<'de> for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
685    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
686        use std::str::FromStr;
687        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
688        Self::from_str(&s).map_err(|_| {
689            serde::de::Error::custom(
690                "Unknown value for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects",
691            )
692        })
693    }
694}
695/// This hash contains details about the Mandate to create.
696/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
697#[derive(Clone, Debug, serde::Serialize)]
698pub struct CreatePaymentIntentMandateData {
699    /// This hash contains details about the customer acceptance of the Mandate.
700    pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance,
701}
702impl CreatePaymentIntentMandateData {
703    pub fn new(
704        customer_acceptance: impl Into<CreatePaymentIntentMandateDataCustomerAcceptance>,
705    ) -> Self {
706        Self { customer_acceptance: customer_acceptance.into() }
707    }
708}
709/// This hash contains details about the customer acceptance of the Mandate.
710#[derive(Clone, Debug, serde::Serialize)]
711pub struct CreatePaymentIntentMandateDataCustomerAcceptance {
712    /// The time at which the customer accepted the Mandate.
713    #[serde(skip_serializing_if = "Option::is_none")]
714    pub accepted_at: Option<stripe_types::Timestamp>,
715    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
716    #[serde(skip_serializing_if = "Option::is_none")]
717    #[serde(with = "stripe_types::with_serde_json_opt")]
718    pub offline: Option<miniserde::json::Value>,
719    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
720    #[serde(skip_serializing_if = "Option::is_none")]
721    pub online: Option<OnlineParam>,
722    /// The type of customer acceptance information included with the Mandate.
723    /// One of `online` or `offline`.
724    #[serde(rename = "type")]
725    pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType,
726}
727impl CreatePaymentIntentMandateDataCustomerAcceptance {
728    pub fn new(type_: impl Into<CreatePaymentIntentMandateDataCustomerAcceptanceType>) -> Self {
729        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
730    }
731}
732/// The type of customer acceptance information included with the Mandate.
733/// One of `online` or `offline`.
734#[derive(Copy, Clone, Eq, PartialEq)]
735pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType {
736    Offline,
737    Online,
738}
739impl CreatePaymentIntentMandateDataCustomerAcceptanceType {
740    pub fn as_str(self) -> &'static str {
741        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
742        match self {
743            Offline => "offline",
744            Online => "online",
745        }
746    }
747}
748
749impl std::str::FromStr for CreatePaymentIntentMandateDataCustomerAcceptanceType {
750    type Err = stripe_types::StripeParseError;
751    fn from_str(s: &str) -> Result<Self, Self::Err> {
752        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
753        match s {
754            "offline" => Ok(Offline),
755            "online" => Ok(Online),
756            _ => Err(stripe_types::StripeParseError),
757        }
758    }
759}
760impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType {
761    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
762        f.write_str(self.as_str())
763    }
764}
765
766impl std::fmt::Debug for CreatePaymentIntentMandateDataCustomerAcceptanceType {
767    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
768        f.write_str(self.as_str())
769    }
770}
771impl serde::Serialize for CreatePaymentIntentMandateDataCustomerAcceptanceType {
772    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
773    where
774        S: serde::Serializer,
775    {
776        serializer.serialize_str(self.as_str())
777    }
778}
779#[cfg(feature = "deserialize")]
780impl<'de> serde::Deserialize<'de> for CreatePaymentIntentMandateDataCustomerAcceptanceType {
781    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
782        use std::str::FromStr;
783        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
784        Self::from_str(&s).map_err(|_| {
785            serde::de::Error::custom(
786                "Unknown value for CreatePaymentIntentMandateDataCustomerAcceptanceType",
787            )
788        })
789    }
790}
791/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
792/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
793/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
794#[derive(Copy, Clone, Debug, serde::Serialize)]
795#[serde(rename_all = "snake_case")]
796pub enum CreatePaymentIntentOffSession {
797    OneOff,
798    Recurring,
799    #[serde(untagged)]
800    Bool(bool),
801}
802/// Provides industry-specific information about the charge.
803#[derive(Clone, Debug, serde::Serialize)]
804pub struct CreatePaymentIntentPaymentDetails {
805    /// A unique value to identify the customer. This field is available only for card payments.
806    ///
807    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
808    #[serde(skip_serializing_if = "Option::is_none")]
809    pub customer_reference: Option<String>,
810    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
811    ///
812    /// Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`.
813    ///
814    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
815    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
816    #[serde(skip_serializing_if = "Option::is_none")]
817    pub order_reference: Option<String>,
818}
819impl CreatePaymentIntentPaymentDetails {
820    pub fn new() -> Self {
821        Self { customer_reference: None, order_reference: None }
822    }
823}
824impl Default for CreatePaymentIntentPaymentDetails {
825    fn default() -> Self {
826        Self::new()
827    }
828}
829/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
830/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
831/// property on the PaymentIntent.
832#[derive(Clone, Debug, serde::Serialize)]
833pub struct CreatePaymentIntentPaymentMethodData {
834    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
835    #[serde(skip_serializing_if = "Option::is_none")]
836    pub acss_debit: Option<PaymentMethodParam>,
837    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
838    #[serde(skip_serializing_if = "Option::is_none")]
839    #[serde(with = "stripe_types::with_serde_json_opt")]
840    pub affirm: Option<miniserde::json::Value>,
841    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
842    #[serde(skip_serializing_if = "Option::is_none")]
843    #[serde(with = "stripe_types::with_serde_json_opt")]
844    pub afterpay_clearpay: Option<miniserde::json::Value>,
845    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
846    #[serde(skip_serializing_if = "Option::is_none")]
847    #[serde(with = "stripe_types::with_serde_json_opt")]
848    pub alipay: Option<miniserde::json::Value>,
849    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
850    /// 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.
851    /// The field defaults to `unspecified`.
852    #[serde(skip_serializing_if = "Option::is_none")]
853    pub allow_redisplay: Option<CreatePaymentIntentPaymentMethodDataAllowRedisplay>,
854    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
855    #[serde(skip_serializing_if = "Option::is_none")]
856    #[serde(with = "stripe_types::with_serde_json_opt")]
857    pub alma: Option<miniserde::json::Value>,
858    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
859    #[serde(skip_serializing_if = "Option::is_none")]
860    #[serde(with = "stripe_types::with_serde_json_opt")]
861    pub amazon_pay: Option<miniserde::json::Value>,
862    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
863    #[serde(skip_serializing_if = "Option::is_none")]
864    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodDataAuBecsDebit>,
865    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
866    #[serde(skip_serializing_if = "Option::is_none")]
867    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodDataBacsDebit>,
868    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
869    #[serde(skip_serializing_if = "Option::is_none")]
870    #[serde(with = "stripe_types::with_serde_json_opt")]
871    pub bancontact: Option<miniserde::json::Value>,
872    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
873    #[serde(skip_serializing_if = "Option::is_none")]
874    #[serde(with = "stripe_types::with_serde_json_opt")]
875    pub billie: Option<miniserde::json::Value>,
876    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
877    #[serde(skip_serializing_if = "Option::is_none")]
878    pub billing_details: Option<CreatePaymentIntentPaymentMethodDataBillingDetails>,
879    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
880    #[serde(skip_serializing_if = "Option::is_none")]
881    #[serde(with = "stripe_types::with_serde_json_opt")]
882    pub blik: Option<miniserde::json::Value>,
883    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
884    #[serde(skip_serializing_if = "Option::is_none")]
885    pub boleto: Option<CreatePaymentIntentPaymentMethodDataBoleto>,
886    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
887    #[serde(skip_serializing_if = "Option::is_none")]
888    #[serde(with = "stripe_types::with_serde_json_opt")]
889    pub cashapp: Option<miniserde::json::Value>,
890    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
891    #[serde(skip_serializing_if = "Option::is_none")]
892    #[serde(with = "stripe_types::with_serde_json_opt")]
893    pub crypto: Option<miniserde::json::Value>,
894    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
895    #[serde(skip_serializing_if = "Option::is_none")]
896    #[serde(with = "stripe_types::with_serde_json_opt")]
897    pub customer_balance: Option<miniserde::json::Value>,
898    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
899    #[serde(skip_serializing_if = "Option::is_none")]
900    pub eps: Option<CreatePaymentIntentPaymentMethodDataEps>,
901    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
902    #[serde(skip_serializing_if = "Option::is_none")]
903    pub fpx: Option<CreatePaymentIntentPaymentMethodDataFpx>,
904    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
905    #[serde(skip_serializing_if = "Option::is_none")]
906    #[serde(with = "stripe_types::with_serde_json_opt")]
907    pub giropay: Option<miniserde::json::Value>,
908    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
909    #[serde(skip_serializing_if = "Option::is_none")]
910    #[serde(with = "stripe_types::with_serde_json_opt")]
911    pub grabpay: Option<miniserde::json::Value>,
912    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
913    #[serde(skip_serializing_if = "Option::is_none")]
914    pub ideal: Option<CreatePaymentIntentPaymentMethodDataIdeal>,
915    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
916    #[serde(skip_serializing_if = "Option::is_none")]
917    #[serde(with = "stripe_types::with_serde_json_opt")]
918    pub interac_present: Option<miniserde::json::Value>,
919    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
920    #[serde(skip_serializing_if = "Option::is_none")]
921    #[serde(with = "stripe_types::with_serde_json_opt")]
922    pub kakao_pay: Option<miniserde::json::Value>,
923    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
924    #[serde(skip_serializing_if = "Option::is_none")]
925    pub klarna: Option<CreatePaymentIntentPaymentMethodDataKlarna>,
926    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
927    #[serde(skip_serializing_if = "Option::is_none")]
928    #[serde(with = "stripe_types::with_serde_json_opt")]
929    pub konbini: Option<miniserde::json::Value>,
930    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
931    #[serde(skip_serializing_if = "Option::is_none")]
932    #[serde(with = "stripe_types::with_serde_json_opt")]
933    pub kr_card: Option<miniserde::json::Value>,
934    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
935    #[serde(skip_serializing_if = "Option::is_none")]
936    #[serde(with = "stripe_types::with_serde_json_opt")]
937    pub link: Option<miniserde::json::Value>,
938    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
939    #[serde(skip_serializing_if = "Option::is_none")]
940    #[serde(with = "stripe_types::with_serde_json_opt")]
941    pub mb_way: Option<miniserde::json::Value>,
942    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
943    /// This can be useful for storing additional information about the object in a structured format.
944    /// Individual keys can be unset by posting an empty value to them.
945    /// All keys can be unset by posting an empty value to `metadata`.
946    #[serde(skip_serializing_if = "Option::is_none")]
947    pub metadata: Option<std::collections::HashMap<String, String>>,
948    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
949    #[serde(skip_serializing_if = "Option::is_none")]
950    #[serde(with = "stripe_types::with_serde_json_opt")]
951    pub mobilepay: Option<miniserde::json::Value>,
952    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
953    #[serde(skip_serializing_if = "Option::is_none")]
954    #[serde(with = "stripe_types::with_serde_json_opt")]
955    pub multibanco: Option<miniserde::json::Value>,
956    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub naver_pay: Option<CreatePaymentIntentPaymentMethodDataNaverPay>,
959    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
960    #[serde(skip_serializing_if = "Option::is_none")]
961    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodDataNzBankAccount>,
962    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
963    #[serde(skip_serializing_if = "Option::is_none")]
964    #[serde(with = "stripe_types::with_serde_json_opt")]
965    pub oxxo: Option<miniserde::json::Value>,
966    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
967    #[serde(skip_serializing_if = "Option::is_none")]
968    pub p24: Option<CreatePaymentIntentPaymentMethodDataP24>,
969    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
970    #[serde(skip_serializing_if = "Option::is_none")]
971    #[serde(with = "stripe_types::with_serde_json_opt")]
972    pub pay_by_bank: Option<miniserde::json::Value>,
973    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
974    #[serde(skip_serializing_if = "Option::is_none")]
975    #[serde(with = "stripe_types::with_serde_json_opt")]
976    pub payco: Option<miniserde::json::Value>,
977    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
978    #[serde(skip_serializing_if = "Option::is_none")]
979    #[serde(with = "stripe_types::with_serde_json_opt")]
980    pub paynow: Option<miniserde::json::Value>,
981    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
982    #[serde(skip_serializing_if = "Option::is_none")]
983    #[serde(with = "stripe_types::with_serde_json_opt")]
984    pub paypal: Option<miniserde::json::Value>,
985    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
986    #[serde(skip_serializing_if = "Option::is_none")]
987    #[serde(with = "stripe_types::with_serde_json_opt")]
988    pub pix: Option<miniserde::json::Value>,
989    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
990    #[serde(skip_serializing_if = "Option::is_none")]
991    #[serde(with = "stripe_types::with_serde_json_opt")]
992    pub promptpay: Option<miniserde::json::Value>,
993    /// Options to configure Radar.
994    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
995    #[serde(skip_serializing_if = "Option::is_none")]
996    pub radar_options: Option<CreatePaymentIntentPaymentMethodDataRadarOptions>,
997    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
998    #[serde(skip_serializing_if = "Option::is_none")]
999    #[serde(with = "stripe_types::with_serde_json_opt")]
1000    pub revolut_pay: Option<miniserde::json::Value>,
1001    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
1002    #[serde(skip_serializing_if = "Option::is_none")]
1003    #[serde(with = "stripe_types::with_serde_json_opt")]
1004    pub samsung_pay: Option<miniserde::json::Value>,
1005    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
1006    #[serde(skip_serializing_if = "Option::is_none")]
1007    #[serde(with = "stripe_types::with_serde_json_opt")]
1008    pub satispay: Option<miniserde::json::Value>,
1009    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1010    #[serde(skip_serializing_if = "Option::is_none")]
1011    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodDataSepaDebit>,
1012    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1013    #[serde(skip_serializing_if = "Option::is_none")]
1014    pub sofort: Option<CreatePaymentIntentPaymentMethodDataSofort>,
1015    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
1016    #[serde(skip_serializing_if = "Option::is_none")]
1017    #[serde(with = "stripe_types::with_serde_json_opt")]
1018    pub swish: Option<miniserde::json::Value>,
1019    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
1020    #[serde(skip_serializing_if = "Option::is_none")]
1021    #[serde(with = "stripe_types::with_serde_json_opt")]
1022    pub twint: Option<miniserde::json::Value>,
1023    /// The type of the PaymentMethod.
1024    /// An additional hash is included on the PaymentMethod with a name matching this value.
1025    /// It contains additional information specific to the PaymentMethod type.
1026    #[serde(rename = "type")]
1027    pub type_: CreatePaymentIntentPaymentMethodDataType,
1028    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1029    #[serde(skip_serializing_if = "Option::is_none")]
1030    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodDataUsBankAccount>,
1031    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
1032    #[serde(skip_serializing_if = "Option::is_none")]
1033    #[serde(with = "stripe_types::with_serde_json_opt")]
1034    pub wechat_pay: Option<miniserde::json::Value>,
1035    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
1036    #[serde(skip_serializing_if = "Option::is_none")]
1037    #[serde(with = "stripe_types::with_serde_json_opt")]
1038    pub zip: Option<miniserde::json::Value>,
1039}
1040impl CreatePaymentIntentPaymentMethodData {
1041    pub fn new(type_: impl Into<CreatePaymentIntentPaymentMethodDataType>) -> Self {
1042        Self {
1043            acss_debit: None,
1044            affirm: None,
1045            afterpay_clearpay: None,
1046            alipay: None,
1047            allow_redisplay: None,
1048            alma: None,
1049            amazon_pay: None,
1050            au_becs_debit: None,
1051            bacs_debit: None,
1052            bancontact: None,
1053            billie: None,
1054            billing_details: None,
1055            blik: None,
1056            boleto: None,
1057            cashapp: None,
1058            crypto: None,
1059            customer_balance: None,
1060            eps: None,
1061            fpx: None,
1062            giropay: None,
1063            grabpay: None,
1064            ideal: None,
1065            interac_present: None,
1066            kakao_pay: None,
1067            klarna: None,
1068            konbini: None,
1069            kr_card: None,
1070            link: None,
1071            mb_way: None,
1072            metadata: None,
1073            mobilepay: None,
1074            multibanco: None,
1075            naver_pay: None,
1076            nz_bank_account: None,
1077            oxxo: None,
1078            p24: None,
1079            pay_by_bank: None,
1080            payco: None,
1081            paynow: None,
1082            paypal: None,
1083            pix: None,
1084            promptpay: None,
1085            radar_options: None,
1086            revolut_pay: None,
1087            samsung_pay: None,
1088            satispay: None,
1089            sepa_debit: None,
1090            sofort: None,
1091            swish: None,
1092            twint: None,
1093            type_: type_.into(),
1094            us_bank_account: None,
1095            wechat_pay: None,
1096            zip: None,
1097        }
1098    }
1099}
1100/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
1101/// 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.
1102/// The field defaults to `unspecified`.
1103#[derive(Copy, Clone, Eq, PartialEq)]
1104pub enum CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1105    Always,
1106    Limited,
1107    Unspecified,
1108}
1109impl CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1110    pub fn as_str(self) -> &'static str {
1111        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
1112        match self {
1113            Always => "always",
1114            Limited => "limited",
1115            Unspecified => "unspecified",
1116        }
1117    }
1118}
1119
1120impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1121    type Err = stripe_types::StripeParseError;
1122    fn from_str(s: &str) -> Result<Self, Self::Err> {
1123        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
1124        match s {
1125            "always" => Ok(Always),
1126            "limited" => Ok(Limited),
1127            "unspecified" => Ok(Unspecified),
1128            _ => Err(stripe_types::StripeParseError),
1129        }
1130    }
1131}
1132impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1133    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1134        f.write_str(self.as_str())
1135    }
1136}
1137
1138impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1139    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1140        f.write_str(self.as_str())
1141    }
1142}
1143impl serde::Serialize for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1144    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1145    where
1146        S: serde::Serializer,
1147    {
1148        serializer.serialize_str(self.as_str())
1149    }
1150}
1151#[cfg(feature = "deserialize")]
1152impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1153    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1154        use std::str::FromStr;
1155        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1156        Self::from_str(&s).map_err(|_| {
1157            serde::de::Error::custom(
1158                "Unknown value for CreatePaymentIntentPaymentMethodDataAllowRedisplay",
1159            )
1160        })
1161    }
1162}
1163/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
1164#[derive(Clone, Debug, serde::Serialize)]
1165pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit {
1166    /// The account number for the bank account.
1167    pub account_number: String,
1168    /// Bank-State-Branch number of the bank account.
1169    pub bsb_number: String,
1170}
1171impl CreatePaymentIntentPaymentMethodDataAuBecsDebit {
1172    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
1173        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
1174    }
1175}
1176/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
1177#[derive(Clone, Debug, serde::Serialize)]
1178pub struct CreatePaymentIntentPaymentMethodDataBacsDebit {
1179    /// Account number of the bank account that the funds will be debited from.
1180    #[serde(skip_serializing_if = "Option::is_none")]
1181    pub account_number: Option<String>,
1182    /// Sort code of the bank account. (e.g., `10-20-30`)
1183    #[serde(skip_serializing_if = "Option::is_none")]
1184    pub sort_code: Option<String>,
1185}
1186impl CreatePaymentIntentPaymentMethodDataBacsDebit {
1187    pub fn new() -> Self {
1188        Self { account_number: None, sort_code: None }
1189    }
1190}
1191impl Default for CreatePaymentIntentPaymentMethodDataBacsDebit {
1192    fn default() -> Self {
1193        Self::new()
1194    }
1195}
1196/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
1197#[derive(Clone, Debug, serde::Serialize)]
1198pub struct CreatePaymentIntentPaymentMethodDataBillingDetails {
1199    /// Billing address.
1200    #[serde(skip_serializing_if = "Option::is_none")]
1201    pub address: Option<CreatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
1202    /// Email address.
1203    #[serde(skip_serializing_if = "Option::is_none")]
1204    pub email: Option<String>,
1205    /// Full name.
1206    #[serde(skip_serializing_if = "Option::is_none")]
1207    pub name: Option<String>,
1208    /// Billing phone number (including extension).
1209    #[serde(skip_serializing_if = "Option::is_none")]
1210    pub phone: Option<String>,
1211    /// Taxpayer identification number.
1212    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
1213    #[serde(skip_serializing_if = "Option::is_none")]
1214    pub tax_id: Option<String>,
1215}
1216impl CreatePaymentIntentPaymentMethodDataBillingDetails {
1217    pub fn new() -> Self {
1218        Self { address: None, email: None, name: None, phone: None, tax_id: None }
1219    }
1220}
1221impl Default for CreatePaymentIntentPaymentMethodDataBillingDetails {
1222    fn default() -> Self {
1223        Self::new()
1224    }
1225}
1226/// Billing address.
1227#[derive(Clone, Debug, serde::Serialize)]
1228pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1229    /// City, district, suburb, town, or village.
1230    #[serde(skip_serializing_if = "Option::is_none")]
1231    pub city: Option<String>,
1232    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1233    #[serde(skip_serializing_if = "Option::is_none")]
1234    pub country: Option<String>,
1235    /// Address line 1, such as the street, PO Box, or company name.
1236    #[serde(skip_serializing_if = "Option::is_none")]
1237    pub line1: Option<String>,
1238    /// Address line 2, such as the apartment, suite, unit, or building.
1239    #[serde(skip_serializing_if = "Option::is_none")]
1240    pub line2: Option<String>,
1241    /// ZIP or postal code.
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub postal_code: Option<String>,
1244    /// State, county, province, or region.
1245    #[serde(skip_serializing_if = "Option::is_none")]
1246    pub state: Option<String>,
1247}
1248impl CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1249    pub fn new() -> Self {
1250        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
1251    }
1252}
1253impl Default for CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1254    fn default() -> Self {
1255        Self::new()
1256    }
1257}
1258/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
1259#[derive(Clone, Debug, serde::Serialize)]
1260pub struct CreatePaymentIntentPaymentMethodDataBoleto {
1261    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
1262    pub tax_id: String,
1263}
1264impl CreatePaymentIntentPaymentMethodDataBoleto {
1265    pub fn new(tax_id: impl Into<String>) -> Self {
1266        Self { tax_id: tax_id.into() }
1267    }
1268}
1269/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
1270#[derive(Clone, Debug, serde::Serialize)]
1271pub struct CreatePaymentIntentPaymentMethodDataEps {
1272    /// The customer's bank.
1273    #[serde(skip_serializing_if = "Option::is_none")]
1274    pub bank: Option<CreatePaymentIntentPaymentMethodDataEpsBank>,
1275}
1276impl CreatePaymentIntentPaymentMethodDataEps {
1277    pub fn new() -> Self {
1278        Self { bank: None }
1279    }
1280}
1281impl Default for CreatePaymentIntentPaymentMethodDataEps {
1282    fn default() -> Self {
1283        Self::new()
1284    }
1285}
1286/// The customer's bank.
1287#[derive(Clone, Eq, PartialEq)]
1288#[non_exhaustive]
1289pub enum CreatePaymentIntentPaymentMethodDataEpsBank {
1290    ArzteUndApothekerBank,
1291    AustrianAnadiBankAg,
1292    BankAustria,
1293    BankhausCarlSpangler,
1294    BankhausSchelhammerUndSchatteraAg,
1295    BawagPskAg,
1296    BksBankAg,
1297    BrullKallmusBankAg,
1298    BtvVierLanderBank,
1299    CapitalBankGraweGruppeAg,
1300    DeutscheBankAg,
1301    Dolomitenbank,
1302    EasybankAg,
1303    ErsteBankUndSparkassen,
1304    HypoAlpeadriabankInternationalAg,
1305    HypoBankBurgenlandAktiengesellschaft,
1306    HypoNoeLbFurNiederosterreichUWien,
1307    HypoOberosterreichSalzburgSteiermark,
1308    HypoTirolBankAg,
1309    HypoVorarlbergBankAg,
1310    MarchfelderBank,
1311    OberbankAg,
1312    RaiffeisenBankengruppeOsterreich,
1313    SchoellerbankAg,
1314    SpardaBankWien,
1315    VolksbankGruppe,
1316    VolkskreditbankAg,
1317    VrBankBraunau,
1318    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1319    Unknown(String),
1320}
1321impl CreatePaymentIntentPaymentMethodDataEpsBank {
1322    pub fn as_str(&self) -> &str {
1323        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1324        match self {
1325            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1326            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1327            BankAustria => "bank_austria",
1328            BankhausCarlSpangler => "bankhaus_carl_spangler",
1329            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
1330            BawagPskAg => "bawag_psk_ag",
1331            BksBankAg => "bks_bank_ag",
1332            BrullKallmusBankAg => "brull_kallmus_bank_ag",
1333            BtvVierLanderBank => "btv_vier_lander_bank",
1334            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1335            DeutscheBankAg => "deutsche_bank_ag",
1336            Dolomitenbank => "dolomitenbank",
1337            EasybankAg => "easybank_ag",
1338            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1339            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
1340            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
1341            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
1342            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
1343            HypoTirolBankAg => "hypo_tirol_bank_ag",
1344            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1345            MarchfelderBank => "marchfelder_bank",
1346            OberbankAg => "oberbank_ag",
1347            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
1348            SchoellerbankAg => "schoellerbank_ag",
1349            SpardaBankWien => "sparda_bank_wien",
1350            VolksbankGruppe => "volksbank_gruppe",
1351            VolkskreditbankAg => "volkskreditbank_ag",
1352            VrBankBraunau => "vr_bank_braunau",
1353            Unknown(v) => v,
1354        }
1355    }
1356}
1357
1358impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataEpsBank {
1359    type Err = std::convert::Infallible;
1360    fn from_str(s: &str) -> Result<Self, Self::Err> {
1361        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1362        match s {
1363            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
1364            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
1365            "bank_austria" => Ok(BankAustria),
1366            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
1367            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
1368            "bawag_psk_ag" => Ok(BawagPskAg),
1369            "bks_bank_ag" => Ok(BksBankAg),
1370            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
1371            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
1372            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
1373            "deutsche_bank_ag" => Ok(DeutscheBankAg),
1374            "dolomitenbank" => Ok(Dolomitenbank),
1375            "easybank_ag" => Ok(EasybankAg),
1376            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
1377            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
1378            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
1379            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
1380            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
1381            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
1382            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
1383            "marchfelder_bank" => Ok(MarchfelderBank),
1384            "oberbank_ag" => Ok(OberbankAg),
1385            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
1386            "schoellerbank_ag" => Ok(SchoellerbankAg),
1387            "sparda_bank_wien" => Ok(SpardaBankWien),
1388            "volksbank_gruppe" => Ok(VolksbankGruppe),
1389            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
1390            "vr_bank_braunau" => Ok(VrBankBraunau),
1391            v => Ok(Unknown(v.to_owned())),
1392        }
1393    }
1394}
1395impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank {
1396    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1397        f.write_str(self.as_str())
1398    }
1399}
1400
1401impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataEpsBank {
1402    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1403        f.write_str(self.as_str())
1404    }
1405}
1406impl serde::Serialize for CreatePaymentIntentPaymentMethodDataEpsBank {
1407    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1408    where
1409        S: serde::Serializer,
1410    {
1411        serializer.serialize_str(self.as_str())
1412    }
1413}
1414#[cfg(feature = "deserialize")]
1415impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataEpsBank {
1416    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1417        use std::str::FromStr;
1418        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1419        Ok(Self::from_str(&s).unwrap())
1420    }
1421}
1422/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1423#[derive(Clone, Debug, serde::Serialize)]
1424pub struct CreatePaymentIntentPaymentMethodDataFpx {
1425    /// Account holder type for FPX transaction
1426    #[serde(skip_serializing_if = "Option::is_none")]
1427    pub account_holder_type: Option<CreatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
1428    /// The customer's bank.
1429    pub bank: CreatePaymentIntentPaymentMethodDataFpxBank,
1430}
1431impl CreatePaymentIntentPaymentMethodDataFpx {
1432    pub fn new(bank: impl Into<CreatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
1433        Self { account_holder_type: None, bank: bank.into() }
1434    }
1435}
1436/// Account holder type for FPX transaction
1437#[derive(Copy, Clone, Eq, PartialEq)]
1438pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1439    Company,
1440    Individual,
1441}
1442impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1443    pub fn as_str(self) -> &'static str {
1444        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1445        match self {
1446            Company => "company",
1447            Individual => "individual",
1448        }
1449    }
1450}
1451
1452impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1453    type Err = stripe_types::StripeParseError;
1454    fn from_str(s: &str) -> Result<Self, Self::Err> {
1455        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1456        match s {
1457            "company" => Ok(Company),
1458            "individual" => Ok(Individual),
1459            _ => Err(stripe_types::StripeParseError),
1460        }
1461    }
1462}
1463impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1465        f.write_str(self.as_str())
1466    }
1467}
1468
1469impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1471        f.write_str(self.as_str())
1472    }
1473}
1474impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1475    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1476    where
1477        S: serde::Serializer,
1478    {
1479        serializer.serialize_str(self.as_str())
1480    }
1481}
1482#[cfg(feature = "deserialize")]
1483impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1484    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1485        use std::str::FromStr;
1486        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1487        Self::from_str(&s).map_err(|_| {
1488            serde::de::Error::custom(
1489                "Unknown value for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType",
1490            )
1491        })
1492    }
1493}
1494/// The customer's bank.
1495#[derive(Clone, Eq, PartialEq)]
1496#[non_exhaustive]
1497pub enum CreatePaymentIntentPaymentMethodDataFpxBank {
1498    AffinBank,
1499    Agrobank,
1500    AllianceBank,
1501    Ambank,
1502    BankIslam,
1503    BankMuamalat,
1504    BankOfChina,
1505    BankRakyat,
1506    Bsn,
1507    Cimb,
1508    DeutscheBank,
1509    HongLeongBank,
1510    Hsbc,
1511    Kfh,
1512    Maybank2e,
1513    Maybank2u,
1514    Ocbc,
1515    PbEnterprise,
1516    PublicBank,
1517    Rhb,
1518    StandardChartered,
1519    Uob,
1520    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1521    Unknown(String),
1522}
1523impl CreatePaymentIntentPaymentMethodDataFpxBank {
1524    pub fn as_str(&self) -> &str {
1525        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1526        match self {
1527            AffinBank => "affin_bank",
1528            Agrobank => "agrobank",
1529            AllianceBank => "alliance_bank",
1530            Ambank => "ambank",
1531            BankIslam => "bank_islam",
1532            BankMuamalat => "bank_muamalat",
1533            BankOfChina => "bank_of_china",
1534            BankRakyat => "bank_rakyat",
1535            Bsn => "bsn",
1536            Cimb => "cimb",
1537            DeutscheBank => "deutsche_bank",
1538            HongLeongBank => "hong_leong_bank",
1539            Hsbc => "hsbc",
1540            Kfh => "kfh",
1541            Maybank2e => "maybank2e",
1542            Maybank2u => "maybank2u",
1543            Ocbc => "ocbc",
1544            PbEnterprise => "pb_enterprise",
1545            PublicBank => "public_bank",
1546            Rhb => "rhb",
1547            StandardChartered => "standard_chartered",
1548            Uob => "uob",
1549            Unknown(v) => v,
1550        }
1551    }
1552}
1553
1554impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxBank {
1555    type Err = std::convert::Infallible;
1556    fn from_str(s: &str) -> Result<Self, Self::Err> {
1557        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1558        match s {
1559            "affin_bank" => Ok(AffinBank),
1560            "agrobank" => Ok(Agrobank),
1561            "alliance_bank" => Ok(AllianceBank),
1562            "ambank" => Ok(Ambank),
1563            "bank_islam" => Ok(BankIslam),
1564            "bank_muamalat" => Ok(BankMuamalat),
1565            "bank_of_china" => Ok(BankOfChina),
1566            "bank_rakyat" => Ok(BankRakyat),
1567            "bsn" => Ok(Bsn),
1568            "cimb" => Ok(Cimb),
1569            "deutsche_bank" => Ok(DeutscheBank),
1570            "hong_leong_bank" => Ok(HongLeongBank),
1571            "hsbc" => Ok(Hsbc),
1572            "kfh" => Ok(Kfh),
1573            "maybank2e" => Ok(Maybank2e),
1574            "maybank2u" => Ok(Maybank2u),
1575            "ocbc" => Ok(Ocbc),
1576            "pb_enterprise" => Ok(PbEnterprise),
1577            "public_bank" => Ok(PublicBank),
1578            "rhb" => Ok(Rhb),
1579            "standard_chartered" => Ok(StandardChartered),
1580            "uob" => Ok(Uob),
1581            v => Ok(Unknown(v.to_owned())),
1582        }
1583    }
1584}
1585impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank {
1586    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1587        f.write_str(self.as_str())
1588    }
1589}
1590
1591impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxBank {
1592    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1593        f.write_str(self.as_str())
1594    }
1595}
1596impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxBank {
1597    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1598    where
1599        S: serde::Serializer,
1600    {
1601        serializer.serialize_str(self.as_str())
1602    }
1603}
1604#[cfg(feature = "deserialize")]
1605impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxBank {
1606    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1607        use std::str::FromStr;
1608        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1609        Ok(Self::from_str(&s).unwrap())
1610    }
1611}
1612/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1613#[derive(Clone, Debug, serde::Serialize)]
1614pub struct CreatePaymentIntentPaymentMethodDataIdeal {
1615    /// The customer's bank.
1616    /// Only use this parameter for existing customers.
1617    /// Don't use it for new customers.
1618    #[serde(skip_serializing_if = "Option::is_none")]
1619    pub bank: Option<CreatePaymentIntentPaymentMethodDataIdealBank>,
1620}
1621impl CreatePaymentIntentPaymentMethodDataIdeal {
1622    pub fn new() -> Self {
1623        Self { bank: None }
1624    }
1625}
1626impl Default for CreatePaymentIntentPaymentMethodDataIdeal {
1627    fn default() -> Self {
1628        Self::new()
1629    }
1630}
1631/// The customer's bank.
1632/// Only use this parameter for existing customers.
1633/// Don't use it for new customers.
1634#[derive(Clone, Eq, PartialEq)]
1635#[non_exhaustive]
1636pub enum CreatePaymentIntentPaymentMethodDataIdealBank {
1637    AbnAmro,
1638    AsnBank,
1639    Bunq,
1640    Buut,
1641    Finom,
1642    Handelsbanken,
1643    Ing,
1644    Knab,
1645    Moneyou,
1646    N26,
1647    Nn,
1648    Rabobank,
1649    Regiobank,
1650    Revolut,
1651    SnsBank,
1652    TriodosBank,
1653    VanLanschot,
1654    Yoursafe,
1655    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1656    Unknown(String),
1657}
1658impl CreatePaymentIntentPaymentMethodDataIdealBank {
1659    pub fn as_str(&self) -> &str {
1660        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1661        match self {
1662            AbnAmro => "abn_amro",
1663            AsnBank => "asn_bank",
1664            Bunq => "bunq",
1665            Buut => "buut",
1666            Finom => "finom",
1667            Handelsbanken => "handelsbanken",
1668            Ing => "ing",
1669            Knab => "knab",
1670            Moneyou => "moneyou",
1671            N26 => "n26",
1672            Nn => "nn",
1673            Rabobank => "rabobank",
1674            Regiobank => "regiobank",
1675            Revolut => "revolut",
1676            SnsBank => "sns_bank",
1677            TriodosBank => "triodos_bank",
1678            VanLanschot => "van_lanschot",
1679            Yoursafe => "yoursafe",
1680            Unknown(v) => v,
1681        }
1682    }
1683}
1684
1685impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataIdealBank {
1686    type Err = std::convert::Infallible;
1687    fn from_str(s: &str) -> Result<Self, Self::Err> {
1688        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1689        match s {
1690            "abn_amro" => Ok(AbnAmro),
1691            "asn_bank" => Ok(AsnBank),
1692            "bunq" => Ok(Bunq),
1693            "buut" => Ok(Buut),
1694            "finom" => Ok(Finom),
1695            "handelsbanken" => Ok(Handelsbanken),
1696            "ing" => Ok(Ing),
1697            "knab" => Ok(Knab),
1698            "moneyou" => Ok(Moneyou),
1699            "n26" => Ok(N26),
1700            "nn" => Ok(Nn),
1701            "rabobank" => Ok(Rabobank),
1702            "regiobank" => Ok(Regiobank),
1703            "revolut" => Ok(Revolut),
1704            "sns_bank" => Ok(SnsBank),
1705            "triodos_bank" => Ok(TriodosBank),
1706            "van_lanschot" => Ok(VanLanschot),
1707            "yoursafe" => Ok(Yoursafe),
1708            v => Ok(Unknown(v.to_owned())),
1709        }
1710    }
1711}
1712impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank {
1713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1714        f.write_str(self.as_str())
1715    }
1716}
1717
1718impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataIdealBank {
1719    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1720        f.write_str(self.as_str())
1721    }
1722}
1723impl serde::Serialize for CreatePaymentIntentPaymentMethodDataIdealBank {
1724    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1725    where
1726        S: serde::Serializer,
1727    {
1728        serializer.serialize_str(self.as_str())
1729    }
1730}
1731#[cfg(feature = "deserialize")]
1732impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataIdealBank {
1733    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1734        use std::str::FromStr;
1735        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1736        Ok(Self::from_str(&s).unwrap())
1737    }
1738}
1739/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1740#[derive(Copy, Clone, Debug, serde::Serialize)]
1741pub struct CreatePaymentIntentPaymentMethodDataKlarna {
1742    /// Customer's date of birth
1743    #[serde(skip_serializing_if = "Option::is_none")]
1744    pub dob: Option<DateOfBirth>,
1745}
1746impl CreatePaymentIntentPaymentMethodDataKlarna {
1747    pub fn new() -> Self {
1748        Self { dob: None }
1749    }
1750}
1751impl Default for CreatePaymentIntentPaymentMethodDataKlarna {
1752    fn default() -> Self {
1753        Self::new()
1754    }
1755}
1756/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1757#[derive(Copy, Clone, Debug, serde::Serialize)]
1758pub struct CreatePaymentIntentPaymentMethodDataNaverPay {
1759    /// Whether to use Naver Pay points or a card to fund this transaction.
1760    /// If not provided, this defaults to `card`.
1761    #[serde(skip_serializing_if = "Option::is_none")]
1762    pub funding: Option<CreatePaymentIntentPaymentMethodDataNaverPayFunding>,
1763}
1764impl CreatePaymentIntentPaymentMethodDataNaverPay {
1765    pub fn new() -> Self {
1766        Self { funding: None }
1767    }
1768}
1769impl Default for CreatePaymentIntentPaymentMethodDataNaverPay {
1770    fn default() -> Self {
1771        Self::new()
1772    }
1773}
1774/// Whether to use Naver Pay points or a card to fund this transaction.
1775/// If not provided, this defaults to `card`.
1776#[derive(Copy, Clone, Eq, PartialEq)]
1777pub enum CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1778    Card,
1779    Points,
1780}
1781impl CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1782    pub fn as_str(self) -> &'static str {
1783        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1784        match self {
1785            Card => "card",
1786            Points => "points",
1787        }
1788    }
1789}
1790
1791impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1792    type Err = stripe_types::StripeParseError;
1793    fn from_str(s: &str) -> Result<Self, Self::Err> {
1794        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1795        match s {
1796            "card" => Ok(Card),
1797            "points" => Ok(Points),
1798            _ => Err(stripe_types::StripeParseError),
1799        }
1800    }
1801}
1802impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1804        f.write_str(self.as_str())
1805    }
1806}
1807
1808impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1809    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1810        f.write_str(self.as_str())
1811    }
1812}
1813impl serde::Serialize for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1814    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1815    where
1816        S: serde::Serializer,
1817    {
1818        serializer.serialize_str(self.as_str())
1819    }
1820}
1821#[cfg(feature = "deserialize")]
1822impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1823    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1824        use std::str::FromStr;
1825        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1826        Self::from_str(&s).map_err(|_| {
1827            serde::de::Error::custom(
1828                "Unknown value for CreatePaymentIntentPaymentMethodDataNaverPayFunding",
1829            )
1830        })
1831    }
1832}
1833/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1834#[derive(Clone, Debug, serde::Serialize)]
1835pub struct CreatePaymentIntentPaymentMethodDataNzBankAccount {
1836    /// The name on the bank account.
1837    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1838    #[serde(skip_serializing_if = "Option::is_none")]
1839    pub account_holder_name: Option<String>,
1840    /// The account number for the bank account.
1841    pub account_number: String,
1842    /// The numeric code for the bank account's bank.
1843    pub bank_code: String,
1844    /// The numeric code for the bank account's bank branch.
1845    pub branch_code: String,
1846    #[serde(skip_serializing_if = "Option::is_none")]
1847    pub reference: Option<String>,
1848    /// The suffix of the bank account number.
1849    pub suffix: String,
1850}
1851impl CreatePaymentIntentPaymentMethodDataNzBankAccount {
1852    pub fn new(
1853        account_number: impl Into<String>,
1854        bank_code: impl Into<String>,
1855        branch_code: impl Into<String>,
1856        suffix: impl Into<String>,
1857    ) -> Self {
1858        Self {
1859            account_holder_name: None,
1860            account_number: account_number.into(),
1861            bank_code: bank_code.into(),
1862            branch_code: branch_code.into(),
1863            reference: None,
1864            suffix: suffix.into(),
1865        }
1866    }
1867}
1868/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1869#[derive(Clone, Debug, serde::Serialize)]
1870pub struct CreatePaymentIntentPaymentMethodDataP24 {
1871    /// The customer's bank.
1872    #[serde(skip_serializing_if = "Option::is_none")]
1873    pub bank: Option<CreatePaymentIntentPaymentMethodDataP24Bank>,
1874}
1875impl CreatePaymentIntentPaymentMethodDataP24 {
1876    pub fn new() -> Self {
1877        Self { bank: None }
1878    }
1879}
1880impl Default for CreatePaymentIntentPaymentMethodDataP24 {
1881    fn default() -> Self {
1882        Self::new()
1883    }
1884}
1885/// The customer's bank.
1886#[derive(Clone, Eq, PartialEq)]
1887#[non_exhaustive]
1888pub enum CreatePaymentIntentPaymentMethodDataP24Bank {
1889    AliorBank,
1890    BankMillennium,
1891    BankNowyBfgSa,
1892    BankPekaoSa,
1893    BankiSpbdzielcze,
1894    Blik,
1895    BnpParibas,
1896    Boz,
1897    CitiHandlowy,
1898    CreditAgricole,
1899    Envelobank,
1900    EtransferPocztowy24,
1901    GetinBank,
1902    Ideabank,
1903    Ing,
1904    Inteligo,
1905    MbankMtransfer,
1906    NestPrzelew,
1907    NoblePay,
1908    PbacZIpko,
1909    PlusBank,
1910    SantanderPrzelew24,
1911    TmobileUsbugiBankowe,
1912    ToyotaBank,
1913    Velobank,
1914    VolkswagenBank,
1915    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1916    Unknown(String),
1917}
1918impl CreatePaymentIntentPaymentMethodDataP24Bank {
1919    pub fn as_str(&self) -> &str {
1920        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1921        match self {
1922            AliorBank => "alior_bank",
1923            BankMillennium => "bank_millennium",
1924            BankNowyBfgSa => "bank_nowy_bfg_sa",
1925            BankPekaoSa => "bank_pekao_sa",
1926            BankiSpbdzielcze => "banki_spbdzielcze",
1927            Blik => "blik",
1928            BnpParibas => "bnp_paribas",
1929            Boz => "boz",
1930            CitiHandlowy => "citi_handlowy",
1931            CreditAgricole => "credit_agricole",
1932            Envelobank => "envelobank",
1933            EtransferPocztowy24 => "etransfer_pocztowy24",
1934            GetinBank => "getin_bank",
1935            Ideabank => "ideabank",
1936            Ing => "ing",
1937            Inteligo => "inteligo",
1938            MbankMtransfer => "mbank_mtransfer",
1939            NestPrzelew => "nest_przelew",
1940            NoblePay => "noble_pay",
1941            PbacZIpko => "pbac_z_ipko",
1942            PlusBank => "plus_bank",
1943            SantanderPrzelew24 => "santander_przelew24",
1944            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1945            ToyotaBank => "toyota_bank",
1946            Velobank => "velobank",
1947            VolkswagenBank => "volkswagen_bank",
1948            Unknown(v) => v,
1949        }
1950    }
1951}
1952
1953impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataP24Bank {
1954    type Err = std::convert::Infallible;
1955    fn from_str(s: &str) -> Result<Self, Self::Err> {
1956        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1957        match s {
1958            "alior_bank" => Ok(AliorBank),
1959            "bank_millennium" => Ok(BankMillennium),
1960            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1961            "bank_pekao_sa" => Ok(BankPekaoSa),
1962            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1963            "blik" => Ok(Blik),
1964            "bnp_paribas" => Ok(BnpParibas),
1965            "boz" => Ok(Boz),
1966            "citi_handlowy" => Ok(CitiHandlowy),
1967            "credit_agricole" => Ok(CreditAgricole),
1968            "envelobank" => Ok(Envelobank),
1969            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1970            "getin_bank" => Ok(GetinBank),
1971            "ideabank" => Ok(Ideabank),
1972            "ing" => Ok(Ing),
1973            "inteligo" => Ok(Inteligo),
1974            "mbank_mtransfer" => Ok(MbankMtransfer),
1975            "nest_przelew" => Ok(NestPrzelew),
1976            "noble_pay" => Ok(NoblePay),
1977            "pbac_z_ipko" => Ok(PbacZIpko),
1978            "plus_bank" => Ok(PlusBank),
1979            "santander_przelew24" => Ok(SantanderPrzelew24),
1980            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1981            "toyota_bank" => Ok(ToyotaBank),
1982            "velobank" => Ok(Velobank),
1983            "volkswagen_bank" => Ok(VolkswagenBank),
1984            v => Ok(Unknown(v.to_owned())),
1985        }
1986    }
1987}
1988impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank {
1989    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1990        f.write_str(self.as_str())
1991    }
1992}
1993
1994impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataP24Bank {
1995    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1996        f.write_str(self.as_str())
1997    }
1998}
1999impl serde::Serialize for CreatePaymentIntentPaymentMethodDataP24Bank {
2000    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2001    where
2002        S: serde::Serializer,
2003    {
2004        serializer.serialize_str(self.as_str())
2005    }
2006}
2007#[cfg(feature = "deserialize")]
2008impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataP24Bank {
2009    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2010        use std::str::FromStr;
2011        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2012        Ok(Self::from_str(&s).unwrap())
2013    }
2014}
2015/// Options to configure Radar.
2016/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
2017#[derive(Clone, Debug, serde::Serialize)]
2018pub struct CreatePaymentIntentPaymentMethodDataRadarOptions {
2019    /// 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.
2020    #[serde(skip_serializing_if = "Option::is_none")]
2021    pub session: Option<String>,
2022}
2023impl CreatePaymentIntentPaymentMethodDataRadarOptions {
2024    pub fn new() -> Self {
2025        Self { session: None }
2026    }
2027}
2028impl Default for CreatePaymentIntentPaymentMethodDataRadarOptions {
2029    fn default() -> Self {
2030        Self::new()
2031    }
2032}
2033/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
2034#[derive(Clone, Debug, serde::Serialize)]
2035pub struct CreatePaymentIntentPaymentMethodDataSepaDebit {
2036    /// IBAN of the bank account.
2037    pub iban: String,
2038}
2039impl CreatePaymentIntentPaymentMethodDataSepaDebit {
2040    pub fn new(iban: impl Into<String>) -> Self {
2041        Self { iban: iban.into() }
2042    }
2043}
2044/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
2045#[derive(Copy, Clone, Debug, serde::Serialize)]
2046pub struct CreatePaymentIntentPaymentMethodDataSofort {
2047    /// Two-letter ISO code representing the country the bank account is located in.
2048    pub country: CreatePaymentIntentPaymentMethodDataSofortCountry,
2049}
2050impl CreatePaymentIntentPaymentMethodDataSofort {
2051    pub fn new(country: impl Into<CreatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
2052        Self { country: country.into() }
2053    }
2054}
2055/// Two-letter ISO code representing the country the bank account is located in.
2056#[derive(Copy, Clone, Eq, PartialEq)]
2057pub enum CreatePaymentIntentPaymentMethodDataSofortCountry {
2058    At,
2059    Be,
2060    De,
2061    Es,
2062    It,
2063    Nl,
2064}
2065impl CreatePaymentIntentPaymentMethodDataSofortCountry {
2066    pub fn as_str(self) -> &'static str {
2067        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
2068        match self {
2069            At => "AT",
2070            Be => "BE",
2071            De => "DE",
2072            Es => "ES",
2073            It => "IT",
2074            Nl => "NL",
2075        }
2076    }
2077}
2078
2079impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataSofortCountry {
2080    type Err = stripe_types::StripeParseError;
2081    fn from_str(s: &str) -> Result<Self, Self::Err> {
2082        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
2083        match s {
2084            "AT" => Ok(At),
2085            "BE" => Ok(Be),
2086            "DE" => Ok(De),
2087            "ES" => Ok(Es),
2088            "IT" => Ok(It),
2089            "NL" => Ok(Nl),
2090            _ => Err(stripe_types::StripeParseError),
2091        }
2092    }
2093}
2094impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry {
2095    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2096        f.write_str(self.as_str())
2097    }
2098}
2099
2100impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataSofortCountry {
2101    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2102        f.write_str(self.as_str())
2103    }
2104}
2105impl serde::Serialize for CreatePaymentIntentPaymentMethodDataSofortCountry {
2106    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2107    where
2108        S: serde::Serializer,
2109    {
2110        serializer.serialize_str(self.as_str())
2111    }
2112}
2113#[cfg(feature = "deserialize")]
2114impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataSofortCountry {
2115    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2116        use std::str::FromStr;
2117        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2118        Self::from_str(&s).map_err(|_| {
2119            serde::de::Error::custom(
2120                "Unknown value for CreatePaymentIntentPaymentMethodDataSofortCountry",
2121            )
2122        })
2123    }
2124}
2125/// The type of the PaymentMethod.
2126/// An additional hash is included on the PaymentMethod with a name matching this value.
2127/// It contains additional information specific to the PaymentMethod type.
2128#[derive(Clone, Eq, PartialEq)]
2129#[non_exhaustive]
2130pub enum CreatePaymentIntentPaymentMethodDataType {
2131    AcssDebit,
2132    Affirm,
2133    AfterpayClearpay,
2134    Alipay,
2135    Alma,
2136    AmazonPay,
2137    AuBecsDebit,
2138    BacsDebit,
2139    Bancontact,
2140    Billie,
2141    Blik,
2142    Boleto,
2143    Cashapp,
2144    Crypto,
2145    CustomerBalance,
2146    Eps,
2147    Fpx,
2148    Giropay,
2149    Grabpay,
2150    Ideal,
2151    KakaoPay,
2152    Klarna,
2153    Konbini,
2154    KrCard,
2155    Link,
2156    MbWay,
2157    Mobilepay,
2158    Multibanco,
2159    NaverPay,
2160    NzBankAccount,
2161    Oxxo,
2162    P24,
2163    PayByBank,
2164    Payco,
2165    Paynow,
2166    Paypal,
2167    Pix,
2168    Promptpay,
2169    RevolutPay,
2170    SamsungPay,
2171    Satispay,
2172    SepaDebit,
2173    Sofort,
2174    Swish,
2175    Twint,
2176    UsBankAccount,
2177    WechatPay,
2178    Zip,
2179    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2180    Unknown(String),
2181}
2182impl CreatePaymentIntentPaymentMethodDataType {
2183    pub fn as_str(&self) -> &str {
2184        use CreatePaymentIntentPaymentMethodDataType::*;
2185        match self {
2186            AcssDebit => "acss_debit",
2187            Affirm => "affirm",
2188            AfterpayClearpay => "afterpay_clearpay",
2189            Alipay => "alipay",
2190            Alma => "alma",
2191            AmazonPay => "amazon_pay",
2192            AuBecsDebit => "au_becs_debit",
2193            BacsDebit => "bacs_debit",
2194            Bancontact => "bancontact",
2195            Billie => "billie",
2196            Blik => "blik",
2197            Boleto => "boleto",
2198            Cashapp => "cashapp",
2199            Crypto => "crypto",
2200            CustomerBalance => "customer_balance",
2201            Eps => "eps",
2202            Fpx => "fpx",
2203            Giropay => "giropay",
2204            Grabpay => "grabpay",
2205            Ideal => "ideal",
2206            KakaoPay => "kakao_pay",
2207            Klarna => "klarna",
2208            Konbini => "konbini",
2209            KrCard => "kr_card",
2210            Link => "link",
2211            MbWay => "mb_way",
2212            Mobilepay => "mobilepay",
2213            Multibanco => "multibanco",
2214            NaverPay => "naver_pay",
2215            NzBankAccount => "nz_bank_account",
2216            Oxxo => "oxxo",
2217            P24 => "p24",
2218            PayByBank => "pay_by_bank",
2219            Payco => "payco",
2220            Paynow => "paynow",
2221            Paypal => "paypal",
2222            Pix => "pix",
2223            Promptpay => "promptpay",
2224            RevolutPay => "revolut_pay",
2225            SamsungPay => "samsung_pay",
2226            Satispay => "satispay",
2227            SepaDebit => "sepa_debit",
2228            Sofort => "sofort",
2229            Swish => "swish",
2230            Twint => "twint",
2231            UsBankAccount => "us_bank_account",
2232            WechatPay => "wechat_pay",
2233            Zip => "zip",
2234            Unknown(v) => v,
2235        }
2236    }
2237}
2238
2239impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataType {
2240    type Err = std::convert::Infallible;
2241    fn from_str(s: &str) -> Result<Self, Self::Err> {
2242        use CreatePaymentIntentPaymentMethodDataType::*;
2243        match s {
2244            "acss_debit" => Ok(AcssDebit),
2245            "affirm" => Ok(Affirm),
2246            "afterpay_clearpay" => Ok(AfterpayClearpay),
2247            "alipay" => Ok(Alipay),
2248            "alma" => Ok(Alma),
2249            "amazon_pay" => Ok(AmazonPay),
2250            "au_becs_debit" => Ok(AuBecsDebit),
2251            "bacs_debit" => Ok(BacsDebit),
2252            "bancontact" => Ok(Bancontact),
2253            "billie" => Ok(Billie),
2254            "blik" => Ok(Blik),
2255            "boleto" => Ok(Boleto),
2256            "cashapp" => Ok(Cashapp),
2257            "crypto" => Ok(Crypto),
2258            "customer_balance" => Ok(CustomerBalance),
2259            "eps" => Ok(Eps),
2260            "fpx" => Ok(Fpx),
2261            "giropay" => Ok(Giropay),
2262            "grabpay" => Ok(Grabpay),
2263            "ideal" => Ok(Ideal),
2264            "kakao_pay" => Ok(KakaoPay),
2265            "klarna" => Ok(Klarna),
2266            "konbini" => Ok(Konbini),
2267            "kr_card" => Ok(KrCard),
2268            "link" => Ok(Link),
2269            "mb_way" => Ok(MbWay),
2270            "mobilepay" => Ok(Mobilepay),
2271            "multibanco" => Ok(Multibanco),
2272            "naver_pay" => Ok(NaverPay),
2273            "nz_bank_account" => Ok(NzBankAccount),
2274            "oxxo" => Ok(Oxxo),
2275            "p24" => Ok(P24),
2276            "pay_by_bank" => Ok(PayByBank),
2277            "payco" => Ok(Payco),
2278            "paynow" => Ok(Paynow),
2279            "paypal" => Ok(Paypal),
2280            "pix" => Ok(Pix),
2281            "promptpay" => Ok(Promptpay),
2282            "revolut_pay" => Ok(RevolutPay),
2283            "samsung_pay" => Ok(SamsungPay),
2284            "satispay" => Ok(Satispay),
2285            "sepa_debit" => Ok(SepaDebit),
2286            "sofort" => Ok(Sofort),
2287            "swish" => Ok(Swish),
2288            "twint" => Ok(Twint),
2289            "us_bank_account" => Ok(UsBankAccount),
2290            "wechat_pay" => Ok(WechatPay),
2291            "zip" => Ok(Zip),
2292            v => Ok(Unknown(v.to_owned())),
2293        }
2294    }
2295}
2296impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType {
2297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2298        f.write_str(self.as_str())
2299    }
2300}
2301
2302impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataType {
2303    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2304        f.write_str(self.as_str())
2305    }
2306}
2307impl serde::Serialize for CreatePaymentIntentPaymentMethodDataType {
2308    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2309    where
2310        S: serde::Serializer,
2311    {
2312        serializer.serialize_str(self.as_str())
2313    }
2314}
2315#[cfg(feature = "deserialize")]
2316impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataType {
2317    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2318        use std::str::FromStr;
2319        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2320        Ok(Self::from_str(&s).unwrap())
2321    }
2322}
2323/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
2324#[derive(Clone, Debug, serde::Serialize)]
2325pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount {
2326    /// Account holder type: individual or company.
2327    #[serde(skip_serializing_if = "Option::is_none")]
2328    pub account_holder_type:
2329        Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
2330    /// Account number of the bank account.
2331    #[serde(skip_serializing_if = "Option::is_none")]
2332    pub account_number: Option<String>,
2333    /// Account type: checkings or savings. Defaults to checking if omitted.
2334    #[serde(skip_serializing_if = "Option::is_none")]
2335    pub account_type: Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
2336    /// The ID of a Financial Connections Account to use as a payment method.
2337    #[serde(skip_serializing_if = "Option::is_none")]
2338    pub financial_connections_account: Option<String>,
2339    /// Routing number of the bank account.
2340    #[serde(skip_serializing_if = "Option::is_none")]
2341    pub routing_number: Option<String>,
2342}
2343impl CreatePaymentIntentPaymentMethodDataUsBankAccount {
2344    pub fn new() -> Self {
2345        Self {
2346            account_holder_type: None,
2347            account_number: None,
2348            account_type: None,
2349            financial_connections_account: None,
2350            routing_number: None,
2351        }
2352    }
2353}
2354impl Default for CreatePaymentIntentPaymentMethodDataUsBankAccount {
2355    fn default() -> Self {
2356        Self::new()
2357    }
2358}
2359/// Account holder type: individual or company.
2360#[derive(Copy, Clone, Eq, PartialEq)]
2361pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2362    Company,
2363    Individual,
2364}
2365impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2366    pub fn as_str(self) -> &'static str {
2367        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2368        match self {
2369            Company => "company",
2370            Individual => "individual",
2371        }
2372    }
2373}
2374
2375impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2376    type Err = stripe_types::StripeParseError;
2377    fn from_str(s: &str) -> Result<Self, Self::Err> {
2378        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2379        match s {
2380            "company" => Ok(Company),
2381            "individual" => Ok(Individual),
2382            _ => Err(stripe_types::StripeParseError),
2383        }
2384    }
2385}
2386impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2388        f.write_str(self.as_str())
2389    }
2390}
2391
2392impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2394        f.write_str(self.as_str())
2395    }
2396}
2397impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2398    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2399    where
2400        S: serde::Serializer,
2401    {
2402        serializer.serialize_str(self.as_str())
2403    }
2404}
2405#[cfg(feature = "deserialize")]
2406impl<'de> serde::Deserialize<'de>
2407    for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
2408{
2409    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2410        use std::str::FromStr;
2411        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2412        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
2413    }
2414}
2415/// Account type: checkings or savings. Defaults to checking if omitted.
2416#[derive(Copy, Clone, Eq, PartialEq)]
2417pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2418    Checking,
2419    Savings,
2420}
2421impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2422    pub fn as_str(self) -> &'static str {
2423        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2424        match self {
2425            Checking => "checking",
2426            Savings => "savings",
2427        }
2428    }
2429}
2430
2431impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2432    type Err = stripe_types::StripeParseError;
2433    fn from_str(s: &str) -> Result<Self, Self::Err> {
2434        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2435        match s {
2436            "checking" => Ok(Checking),
2437            "savings" => Ok(Savings),
2438            _ => Err(stripe_types::StripeParseError),
2439        }
2440    }
2441}
2442impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2444        f.write_str(self.as_str())
2445    }
2446}
2447
2448impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2449    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2450        f.write_str(self.as_str())
2451    }
2452}
2453impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2454    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2455    where
2456        S: serde::Serializer,
2457    {
2458        serializer.serialize_str(self.as_str())
2459    }
2460}
2461#[cfg(feature = "deserialize")]
2462impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2463    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2464        use std::str::FromStr;
2465        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2466        Self::from_str(&s).map_err(|_| {
2467            serde::de::Error::custom(
2468                "Unknown value for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType",
2469            )
2470        })
2471    }
2472}
2473/// Payment method-specific configuration for this PaymentIntent.
2474#[derive(Clone, Debug, serde::Serialize)]
2475pub struct CreatePaymentIntentPaymentMethodOptions {
2476    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2477    #[serde(skip_serializing_if = "Option::is_none")]
2478    pub acss_debit: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebit>,
2479    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
2480    #[serde(skip_serializing_if = "Option::is_none")]
2481    pub affirm: Option<CreatePaymentIntentPaymentMethodOptionsAffirm>,
2482    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
2483    #[serde(skip_serializing_if = "Option::is_none")]
2484    pub afterpay_clearpay: Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
2485    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
2486    #[serde(skip_serializing_if = "Option::is_none")]
2487    pub alipay: Option<CreatePaymentIntentPaymentMethodOptionsAlipay>,
2488    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
2489    #[serde(skip_serializing_if = "Option::is_none")]
2490    pub alma: Option<CreatePaymentIntentPaymentMethodOptionsAlma>,
2491    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
2492    #[serde(skip_serializing_if = "Option::is_none")]
2493    pub amazon_pay: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPay>,
2494    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
2495    #[serde(skip_serializing_if = "Option::is_none")]
2496    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
2497    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
2498    #[serde(skip_serializing_if = "Option::is_none")]
2499    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodOptionsBacsDebit>,
2500    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
2501    #[serde(skip_serializing_if = "Option::is_none")]
2502    pub bancontact: Option<CreatePaymentIntentPaymentMethodOptionsBancontact>,
2503    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
2504    #[serde(skip_serializing_if = "Option::is_none")]
2505    pub billie: Option<CreatePaymentIntentPaymentMethodOptionsBillie>,
2506    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
2507    #[serde(skip_serializing_if = "Option::is_none")]
2508    pub blik: Option<CreatePaymentIntentPaymentMethodOptionsBlik>,
2509    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
2510    #[serde(skip_serializing_if = "Option::is_none")]
2511    pub boleto: Option<CreatePaymentIntentPaymentMethodOptionsBoleto>,
2512    /// Configuration for any card payments attempted on this PaymentIntent.
2513    #[serde(skip_serializing_if = "Option::is_none")]
2514    pub card: Option<CreatePaymentIntentPaymentMethodOptionsCard>,
2515    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2516    #[serde(skip_serializing_if = "Option::is_none")]
2517    pub card_present: Option<CreatePaymentIntentPaymentMethodOptionsCardPresent>,
2518    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
2519    #[serde(skip_serializing_if = "Option::is_none")]
2520    pub cashapp: Option<CreatePaymentIntentPaymentMethodOptionsCashapp>,
2521    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
2522    #[serde(skip_serializing_if = "Option::is_none")]
2523    pub crypto: Option<CreatePaymentIntentPaymentMethodOptionsCrypto>,
2524    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
2525    #[serde(skip_serializing_if = "Option::is_none")]
2526    pub customer_balance: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalance>,
2527    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
2528    #[serde(skip_serializing_if = "Option::is_none")]
2529    pub eps: Option<CreatePaymentIntentPaymentMethodOptionsEps>,
2530    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
2531    #[serde(skip_serializing_if = "Option::is_none")]
2532    pub fpx: Option<CreatePaymentIntentPaymentMethodOptionsFpx>,
2533    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
2534    #[serde(skip_serializing_if = "Option::is_none")]
2535    pub giropay: Option<CreatePaymentIntentPaymentMethodOptionsGiropay>,
2536    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
2537    #[serde(skip_serializing_if = "Option::is_none")]
2538    pub grabpay: Option<CreatePaymentIntentPaymentMethodOptionsGrabpay>,
2539    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
2540    #[serde(skip_serializing_if = "Option::is_none")]
2541    pub ideal: Option<CreatePaymentIntentPaymentMethodOptionsIdeal>,
2542    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2543    #[serde(skip_serializing_if = "Option::is_none")]
2544    #[serde(with = "stripe_types::with_serde_json_opt")]
2545    pub interac_present: Option<miniserde::json::Value>,
2546    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
2547    #[serde(skip_serializing_if = "Option::is_none")]
2548    pub kakao_pay: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPay>,
2549    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
2550    #[serde(skip_serializing_if = "Option::is_none")]
2551    pub klarna: Option<CreatePaymentIntentPaymentMethodOptionsKlarna>,
2552    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
2553    #[serde(skip_serializing_if = "Option::is_none")]
2554    pub konbini: Option<CreatePaymentIntentPaymentMethodOptionsKonbini>,
2555    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
2556    #[serde(skip_serializing_if = "Option::is_none")]
2557    pub kr_card: Option<CreatePaymentIntentPaymentMethodOptionsKrCard>,
2558    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2559    #[serde(skip_serializing_if = "Option::is_none")]
2560    pub link: Option<CreatePaymentIntentPaymentMethodOptionsLink>,
2561    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
2562    #[serde(skip_serializing_if = "Option::is_none")]
2563    pub mb_way: Option<CreatePaymentIntentPaymentMethodOptionsMbWay>,
2564    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
2565    #[serde(skip_serializing_if = "Option::is_none")]
2566    pub mobilepay: Option<CreatePaymentIntentPaymentMethodOptionsMobilepay>,
2567    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
2568    #[serde(skip_serializing_if = "Option::is_none")]
2569    pub multibanco: Option<CreatePaymentIntentPaymentMethodOptionsMultibanco>,
2570    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
2571    #[serde(skip_serializing_if = "Option::is_none")]
2572    pub naver_pay: Option<CreatePaymentIntentPaymentMethodOptionsNaverPay>,
2573    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
2574    #[serde(skip_serializing_if = "Option::is_none")]
2575    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccount>,
2576    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
2577    #[serde(skip_serializing_if = "Option::is_none")]
2578    pub oxxo: Option<CreatePaymentIntentPaymentMethodOptionsOxxo>,
2579    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
2580    #[serde(skip_serializing_if = "Option::is_none")]
2581    pub p24: Option<CreatePaymentIntentPaymentMethodOptionsP24>,
2582    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
2583    #[serde(skip_serializing_if = "Option::is_none")]
2584    #[serde(with = "stripe_types::with_serde_json_opt")]
2585    pub pay_by_bank: Option<miniserde::json::Value>,
2586    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
2587    #[serde(skip_serializing_if = "Option::is_none")]
2588    pub payco: Option<CreatePaymentIntentPaymentMethodOptionsPayco>,
2589    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
2590    #[serde(skip_serializing_if = "Option::is_none")]
2591    pub paynow: Option<CreatePaymentIntentPaymentMethodOptionsPaynow>,
2592    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2593    #[serde(skip_serializing_if = "Option::is_none")]
2594    pub paypal: Option<CreatePaymentIntentPaymentMethodOptionsPaypal>,
2595    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
2596    #[serde(skip_serializing_if = "Option::is_none")]
2597    pub pix: Option<CreatePaymentIntentPaymentMethodOptionsPix>,
2598    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
2599    #[serde(skip_serializing_if = "Option::is_none")]
2600    pub promptpay: Option<CreatePaymentIntentPaymentMethodOptionsPromptpay>,
2601    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
2602    #[serde(skip_serializing_if = "Option::is_none")]
2603    pub revolut_pay: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPay>,
2604    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
2605    #[serde(skip_serializing_if = "Option::is_none")]
2606    pub samsung_pay: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPay>,
2607    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
2608    #[serde(skip_serializing_if = "Option::is_none")]
2609    pub satispay: Option<CreatePaymentIntentPaymentMethodOptionsSatispay>,
2610    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
2611    #[serde(skip_serializing_if = "Option::is_none")]
2612    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebit>,
2613    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
2614    #[serde(skip_serializing_if = "Option::is_none")]
2615    pub sofort: Option<CreatePaymentIntentPaymentMethodOptionsSofort>,
2616    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
2617    #[serde(skip_serializing_if = "Option::is_none")]
2618    pub swish: Option<CreatePaymentIntentPaymentMethodOptionsSwish>,
2619    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
2620    #[serde(skip_serializing_if = "Option::is_none")]
2621    pub twint: Option<CreatePaymentIntentPaymentMethodOptionsTwint>,
2622    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
2623    #[serde(skip_serializing_if = "Option::is_none")]
2624    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccount>,
2625    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
2626    #[serde(skip_serializing_if = "Option::is_none")]
2627    pub wechat_pay: Option<CreatePaymentIntentPaymentMethodOptionsWechatPay>,
2628    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
2629    #[serde(skip_serializing_if = "Option::is_none")]
2630    pub zip: Option<CreatePaymentIntentPaymentMethodOptionsZip>,
2631}
2632impl CreatePaymentIntentPaymentMethodOptions {
2633    pub fn new() -> Self {
2634        Self {
2635            acss_debit: None,
2636            affirm: None,
2637            afterpay_clearpay: None,
2638            alipay: None,
2639            alma: None,
2640            amazon_pay: None,
2641            au_becs_debit: None,
2642            bacs_debit: None,
2643            bancontact: None,
2644            billie: None,
2645            blik: None,
2646            boleto: None,
2647            card: None,
2648            card_present: None,
2649            cashapp: None,
2650            crypto: None,
2651            customer_balance: None,
2652            eps: None,
2653            fpx: None,
2654            giropay: None,
2655            grabpay: None,
2656            ideal: None,
2657            interac_present: None,
2658            kakao_pay: None,
2659            klarna: None,
2660            konbini: None,
2661            kr_card: None,
2662            link: None,
2663            mb_way: None,
2664            mobilepay: None,
2665            multibanco: None,
2666            naver_pay: None,
2667            nz_bank_account: None,
2668            oxxo: None,
2669            p24: None,
2670            pay_by_bank: None,
2671            payco: None,
2672            paynow: None,
2673            paypal: None,
2674            pix: None,
2675            promptpay: None,
2676            revolut_pay: None,
2677            samsung_pay: None,
2678            satispay: None,
2679            sepa_debit: None,
2680            sofort: None,
2681            swish: None,
2682            twint: None,
2683            us_bank_account: None,
2684            wechat_pay: None,
2685            zip: None,
2686        }
2687    }
2688}
2689impl Default for CreatePaymentIntentPaymentMethodOptions {
2690    fn default() -> Self {
2691        Self::new()
2692    }
2693}
2694/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2695#[derive(Clone, Debug, serde::Serialize)]
2696pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2697    /// Additional fields for Mandate creation
2698    #[serde(skip_serializing_if = "Option::is_none")]
2699    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2700    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2701    ///
2702    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
2703    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
2704    ///
2705    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
2706    ///
2707    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
2708    ///
2709    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2710    #[serde(skip_serializing_if = "Option::is_none")]
2711    pub setup_future_usage:
2712        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
2713    /// Controls when Stripe will attempt to debit the funds from the customer's account.
2714    /// The date must be a string in YYYY-MM-DD format.
2715    /// The date must be in the future and between 3 and 15 calendar days from now.
2716    #[serde(skip_serializing_if = "Option::is_none")]
2717    pub target_date: Option<String>,
2718    /// Bank account verification method.
2719    #[serde(skip_serializing_if = "Option::is_none")]
2720    pub verification_method:
2721        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2722}
2723impl CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2724    pub fn new() -> Self {
2725        Self {
2726            mandate_options: None,
2727            setup_future_usage: None,
2728            target_date: None,
2729            verification_method: None,
2730        }
2731    }
2732}
2733impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2734    fn default() -> Self {
2735        Self::new()
2736    }
2737}
2738/// Additional fields for Mandate creation
2739#[derive(Clone, Debug, serde::Serialize)]
2740pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2741    /// A URL for custom mandate text to render during confirmation step.
2742    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2743    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2744    #[serde(skip_serializing_if = "Option::is_none")]
2745    pub custom_mandate_url: Option<String>,
2746    /// Description of the mandate interval.
2747    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2748    #[serde(skip_serializing_if = "Option::is_none")]
2749    pub interval_description: Option<String>,
2750    /// Payment schedule for the mandate.
2751    #[serde(skip_serializing_if = "Option::is_none")]
2752    pub payment_schedule:
2753        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2754    /// Transaction type of the mandate.
2755    #[serde(skip_serializing_if = "Option::is_none")]
2756    pub transaction_type:
2757        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2758}
2759impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2760    pub fn new() -> Self {
2761        Self {
2762            custom_mandate_url: None,
2763            interval_description: None,
2764            payment_schedule: None,
2765            transaction_type: None,
2766        }
2767    }
2768}
2769impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2770    fn default() -> Self {
2771        Self::new()
2772    }
2773}
2774/// Payment schedule for the mandate.
2775#[derive(Copy, Clone, Eq, PartialEq)]
2776pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2777    Combined,
2778    Interval,
2779    Sporadic,
2780}
2781impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2782    pub fn as_str(self) -> &'static str {
2783        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2784        match self {
2785            Combined => "combined",
2786            Interval => "interval",
2787            Sporadic => "sporadic",
2788        }
2789    }
2790}
2791
2792impl std::str::FromStr
2793    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2794{
2795    type Err = stripe_types::StripeParseError;
2796    fn from_str(s: &str) -> Result<Self, Self::Err> {
2797        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2798        match s {
2799            "combined" => Ok(Combined),
2800            "interval" => Ok(Interval),
2801            "sporadic" => Ok(Sporadic),
2802            _ => Err(stripe_types::StripeParseError),
2803        }
2804    }
2805}
2806impl std::fmt::Display
2807    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2808{
2809    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2810        f.write_str(self.as_str())
2811    }
2812}
2813
2814impl std::fmt::Debug
2815    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2816{
2817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2818        f.write_str(self.as_str())
2819    }
2820}
2821impl serde::Serialize
2822    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2823{
2824    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2825    where
2826        S: serde::Serializer,
2827    {
2828        serializer.serialize_str(self.as_str())
2829    }
2830}
2831#[cfg(feature = "deserialize")]
2832impl<'de> serde::Deserialize<'de>
2833    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2834{
2835    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2836        use std::str::FromStr;
2837        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2838        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
2839    }
2840}
2841/// Transaction type of the mandate.
2842#[derive(Copy, Clone, Eq, PartialEq)]
2843pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2844    Business,
2845    Personal,
2846}
2847impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2848    pub fn as_str(self) -> &'static str {
2849        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2850        match self {
2851            Business => "business",
2852            Personal => "personal",
2853        }
2854    }
2855}
2856
2857impl std::str::FromStr
2858    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2859{
2860    type Err = stripe_types::StripeParseError;
2861    fn from_str(s: &str) -> Result<Self, Self::Err> {
2862        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2863        match s {
2864            "business" => Ok(Business),
2865            "personal" => Ok(Personal),
2866            _ => Err(stripe_types::StripeParseError),
2867        }
2868    }
2869}
2870impl std::fmt::Display
2871    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2872{
2873    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2874        f.write_str(self.as_str())
2875    }
2876}
2877
2878impl std::fmt::Debug
2879    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2880{
2881    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2882        f.write_str(self.as_str())
2883    }
2884}
2885impl serde::Serialize
2886    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2887{
2888    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2889    where
2890        S: serde::Serializer,
2891    {
2892        serializer.serialize_str(self.as_str())
2893    }
2894}
2895#[cfg(feature = "deserialize")]
2896impl<'de> serde::Deserialize<'de>
2897    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2898{
2899    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2900        use std::str::FromStr;
2901        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2902        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
2903    }
2904}
2905/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2906///
2907/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
2908/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
2909///
2910/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
2911///
2912/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
2913///
2914/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2915#[derive(Copy, Clone, Eq, PartialEq)]
2916pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2917    None,
2918    OffSession,
2919    OnSession,
2920}
2921impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2922    pub fn as_str(self) -> &'static str {
2923        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
2924        match self {
2925            None => "none",
2926            OffSession => "off_session",
2927            OnSession => "on_session",
2928        }
2929    }
2930}
2931
2932impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2933    type Err = stripe_types::StripeParseError;
2934    fn from_str(s: &str) -> Result<Self, Self::Err> {
2935        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
2936        match s {
2937            "none" => Ok(None),
2938            "off_session" => Ok(OffSession),
2939            "on_session" => Ok(OnSession),
2940            _ => Err(stripe_types::StripeParseError),
2941        }
2942    }
2943}
2944impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2945    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2946        f.write_str(self.as_str())
2947    }
2948}
2949
2950impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2952        f.write_str(self.as_str())
2953    }
2954}
2955impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2956    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2957    where
2958        S: serde::Serializer,
2959    {
2960        serializer.serialize_str(self.as_str())
2961    }
2962}
2963#[cfg(feature = "deserialize")]
2964impl<'de> serde::Deserialize<'de>
2965    for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
2966{
2967    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2968        use std::str::FromStr;
2969        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2970        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
2971    }
2972}
2973/// Bank account verification method.
2974#[derive(Copy, Clone, Eq, PartialEq)]
2975pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2976    Automatic,
2977    Instant,
2978    Microdeposits,
2979}
2980impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2981    pub fn as_str(self) -> &'static str {
2982        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2983        match self {
2984            Automatic => "automatic",
2985            Instant => "instant",
2986            Microdeposits => "microdeposits",
2987        }
2988    }
2989}
2990
2991impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2992    type Err = stripe_types::StripeParseError;
2993    fn from_str(s: &str) -> Result<Self, Self::Err> {
2994        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2995        match s {
2996            "automatic" => Ok(Automatic),
2997            "instant" => Ok(Instant),
2998            "microdeposits" => Ok(Microdeposits),
2999            _ => Err(stripe_types::StripeParseError),
3000        }
3001    }
3002}
3003impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3005        f.write_str(self.as_str())
3006    }
3007}
3008
3009impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3010    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3011        f.write_str(self.as_str())
3012    }
3013}
3014impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3015    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3016    where
3017        S: serde::Serializer,
3018    {
3019        serializer.serialize_str(self.as_str())
3020    }
3021}
3022#[cfg(feature = "deserialize")]
3023impl<'de> serde::Deserialize<'de>
3024    for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
3025{
3026    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3027        use std::str::FromStr;
3028        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3029        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
3030    }
3031}
3032/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
3033#[derive(Clone, Debug, serde::Serialize)]
3034pub struct CreatePaymentIntentPaymentMethodOptionsAffirm {
3035    /// Controls when the funds are captured from the customer's account.
3036    ///
3037    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3038    ///
3039    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3040    #[serde(skip_serializing_if = "Option::is_none")]
3041    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
3042    /// Preferred language of the Affirm authorization page that the customer is redirected to.
3043    #[serde(skip_serializing_if = "Option::is_none")]
3044    pub preferred_locale: Option<String>,
3045    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3046    ///
3047    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3048    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3049    ///
3050    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3051    ///
3052    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3053    ///
3054    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3055    #[serde(skip_serializing_if = "Option::is_none")]
3056    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
3057}
3058impl CreatePaymentIntentPaymentMethodOptionsAffirm {
3059    pub fn new() -> Self {
3060        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
3061    }
3062}
3063impl Default for CreatePaymentIntentPaymentMethodOptionsAffirm {
3064    fn default() -> Self {
3065        Self::new()
3066    }
3067}
3068/// Controls when the funds are captured from the customer's account.
3069///
3070/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3071///
3072/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3073#[derive(Copy, Clone, Eq, PartialEq)]
3074pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3075    Manual,
3076}
3077impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3078    pub fn as_str(self) -> &'static str {
3079        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
3080        match self {
3081            Manual => "manual",
3082        }
3083    }
3084}
3085
3086impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3087    type Err = stripe_types::StripeParseError;
3088    fn from_str(s: &str) -> Result<Self, Self::Err> {
3089        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
3090        match s {
3091            "manual" => Ok(Manual),
3092            _ => Err(stripe_types::StripeParseError),
3093        }
3094    }
3095}
3096impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3097    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3098        f.write_str(self.as_str())
3099    }
3100}
3101
3102impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3104        f.write_str(self.as_str())
3105    }
3106}
3107impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3108    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3109    where
3110        S: serde::Serializer,
3111    {
3112        serializer.serialize_str(self.as_str())
3113    }
3114}
3115#[cfg(feature = "deserialize")]
3116impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3117    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3118        use std::str::FromStr;
3119        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3120        Self::from_str(&s).map_err(|_| {
3121            serde::de::Error::custom(
3122                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
3123            )
3124        })
3125    }
3126}
3127/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3128///
3129/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3130/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3131///
3132/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3133///
3134/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3135///
3136/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3137#[derive(Copy, Clone, Eq, PartialEq)]
3138pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3139    None,
3140}
3141impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3142    pub fn as_str(self) -> &'static str {
3143        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
3144        match self {
3145            None => "none",
3146        }
3147    }
3148}
3149
3150impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3151    type Err = stripe_types::StripeParseError;
3152    fn from_str(s: &str) -> Result<Self, Self::Err> {
3153        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
3154        match s {
3155            "none" => Ok(None),
3156            _ => Err(stripe_types::StripeParseError),
3157        }
3158    }
3159}
3160impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3162        f.write_str(self.as_str())
3163    }
3164}
3165
3166impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3167    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3168        f.write_str(self.as_str())
3169    }
3170}
3171impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3172    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3173    where
3174        S: serde::Serializer,
3175    {
3176        serializer.serialize_str(self.as_str())
3177    }
3178}
3179#[cfg(feature = "deserialize")]
3180impl<'de> serde::Deserialize<'de>
3181    for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
3182{
3183    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3184        use std::str::FromStr;
3185        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3186        Self::from_str(&s).map_err(|_| {
3187            serde::de::Error::custom(
3188                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
3189            )
3190        })
3191    }
3192}
3193/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
3194#[derive(Clone, Debug, serde::Serialize)]
3195pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3196    /// Controls when the funds are captured from the customer's account.
3197    ///
3198    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3199    ///
3200    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3201    #[serde(skip_serializing_if = "Option::is_none")]
3202    pub capture_method:
3203        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
3204    /// An internal identifier or reference that this payment corresponds to.
3205    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
3206    /// This field differs from the statement descriptor and item name.
3207    #[serde(skip_serializing_if = "Option::is_none")]
3208    pub reference: Option<String>,
3209    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3210    ///
3211    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3212    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3213    ///
3214    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3215    ///
3216    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3217    ///
3218    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3219    #[serde(skip_serializing_if = "Option::is_none")]
3220    pub setup_future_usage:
3221        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
3222}
3223impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3224    pub fn new() -> Self {
3225        Self { capture_method: None, reference: None, setup_future_usage: None }
3226    }
3227}
3228impl Default for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3229    fn default() -> Self {
3230        Self::new()
3231    }
3232}
3233/// Controls when the funds are captured from the customer's account.
3234///
3235/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3236///
3237/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3238#[derive(Copy, Clone, Eq, PartialEq)]
3239pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3240    Manual,
3241}
3242impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3243    pub fn as_str(self) -> &'static str {
3244        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
3245        match self {
3246            Manual => "manual",
3247        }
3248    }
3249}
3250
3251impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3252    type Err = stripe_types::StripeParseError;
3253    fn from_str(s: &str) -> Result<Self, Self::Err> {
3254        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
3255        match s {
3256            "manual" => Ok(Manual),
3257            _ => Err(stripe_types::StripeParseError),
3258        }
3259    }
3260}
3261impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3262    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3263        f.write_str(self.as_str())
3264    }
3265}
3266
3267impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3268    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3269        f.write_str(self.as_str())
3270    }
3271}
3272impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3273    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3274    where
3275        S: serde::Serializer,
3276    {
3277        serializer.serialize_str(self.as_str())
3278    }
3279}
3280#[cfg(feature = "deserialize")]
3281impl<'de> serde::Deserialize<'de>
3282    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
3283{
3284    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3285        use std::str::FromStr;
3286        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3287        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
3288    }
3289}
3290/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3291///
3292/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3293/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3294///
3295/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3296///
3297/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3298///
3299/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3300#[derive(Copy, Clone, Eq, PartialEq)]
3301pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3302    None,
3303}
3304impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3305    pub fn as_str(self) -> &'static str {
3306        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3307        match self {
3308            None => "none",
3309        }
3310    }
3311}
3312
3313impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3314    type Err = stripe_types::StripeParseError;
3315    fn from_str(s: &str) -> Result<Self, Self::Err> {
3316        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3317        match s {
3318            "none" => Ok(None),
3319            _ => Err(stripe_types::StripeParseError),
3320        }
3321    }
3322}
3323impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3324    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3325        f.write_str(self.as_str())
3326    }
3327}
3328
3329impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3330    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3331        f.write_str(self.as_str())
3332    }
3333}
3334impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3335    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3336    where
3337        S: serde::Serializer,
3338    {
3339        serializer.serialize_str(self.as_str())
3340    }
3341}
3342#[cfg(feature = "deserialize")]
3343impl<'de> serde::Deserialize<'de>
3344    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
3345{
3346    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3347        use std::str::FromStr;
3348        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3349        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
3350    }
3351}
3352/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
3353#[derive(Copy, Clone, Debug, serde::Serialize)]
3354pub struct CreatePaymentIntentPaymentMethodOptionsAlipay {
3355    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3356    ///
3357    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3358    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3359    ///
3360    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3361    ///
3362    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3363    ///
3364    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3365    #[serde(skip_serializing_if = "Option::is_none")]
3366    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
3367}
3368impl CreatePaymentIntentPaymentMethodOptionsAlipay {
3369    pub fn new() -> Self {
3370        Self { setup_future_usage: None }
3371    }
3372}
3373impl Default for CreatePaymentIntentPaymentMethodOptionsAlipay {
3374    fn default() -> Self {
3375        Self::new()
3376    }
3377}
3378/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3379///
3380/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3381/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3382///
3383/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3384///
3385/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3386///
3387/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3388#[derive(Copy, Clone, Eq, PartialEq)]
3389pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3390    None,
3391    OffSession,
3392}
3393impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3394    pub fn as_str(self) -> &'static str {
3395        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3396        match self {
3397            None => "none",
3398            OffSession => "off_session",
3399        }
3400    }
3401}
3402
3403impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3404    type Err = stripe_types::StripeParseError;
3405    fn from_str(s: &str) -> Result<Self, Self::Err> {
3406        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3407        match s {
3408            "none" => Ok(None),
3409            "off_session" => Ok(OffSession),
3410            _ => Err(stripe_types::StripeParseError),
3411        }
3412    }
3413}
3414impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3415    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3416        f.write_str(self.as_str())
3417    }
3418}
3419
3420impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3421    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3422        f.write_str(self.as_str())
3423    }
3424}
3425impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3426    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3427    where
3428        S: serde::Serializer,
3429    {
3430        serializer.serialize_str(self.as_str())
3431    }
3432}
3433#[cfg(feature = "deserialize")]
3434impl<'de> serde::Deserialize<'de>
3435    for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
3436{
3437    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3438        use std::str::FromStr;
3439        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3440        Self::from_str(&s).map_err(|_| {
3441            serde::de::Error::custom(
3442                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
3443            )
3444        })
3445    }
3446}
3447/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
3448#[derive(Copy, Clone, Debug, serde::Serialize)]
3449pub struct CreatePaymentIntentPaymentMethodOptionsAlma {
3450    /// Controls when the funds are captured from the customer's account.
3451    ///
3452    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3453    ///
3454    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3455    #[serde(skip_serializing_if = "Option::is_none")]
3456    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
3457}
3458impl CreatePaymentIntentPaymentMethodOptionsAlma {
3459    pub fn new() -> Self {
3460        Self { capture_method: None }
3461    }
3462}
3463impl Default for CreatePaymentIntentPaymentMethodOptionsAlma {
3464    fn default() -> Self {
3465        Self::new()
3466    }
3467}
3468/// Controls when the funds are captured from the customer's account.
3469///
3470/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3471///
3472/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3473#[derive(Copy, Clone, Eq, PartialEq)]
3474pub enum CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3475    Manual,
3476}
3477impl CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3478    pub fn as_str(self) -> &'static str {
3479        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3480        match self {
3481            Manual => "manual",
3482        }
3483    }
3484}
3485
3486impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3487    type Err = stripe_types::StripeParseError;
3488    fn from_str(s: &str) -> Result<Self, Self::Err> {
3489        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3490        match s {
3491            "manual" => Ok(Manual),
3492            _ => Err(stripe_types::StripeParseError),
3493        }
3494    }
3495}
3496impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3497    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3498        f.write_str(self.as_str())
3499    }
3500}
3501
3502impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3503    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3504        f.write_str(self.as_str())
3505    }
3506}
3507impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3508    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3509    where
3510        S: serde::Serializer,
3511    {
3512        serializer.serialize_str(self.as_str())
3513    }
3514}
3515#[cfg(feature = "deserialize")]
3516impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3517    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3518        use std::str::FromStr;
3519        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3520        Self::from_str(&s).map_err(|_| {
3521            serde::de::Error::custom(
3522                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
3523            )
3524        })
3525    }
3526}
3527/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
3528#[derive(Copy, Clone, Debug, serde::Serialize)]
3529pub struct CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3530    /// Controls when the funds are captured from the customer's account.
3531    ///
3532    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3533    ///
3534    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3535    #[serde(skip_serializing_if = "Option::is_none")]
3536    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
3537    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3538    ///
3539    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3540    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3541    ///
3542    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3543    ///
3544    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3545    #[serde(skip_serializing_if = "Option::is_none")]
3546    pub setup_future_usage:
3547        Option<CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
3548}
3549impl CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3550    pub fn new() -> Self {
3551        Self { capture_method: None, setup_future_usage: None }
3552    }
3553}
3554impl Default for CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3555    fn default() -> Self {
3556        Self::new()
3557    }
3558}
3559/// Controls when the funds are captured from the customer's account.
3560///
3561/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3562///
3563/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3564#[derive(Copy, Clone, Eq, PartialEq)]
3565pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3566    Manual,
3567}
3568impl CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3569    pub fn as_str(self) -> &'static str {
3570        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3571        match self {
3572            Manual => "manual",
3573        }
3574    }
3575}
3576
3577impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3578    type Err = stripe_types::StripeParseError;
3579    fn from_str(s: &str) -> Result<Self, Self::Err> {
3580        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3581        match s {
3582            "manual" => Ok(Manual),
3583            _ => Err(stripe_types::StripeParseError),
3584        }
3585    }
3586}
3587impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3589        f.write_str(self.as_str())
3590    }
3591}
3592
3593impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3595        f.write_str(self.as_str())
3596    }
3597}
3598impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3599    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3600    where
3601        S: serde::Serializer,
3602    {
3603        serializer.serialize_str(self.as_str())
3604    }
3605}
3606#[cfg(feature = "deserialize")]
3607impl<'de> serde::Deserialize<'de>
3608    for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
3609{
3610    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3611        use std::str::FromStr;
3612        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3613        Self::from_str(&s).map_err(|_| {
3614            serde::de::Error::custom(
3615                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
3616            )
3617        })
3618    }
3619}
3620/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3621///
3622/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3623/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3624///
3625/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3626///
3627/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3628#[derive(Copy, Clone, Eq, PartialEq)]
3629pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3630    None,
3631    OffSession,
3632}
3633impl CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3634    pub fn as_str(self) -> &'static str {
3635        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3636        match self {
3637            None => "none",
3638            OffSession => "off_session",
3639        }
3640    }
3641}
3642
3643impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3644    type Err = stripe_types::StripeParseError;
3645    fn from_str(s: &str) -> Result<Self, Self::Err> {
3646        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3647        match s {
3648            "none" => Ok(None),
3649            "off_session" => Ok(OffSession),
3650            _ => Err(stripe_types::StripeParseError),
3651        }
3652    }
3653}
3654impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3656        f.write_str(self.as_str())
3657    }
3658}
3659
3660impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3662        f.write_str(self.as_str())
3663    }
3664}
3665impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3666    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3667    where
3668        S: serde::Serializer,
3669    {
3670        serializer.serialize_str(self.as_str())
3671    }
3672}
3673#[cfg(feature = "deserialize")]
3674impl<'de> serde::Deserialize<'de>
3675    for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
3676{
3677    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3678        use std::str::FromStr;
3679        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3680        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
3681    }
3682}
3683/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
3684#[derive(Clone, Debug, serde::Serialize)]
3685pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3686    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3687    ///
3688    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3689    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3690    ///
3691    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3692    ///
3693    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3694    ///
3695    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3696    #[serde(skip_serializing_if = "Option::is_none")]
3697    pub setup_future_usage:
3698        Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
3699    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3700    /// The date must be a string in YYYY-MM-DD format.
3701    /// The date must be in the future and between 3 and 15 calendar days from now.
3702    #[serde(skip_serializing_if = "Option::is_none")]
3703    pub target_date: Option<String>,
3704}
3705impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3706    pub fn new() -> Self {
3707        Self { setup_future_usage: None, target_date: None }
3708    }
3709}
3710impl Default for CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3711    fn default() -> Self {
3712        Self::new()
3713    }
3714}
3715/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3716///
3717/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3718/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3719///
3720/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3721///
3722/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3723///
3724/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3725#[derive(Copy, Clone, Eq, PartialEq)]
3726pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3727    None,
3728    OffSession,
3729    OnSession,
3730}
3731impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3732    pub fn as_str(self) -> &'static str {
3733        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3734        match self {
3735            None => "none",
3736            OffSession => "off_session",
3737            OnSession => "on_session",
3738        }
3739    }
3740}
3741
3742impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3743    type Err = stripe_types::StripeParseError;
3744    fn from_str(s: &str) -> Result<Self, Self::Err> {
3745        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3746        match s {
3747            "none" => Ok(None),
3748            "off_session" => Ok(OffSession),
3749            "on_session" => Ok(OnSession),
3750            _ => Err(stripe_types::StripeParseError),
3751        }
3752    }
3753}
3754impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3755    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3756        f.write_str(self.as_str())
3757    }
3758}
3759
3760impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3761    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3762        f.write_str(self.as_str())
3763    }
3764}
3765impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3766    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3767    where
3768        S: serde::Serializer,
3769    {
3770        serializer.serialize_str(self.as_str())
3771    }
3772}
3773#[cfg(feature = "deserialize")]
3774impl<'de> serde::Deserialize<'de>
3775    for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
3776{
3777    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3778        use std::str::FromStr;
3779        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3780        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
3781    }
3782}
3783/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
3784#[derive(Clone, Debug, serde::Serialize)]
3785pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3786    /// Additional fields for Mandate creation
3787    #[serde(skip_serializing_if = "Option::is_none")]
3788    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
3789    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3790    ///
3791    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3792    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3793    ///
3794    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3795    ///
3796    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3797    ///
3798    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3799    #[serde(skip_serializing_if = "Option::is_none")]
3800    pub setup_future_usage:
3801        Option<CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
3802    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3803    /// The date must be a string in YYYY-MM-DD format.
3804    /// The date must be in the future and between 3 and 15 calendar days from now.
3805    #[serde(skip_serializing_if = "Option::is_none")]
3806    pub target_date: Option<String>,
3807}
3808impl CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3809    pub fn new() -> Self {
3810        Self { mandate_options: None, setup_future_usage: None, target_date: None }
3811    }
3812}
3813impl Default for CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3814    fn default() -> Self {
3815        Self::new()
3816    }
3817}
3818/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3819///
3820/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3821/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3822///
3823/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3824///
3825/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3826///
3827/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3828#[derive(Copy, Clone, Eq, PartialEq)]
3829pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3830    None,
3831    OffSession,
3832    OnSession,
3833}
3834impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3835    pub fn as_str(self) -> &'static str {
3836        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
3837        match self {
3838            None => "none",
3839            OffSession => "off_session",
3840            OnSession => "on_session",
3841        }
3842    }
3843}
3844
3845impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3846    type Err = stripe_types::StripeParseError;
3847    fn from_str(s: &str) -> Result<Self, Self::Err> {
3848        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
3849        match s {
3850            "none" => Ok(None),
3851            "off_session" => Ok(OffSession),
3852            "on_session" => Ok(OnSession),
3853            _ => Err(stripe_types::StripeParseError),
3854        }
3855    }
3856}
3857impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3858    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3859        f.write_str(self.as_str())
3860    }
3861}
3862
3863impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3865        f.write_str(self.as_str())
3866    }
3867}
3868impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3869    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3870    where
3871        S: serde::Serializer,
3872    {
3873        serializer.serialize_str(self.as_str())
3874    }
3875}
3876#[cfg(feature = "deserialize")]
3877impl<'de> serde::Deserialize<'de>
3878    for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
3879{
3880    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3881        use std::str::FromStr;
3882        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3883        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
3884    }
3885}
3886/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
3887#[derive(Copy, Clone, Debug, serde::Serialize)]
3888pub struct CreatePaymentIntentPaymentMethodOptionsBancontact {
3889    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
3890    #[serde(skip_serializing_if = "Option::is_none")]
3891    pub preferred_language:
3892        Option<CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
3893    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3894    ///
3895    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3896    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3897    ///
3898    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3899    ///
3900    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3901    ///
3902    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3903    #[serde(skip_serializing_if = "Option::is_none")]
3904    pub setup_future_usage:
3905        Option<CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
3906}
3907impl CreatePaymentIntentPaymentMethodOptionsBancontact {
3908    pub fn new() -> Self {
3909        Self { preferred_language: None, setup_future_usage: None }
3910    }
3911}
3912impl Default for CreatePaymentIntentPaymentMethodOptionsBancontact {
3913    fn default() -> Self {
3914        Self::new()
3915    }
3916}
3917/// Preferred language of the Bancontact authorization page that the customer is redirected to.
3918#[derive(Copy, Clone, Eq, PartialEq)]
3919pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3920    De,
3921    En,
3922    Fr,
3923    Nl,
3924}
3925impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3926    pub fn as_str(self) -> &'static str {
3927        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
3928        match self {
3929            De => "de",
3930            En => "en",
3931            Fr => "fr",
3932            Nl => "nl",
3933        }
3934    }
3935}
3936
3937impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3938    type Err = stripe_types::StripeParseError;
3939    fn from_str(s: &str) -> Result<Self, Self::Err> {
3940        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
3941        match s {
3942            "de" => Ok(De),
3943            "en" => Ok(En),
3944            "fr" => Ok(Fr),
3945            "nl" => Ok(Nl),
3946            _ => Err(stripe_types::StripeParseError),
3947        }
3948    }
3949}
3950impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3952        f.write_str(self.as_str())
3953    }
3954}
3955
3956impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3958        f.write_str(self.as_str())
3959    }
3960}
3961impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3962    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3963    where
3964        S: serde::Serializer,
3965    {
3966        serializer.serialize_str(self.as_str())
3967    }
3968}
3969#[cfg(feature = "deserialize")]
3970impl<'de> serde::Deserialize<'de>
3971    for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
3972{
3973    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3974        use std::str::FromStr;
3975        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3976        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
3977    }
3978}
3979/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3980///
3981/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3982/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3983///
3984/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3985///
3986/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3987///
3988/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3989#[derive(Copy, Clone, Eq, PartialEq)]
3990pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3991    None,
3992    OffSession,
3993}
3994impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3995    pub fn as_str(self) -> &'static str {
3996        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
3997        match self {
3998            None => "none",
3999            OffSession => "off_session",
4000        }
4001    }
4002}
4003
4004impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4005    type Err = stripe_types::StripeParseError;
4006    fn from_str(s: &str) -> Result<Self, Self::Err> {
4007        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
4008        match s {
4009            "none" => Ok(None),
4010            "off_session" => Ok(OffSession),
4011            _ => Err(stripe_types::StripeParseError),
4012        }
4013    }
4014}
4015impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4017        f.write_str(self.as_str())
4018    }
4019}
4020
4021impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4023        f.write_str(self.as_str())
4024    }
4025}
4026impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4027    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4028    where
4029        S: serde::Serializer,
4030    {
4031        serializer.serialize_str(self.as_str())
4032    }
4033}
4034#[cfg(feature = "deserialize")]
4035impl<'de> serde::Deserialize<'de>
4036    for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
4037{
4038    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4039        use std::str::FromStr;
4040        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4041        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
4042    }
4043}
4044/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
4045#[derive(Copy, Clone, Debug, serde::Serialize)]
4046pub struct CreatePaymentIntentPaymentMethodOptionsBillie {
4047    /// Controls when the funds are captured from the customer's account.
4048    ///
4049    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
4050    ///
4051    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
4052    #[serde(skip_serializing_if = "Option::is_none")]
4053    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
4054}
4055impl CreatePaymentIntentPaymentMethodOptionsBillie {
4056    pub fn new() -> Self {
4057        Self { capture_method: None }
4058    }
4059}
4060impl Default for CreatePaymentIntentPaymentMethodOptionsBillie {
4061    fn default() -> Self {
4062        Self::new()
4063    }
4064}
4065/// Controls when the funds are captured from the customer's account.
4066///
4067/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
4068///
4069/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
4070#[derive(Copy, Clone, Eq, PartialEq)]
4071pub enum CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4072    Manual,
4073}
4074impl CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4075    pub fn as_str(self) -> &'static str {
4076        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
4077        match self {
4078            Manual => "manual",
4079        }
4080    }
4081}
4082
4083impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4084    type Err = stripe_types::StripeParseError;
4085    fn from_str(s: &str) -> Result<Self, Self::Err> {
4086        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
4087        match s {
4088            "manual" => Ok(Manual),
4089            _ => Err(stripe_types::StripeParseError),
4090        }
4091    }
4092}
4093impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4094    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4095        f.write_str(self.as_str())
4096    }
4097}
4098
4099impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4100    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4101        f.write_str(self.as_str())
4102    }
4103}
4104impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4105    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4106    where
4107        S: serde::Serializer,
4108    {
4109        serializer.serialize_str(self.as_str())
4110    }
4111}
4112#[cfg(feature = "deserialize")]
4113impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4114    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4115        use std::str::FromStr;
4116        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4117        Self::from_str(&s).map_err(|_| {
4118            serde::de::Error::custom(
4119                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod",
4120            )
4121        })
4122    }
4123}
4124/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
4125#[derive(Clone, Debug, serde::Serialize)]
4126pub struct CreatePaymentIntentPaymentMethodOptionsBlik {
4127    /// The 6-digit BLIK code that a customer has generated using their banking application.
4128    /// Can only be set on confirmation.
4129    #[serde(skip_serializing_if = "Option::is_none")]
4130    pub code: Option<String>,
4131    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4132    ///
4133    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4134    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4135    ///
4136    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4137    ///
4138    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4139    ///
4140    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4141    #[serde(skip_serializing_if = "Option::is_none")]
4142    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
4143}
4144impl CreatePaymentIntentPaymentMethodOptionsBlik {
4145    pub fn new() -> Self {
4146        Self { code: None, setup_future_usage: None }
4147    }
4148}
4149impl Default for CreatePaymentIntentPaymentMethodOptionsBlik {
4150    fn default() -> Self {
4151        Self::new()
4152    }
4153}
4154/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4155///
4156/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4157/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4158///
4159/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4160///
4161/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4162///
4163/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4164#[derive(Copy, Clone, Eq, PartialEq)]
4165pub enum CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4166    None,
4167}
4168impl CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4169    pub fn as_str(self) -> &'static str {
4170        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
4171        match self {
4172            None => "none",
4173        }
4174    }
4175}
4176
4177impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4178    type Err = stripe_types::StripeParseError;
4179    fn from_str(s: &str) -> Result<Self, Self::Err> {
4180        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
4181        match s {
4182            "none" => Ok(None),
4183            _ => Err(stripe_types::StripeParseError),
4184        }
4185    }
4186}
4187impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4188    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4189        f.write_str(self.as_str())
4190    }
4191}
4192
4193impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4194    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4195        f.write_str(self.as_str())
4196    }
4197}
4198impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4199    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4200    where
4201        S: serde::Serializer,
4202    {
4203        serializer.serialize_str(self.as_str())
4204    }
4205}
4206#[cfg(feature = "deserialize")]
4207impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4208    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4209        use std::str::FromStr;
4210        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4211        Self::from_str(&s).map_err(|_| {
4212            serde::de::Error::custom(
4213                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
4214            )
4215        })
4216    }
4217}
4218/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
4219#[derive(Copy, Clone, Debug, serde::Serialize)]
4220pub struct CreatePaymentIntentPaymentMethodOptionsBoleto {
4221    /// The number of calendar days before a Boleto voucher expires.
4222    /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
4223    #[serde(skip_serializing_if = "Option::is_none")]
4224    pub expires_after_days: Option<u32>,
4225    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4226    ///
4227    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4228    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4229    ///
4230    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4231    ///
4232    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4233    ///
4234    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4235    #[serde(skip_serializing_if = "Option::is_none")]
4236    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
4237}
4238impl CreatePaymentIntentPaymentMethodOptionsBoleto {
4239    pub fn new() -> Self {
4240        Self { expires_after_days: None, setup_future_usage: None }
4241    }
4242}
4243impl Default for CreatePaymentIntentPaymentMethodOptionsBoleto {
4244    fn default() -> Self {
4245        Self::new()
4246    }
4247}
4248/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4249///
4250/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4251/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4252///
4253/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4254///
4255/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4256///
4257/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4258#[derive(Copy, Clone, Eq, PartialEq)]
4259pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4260    None,
4261    OffSession,
4262    OnSession,
4263}
4264impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4265    pub fn as_str(self) -> &'static str {
4266        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
4267        match self {
4268            None => "none",
4269            OffSession => "off_session",
4270            OnSession => "on_session",
4271        }
4272    }
4273}
4274
4275impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4276    type Err = stripe_types::StripeParseError;
4277    fn from_str(s: &str) -> Result<Self, Self::Err> {
4278        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
4279        match s {
4280            "none" => Ok(None),
4281            "off_session" => Ok(OffSession),
4282            "on_session" => Ok(OnSession),
4283            _ => Err(stripe_types::StripeParseError),
4284        }
4285    }
4286}
4287impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4289        f.write_str(self.as_str())
4290    }
4291}
4292
4293impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4295        f.write_str(self.as_str())
4296    }
4297}
4298impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4300    where
4301        S: serde::Serializer,
4302    {
4303        serializer.serialize_str(self.as_str())
4304    }
4305}
4306#[cfg(feature = "deserialize")]
4307impl<'de> serde::Deserialize<'de>
4308    for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
4309{
4310    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4311        use std::str::FromStr;
4312        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4313        Self::from_str(&s).map_err(|_| {
4314            serde::de::Error::custom(
4315                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
4316            )
4317        })
4318    }
4319}
4320/// Configuration for any card payments attempted on this PaymentIntent.
4321#[derive(Clone, Debug, serde::Serialize)]
4322pub struct CreatePaymentIntentPaymentMethodOptionsCard {
4323    /// Controls when the funds are captured from the customer's account.
4324    ///
4325    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
4326    ///
4327    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
4328    #[serde(skip_serializing_if = "Option::is_none")]
4329    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
4330    /// A single-use `cvc_update` Token that represents a card CVC value.
4331    /// When provided, the CVC value will be verified during the card payment attempt.
4332    /// This parameter can only be provided during confirmation.
4333    #[serde(skip_serializing_if = "Option::is_none")]
4334    pub cvc_token: Option<String>,
4335    /// Installment configuration for payments attempted on this PaymentIntent.
4336    ///
4337    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4338    #[serde(skip_serializing_if = "Option::is_none")]
4339    pub installments: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallments>,
4340    /// Configuration options for setting up an eMandate for cards issued in India.
4341    #[serde(skip_serializing_if = "Option::is_none")]
4342    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
4343    /// When specified, this parameter indicates that a transaction will be marked
4344    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
4345    /// parameter can only be provided during confirmation.
4346    #[serde(skip_serializing_if = "Option::is_none")]
4347    pub moto: Option<bool>,
4348    /// Selected network to process this PaymentIntent on.
4349    /// Depends on the available networks of the card attached to the PaymentIntent.
4350    /// Can be only set confirm-time.
4351    #[serde(skip_serializing_if = "Option::is_none")]
4352    pub network: Option<CreatePaymentIntentPaymentMethodOptionsCardNetwork>,
4353    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4354    #[serde(skip_serializing_if = "Option::is_none")]
4355    pub request_extended_authorization:
4356        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
4357    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
4358    #[serde(skip_serializing_if = "Option::is_none")]
4359    pub request_incremental_authorization:
4360        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
4361    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
4362    #[serde(skip_serializing_if = "Option::is_none")]
4363    pub request_multicapture:
4364        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
4365    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
4366    #[serde(skip_serializing_if = "Option::is_none")]
4367    pub request_overcapture: Option<CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
4368    /// 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).
4369    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
4370    /// If not provided, this value defaults to `automatic`.
4371    /// 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.
4372    #[serde(skip_serializing_if = "Option::is_none")]
4373    pub request_three_d_secure:
4374        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
4375    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
4376    /// using the cvc_token parameter).
4377    #[serde(skip_serializing_if = "Option::is_none")]
4378    pub require_cvc_recollection: Option<bool>,
4379    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4380    ///
4381    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4382    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4383    ///
4384    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4385    ///
4386    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4387    ///
4388    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4389    #[serde(skip_serializing_if = "Option::is_none")]
4390    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
4391    /// Provides information about a card payment that customers see on their statements.
4392    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
4393    /// Maximum 22 characters.
4394    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
4395    #[serde(skip_serializing_if = "Option::is_none")]
4396    pub statement_descriptor_suffix_kana: Option<String>,
4397    /// Provides information about a card payment that customers see on their statements.
4398    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
4399    /// Maximum 17 characters.
4400    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
4401    #[serde(skip_serializing_if = "Option::is_none")]
4402    pub statement_descriptor_suffix_kanji: Option<String>,
4403    /// If 3D Secure authentication was performed with a third-party provider,
4404    /// the authentication details to use for this payment.
4405    #[serde(skip_serializing_if = "Option::is_none")]
4406    pub three_d_secure: Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
4407}
4408impl CreatePaymentIntentPaymentMethodOptionsCard {
4409    pub fn new() -> Self {
4410        Self {
4411            capture_method: None,
4412            cvc_token: None,
4413            installments: None,
4414            mandate_options: None,
4415            moto: None,
4416            network: None,
4417            request_extended_authorization: None,
4418            request_incremental_authorization: None,
4419            request_multicapture: None,
4420            request_overcapture: None,
4421            request_three_d_secure: None,
4422            require_cvc_recollection: None,
4423            setup_future_usage: None,
4424            statement_descriptor_suffix_kana: None,
4425            statement_descriptor_suffix_kanji: None,
4426            three_d_secure: None,
4427        }
4428    }
4429}
4430impl Default for CreatePaymentIntentPaymentMethodOptionsCard {
4431    fn default() -> Self {
4432        Self::new()
4433    }
4434}
4435/// Controls when the funds are captured from the customer's account.
4436///
4437/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
4438///
4439/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
4440#[derive(Copy, Clone, Eq, PartialEq)]
4441pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4442    Manual,
4443}
4444impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4445    pub fn as_str(self) -> &'static str {
4446        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4447        match self {
4448            Manual => "manual",
4449        }
4450    }
4451}
4452
4453impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4454    type Err = stripe_types::StripeParseError;
4455    fn from_str(s: &str) -> Result<Self, Self::Err> {
4456        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4457        match s {
4458            "manual" => Ok(Manual),
4459            _ => Err(stripe_types::StripeParseError),
4460        }
4461    }
4462}
4463impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4465        f.write_str(self.as_str())
4466    }
4467}
4468
4469impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4471        f.write_str(self.as_str())
4472    }
4473}
4474impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4475    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4476    where
4477        S: serde::Serializer,
4478    {
4479        serializer.serialize_str(self.as_str())
4480    }
4481}
4482#[cfg(feature = "deserialize")]
4483impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4484    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4485        use std::str::FromStr;
4486        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4487        Self::from_str(&s).map_err(|_| {
4488            serde::de::Error::custom(
4489                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod",
4490            )
4491        })
4492    }
4493}
4494/// Installment configuration for payments attempted on this PaymentIntent.
4495///
4496/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4497#[derive(Copy, Clone, Debug, serde::Serialize)]
4498pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4499    /// Setting to true enables installments for this PaymentIntent.
4500    /// This will cause the response to contain a list of available installment plans.
4501    /// Setting to false will prevent any selected plan from applying to a charge.
4502    #[serde(skip_serializing_if = "Option::is_none")]
4503    pub enabled: Option<bool>,
4504    /// The selected installment plan to use for this payment attempt.
4505    /// This parameter can only be provided during confirmation.
4506    #[serde(skip_serializing_if = "Option::is_none")]
4507    pub plan: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
4508}
4509impl CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4510    pub fn new() -> Self {
4511        Self { enabled: None, plan: None }
4512    }
4513}
4514impl Default for CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4515    fn default() -> Self {
4516        Self::new()
4517    }
4518}
4519/// The selected installment plan to use for this payment attempt.
4520/// This parameter can only be provided during confirmation.
4521#[derive(Copy, Clone, Debug, serde::Serialize)]
4522pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4523    /// For `fixed_count` installment plans, this is required.
4524    /// It represents the number of installment payments your customer will make to their credit card.
4525    #[serde(skip_serializing_if = "Option::is_none")]
4526    pub count: Option<u64>,
4527    /// For `fixed_count` installment plans, this is required.
4528    /// It represents the interval between installment payments your customer will make to their credit card.
4529    /// One of `month`.
4530    #[serde(skip_serializing_if = "Option::is_none")]
4531    pub interval: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
4532    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4533    #[serde(rename = "type")]
4534    pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
4535}
4536impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4537    pub fn new(
4538        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
4539    ) -> Self {
4540        Self { count: None, interval: None, type_: type_.into() }
4541    }
4542}
4543/// For `fixed_count` installment plans, this is required.
4544/// It represents the interval between installment payments your customer will make to their credit card.
4545/// One of `month`.
4546#[derive(Copy, Clone, Eq, PartialEq)]
4547pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4548    Month,
4549}
4550impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4551    pub fn as_str(self) -> &'static str {
4552        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4553        match self {
4554            Month => "month",
4555        }
4556    }
4557}
4558
4559impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4560    type Err = stripe_types::StripeParseError;
4561    fn from_str(s: &str) -> Result<Self, Self::Err> {
4562        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4563        match s {
4564            "month" => Ok(Month),
4565            _ => Err(stripe_types::StripeParseError),
4566        }
4567    }
4568}
4569impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4571        f.write_str(self.as_str())
4572    }
4573}
4574
4575impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4576    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4577        f.write_str(self.as_str())
4578    }
4579}
4580impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4581    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4582    where
4583        S: serde::Serializer,
4584    {
4585        serializer.serialize_str(self.as_str())
4586    }
4587}
4588#[cfg(feature = "deserialize")]
4589impl<'de> serde::Deserialize<'de>
4590    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
4591{
4592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4593        use std::str::FromStr;
4594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4595        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
4596    }
4597}
4598/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4599#[derive(Copy, Clone, Eq, PartialEq)]
4600pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4601    Bonus,
4602    FixedCount,
4603    Revolving,
4604}
4605impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4606    pub fn as_str(self) -> &'static str {
4607        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4608        match self {
4609            Bonus => "bonus",
4610            FixedCount => "fixed_count",
4611            Revolving => "revolving",
4612        }
4613    }
4614}
4615
4616impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4617    type Err = stripe_types::StripeParseError;
4618    fn from_str(s: &str) -> Result<Self, Self::Err> {
4619        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4620        match s {
4621            "bonus" => Ok(Bonus),
4622            "fixed_count" => Ok(FixedCount),
4623            "revolving" => Ok(Revolving),
4624            _ => Err(stripe_types::StripeParseError),
4625        }
4626    }
4627}
4628impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4629    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4630        f.write_str(self.as_str())
4631    }
4632}
4633
4634impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4636        f.write_str(self.as_str())
4637    }
4638}
4639impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4640    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4641    where
4642        S: serde::Serializer,
4643    {
4644        serializer.serialize_str(self.as_str())
4645    }
4646}
4647#[cfg(feature = "deserialize")]
4648impl<'de> serde::Deserialize<'de>
4649    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
4650{
4651    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4652        use std::str::FromStr;
4653        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4654        Self::from_str(&s).map_err(|_| {
4655            serde::de::Error::custom(
4656                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType",
4657            )
4658        })
4659    }
4660}
4661/// Configuration options for setting up an eMandate for cards issued in India.
4662#[derive(Clone, Debug, serde::Serialize)]
4663pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4664    /// Amount to be charged for future payments.
4665    pub amount: i64,
4666    /// One of `fixed` or `maximum`.
4667    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4668    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4669    pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
4670    /// A description of the mandate or subscription that is meant to be displayed to the customer.
4671    #[serde(skip_serializing_if = "Option::is_none")]
4672    pub description: Option<String>,
4673    /// End date of the mandate or subscription.
4674    /// If not provided, the mandate will be active until canceled.
4675    /// If provided, end date should be after start date.
4676    #[serde(skip_serializing_if = "Option::is_none")]
4677    pub end_date: Option<stripe_types::Timestamp>,
4678    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4679    pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
4680    /// The number of intervals between payments.
4681    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
4682    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
4683    /// This parameter is optional when `interval=sporadic`.
4684    #[serde(skip_serializing_if = "Option::is_none")]
4685    pub interval_count: Option<u64>,
4686    /// Unique identifier for the mandate or subscription.
4687    pub reference: String,
4688    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
4689    pub start_date: stripe_types::Timestamp,
4690    /// Specifies the type of mandates supported. Possible values are `india`.
4691    #[serde(skip_serializing_if = "Option::is_none")]
4692    pub supported_types:
4693        Option<Vec<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
4694}
4695impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4696    pub fn new(
4697        amount: impl Into<i64>,
4698        amount_type: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
4699        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
4700        reference: impl Into<String>,
4701        start_date: impl Into<stripe_types::Timestamp>,
4702    ) -> Self {
4703        Self {
4704            amount: amount.into(),
4705            amount_type: amount_type.into(),
4706            description: None,
4707            end_date: None,
4708            interval: interval.into(),
4709            interval_count: None,
4710            reference: reference.into(),
4711            start_date: start_date.into(),
4712            supported_types: None,
4713        }
4714    }
4715}
4716/// One of `fixed` or `maximum`.
4717/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4718/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4719#[derive(Copy, Clone, Eq, PartialEq)]
4720pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4721    Fixed,
4722    Maximum,
4723}
4724impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4725    pub fn as_str(self) -> &'static str {
4726        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
4727        match self {
4728            Fixed => "fixed",
4729            Maximum => "maximum",
4730        }
4731    }
4732}
4733
4734impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4735    type Err = stripe_types::StripeParseError;
4736    fn from_str(s: &str) -> Result<Self, Self::Err> {
4737        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
4738        match s {
4739            "fixed" => Ok(Fixed),
4740            "maximum" => Ok(Maximum),
4741            _ => Err(stripe_types::StripeParseError),
4742        }
4743    }
4744}
4745impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4746    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4747        f.write_str(self.as_str())
4748    }
4749}
4750
4751impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4752    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4753        f.write_str(self.as_str())
4754    }
4755}
4756impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4757    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4758    where
4759        S: serde::Serializer,
4760    {
4761        serializer.serialize_str(self.as_str())
4762    }
4763}
4764#[cfg(feature = "deserialize")]
4765impl<'de> serde::Deserialize<'de>
4766    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
4767{
4768    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4769        use std::str::FromStr;
4770        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4771        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
4772    }
4773}
4774/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4775#[derive(Copy, Clone, Eq, PartialEq)]
4776pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4777    Day,
4778    Month,
4779    Sporadic,
4780    Week,
4781    Year,
4782}
4783impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4784    pub fn as_str(self) -> &'static str {
4785        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
4786        match self {
4787            Day => "day",
4788            Month => "month",
4789            Sporadic => "sporadic",
4790            Week => "week",
4791            Year => "year",
4792        }
4793    }
4794}
4795
4796impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4797    type Err = stripe_types::StripeParseError;
4798    fn from_str(s: &str) -> Result<Self, Self::Err> {
4799        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
4800        match s {
4801            "day" => Ok(Day),
4802            "month" => Ok(Month),
4803            "sporadic" => Ok(Sporadic),
4804            "week" => Ok(Week),
4805            "year" => Ok(Year),
4806            _ => Err(stripe_types::StripeParseError),
4807        }
4808    }
4809}
4810impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4812        f.write_str(self.as_str())
4813    }
4814}
4815
4816impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4818        f.write_str(self.as_str())
4819    }
4820}
4821impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4822    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4823    where
4824        S: serde::Serializer,
4825    {
4826        serializer.serialize_str(self.as_str())
4827    }
4828}
4829#[cfg(feature = "deserialize")]
4830impl<'de> serde::Deserialize<'de>
4831    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
4832{
4833    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4834        use std::str::FromStr;
4835        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4836        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
4837    }
4838}
4839/// Specifies the type of mandates supported. Possible values are `india`.
4840#[derive(Copy, Clone, Eq, PartialEq)]
4841pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4842    India,
4843}
4844impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4845    pub fn as_str(self) -> &'static str {
4846        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
4847        match self {
4848            India => "india",
4849        }
4850    }
4851}
4852
4853impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4854    type Err = stripe_types::StripeParseError;
4855    fn from_str(s: &str) -> Result<Self, Self::Err> {
4856        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
4857        match s {
4858            "india" => Ok(India),
4859            _ => Err(stripe_types::StripeParseError),
4860        }
4861    }
4862}
4863impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4865        f.write_str(self.as_str())
4866    }
4867}
4868
4869impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4871        f.write_str(self.as_str())
4872    }
4873}
4874impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4875    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4876    where
4877        S: serde::Serializer,
4878    {
4879        serializer.serialize_str(self.as_str())
4880    }
4881}
4882#[cfg(feature = "deserialize")]
4883impl<'de> serde::Deserialize<'de>
4884    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
4885{
4886    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4887        use std::str::FromStr;
4888        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4889        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
4890    }
4891}
4892/// Selected network to process this PaymentIntent on.
4893/// Depends on the available networks of the card attached to the PaymentIntent.
4894/// Can be only set confirm-time.
4895#[derive(Copy, Clone, Eq, PartialEq)]
4896pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4897    Amex,
4898    CartesBancaires,
4899    Diners,
4900    Discover,
4901    EftposAu,
4902    Girocard,
4903    Interac,
4904    Jcb,
4905    Link,
4906    Mastercard,
4907    Unionpay,
4908    Unknown,
4909    Visa,
4910}
4911impl CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4912    pub fn as_str(self) -> &'static str {
4913        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
4914        match self {
4915            Amex => "amex",
4916            CartesBancaires => "cartes_bancaires",
4917            Diners => "diners",
4918            Discover => "discover",
4919            EftposAu => "eftpos_au",
4920            Girocard => "girocard",
4921            Interac => "interac",
4922            Jcb => "jcb",
4923            Link => "link",
4924            Mastercard => "mastercard",
4925            Unionpay => "unionpay",
4926            Unknown => "unknown",
4927            Visa => "visa",
4928        }
4929    }
4930}
4931
4932impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4933    type Err = stripe_types::StripeParseError;
4934    fn from_str(s: &str) -> Result<Self, Self::Err> {
4935        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
4936        match s {
4937            "amex" => Ok(Amex),
4938            "cartes_bancaires" => Ok(CartesBancaires),
4939            "diners" => Ok(Diners),
4940            "discover" => Ok(Discover),
4941            "eftpos_au" => Ok(EftposAu),
4942            "girocard" => Ok(Girocard),
4943            "interac" => Ok(Interac),
4944            "jcb" => Ok(Jcb),
4945            "link" => Ok(Link),
4946            "mastercard" => Ok(Mastercard),
4947            "unionpay" => Ok(Unionpay),
4948            "unknown" => Ok(Unknown),
4949            "visa" => Ok(Visa),
4950            _ => Err(stripe_types::StripeParseError),
4951        }
4952    }
4953}
4954impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4956        f.write_str(self.as_str())
4957    }
4958}
4959
4960impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4961    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4962        f.write_str(self.as_str())
4963    }
4964}
4965impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4966    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4967    where
4968        S: serde::Serializer,
4969    {
4970        serializer.serialize_str(self.as_str())
4971    }
4972}
4973#[cfg(feature = "deserialize")]
4974impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4975    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4976        use std::str::FromStr;
4977        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4978        Self::from_str(&s).map_err(|_| {
4979            serde::de::Error::custom(
4980                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardNetwork",
4981            )
4982        })
4983    }
4984}
4985/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4986#[derive(Copy, Clone, Eq, PartialEq)]
4987pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4988    IfAvailable,
4989    Never,
4990}
4991impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4992    pub fn as_str(self) -> &'static str {
4993        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
4994        match self {
4995            IfAvailable => "if_available",
4996            Never => "never",
4997        }
4998    }
4999}
5000
5001impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5002    type Err = stripe_types::StripeParseError;
5003    fn from_str(s: &str) -> Result<Self, Self::Err> {
5004        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
5005        match s {
5006            "if_available" => Ok(IfAvailable),
5007            "never" => Ok(Never),
5008            _ => Err(stripe_types::StripeParseError),
5009        }
5010    }
5011}
5012impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5013    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5014        f.write_str(self.as_str())
5015    }
5016}
5017
5018impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5019    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5020        f.write_str(self.as_str())
5021    }
5022}
5023impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5024    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5025    where
5026        S: serde::Serializer,
5027    {
5028        serializer.serialize_str(self.as_str())
5029    }
5030}
5031#[cfg(feature = "deserialize")]
5032impl<'de> serde::Deserialize<'de>
5033    for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
5034{
5035    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5036        use std::str::FromStr;
5037        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5038        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
5039    }
5040}
5041/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
5042#[derive(Copy, Clone, Eq, PartialEq)]
5043pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
5044    IfAvailable,
5045    Never,
5046}
5047impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
5048    pub fn as_str(self) -> &'static str {
5049        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
5050        match self {
5051            IfAvailable => "if_available",
5052            Never => "never",
5053        }
5054    }
5055}
5056
5057impl std::str::FromStr
5058    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5059{
5060    type Err = stripe_types::StripeParseError;
5061    fn from_str(s: &str) -> Result<Self, Self::Err> {
5062        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
5063        match s {
5064            "if_available" => Ok(IfAvailable),
5065            "never" => Ok(Never),
5066            _ => Err(stripe_types::StripeParseError),
5067        }
5068    }
5069}
5070impl std::fmt::Display
5071    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5072{
5073    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5074        f.write_str(self.as_str())
5075    }
5076}
5077
5078impl std::fmt::Debug
5079    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5080{
5081    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5082        f.write_str(self.as_str())
5083    }
5084}
5085impl serde::Serialize
5086    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5087{
5088    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5089    where
5090        S: serde::Serializer,
5091    {
5092        serializer.serialize_str(self.as_str())
5093    }
5094}
5095#[cfg(feature = "deserialize")]
5096impl<'de> serde::Deserialize<'de>
5097    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5098{
5099    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5100        use std::str::FromStr;
5101        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5102        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
5103    }
5104}
5105/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
5106#[derive(Copy, Clone, Eq, PartialEq)]
5107pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5108    IfAvailable,
5109    Never,
5110}
5111impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5112    pub fn as_str(self) -> &'static str {
5113        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
5114        match self {
5115            IfAvailable => "if_available",
5116            Never => "never",
5117        }
5118    }
5119}
5120
5121impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5122    type Err = stripe_types::StripeParseError;
5123    fn from_str(s: &str) -> Result<Self, Self::Err> {
5124        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
5125        match s {
5126            "if_available" => Ok(IfAvailable),
5127            "never" => Ok(Never),
5128            _ => Err(stripe_types::StripeParseError),
5129        }
5130    }
5131}
5132impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5133    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5134        f.write_str(self.as_str())
5135    }
5136}
5137
5138impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5139    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5140        f.write_str(self.as_str())
5141    }
5142}
5143impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5144    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5145    where
5146        S: serde::Serializer,
5147    {
5148        serializer.serialize_str(self.as_str())
5149    }
5150}
5151#[cfg(feature = "deserialize")]
5152impl<'de> serde::Deserialize<'de>
5153    for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
5154{
5155    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5156        use std::str::FromStr;
5157        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5158        Self::from_str(&s).map_err(|_| {
5159            serde::de::Error::custom(
5160                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture",
5161            )
5162        })
5163    }
5164}
5165/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
5166#[derive(Copy, Clone, Eq, PartialEq)]
5167pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5168    IfAvailable,
5169    Never,
5170}
5171impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5172    pub fn as_str(self) -> &'static str {
5173        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
5174        match self {
5175            IfAvailable => "if_available",
5176            Never => "never",
5177        }
5178    }
5179}
5180
5181impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5182    type Err = stripe_types::StripeParseError;
5183    fn from_str(s: &str) -> Result<Self, Self::Err> {
5184        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
5185        match s {
5186            "if_available" => Ok(IfAvailable),
5187            "never" => Ok(Never),
5188            _ => Err(stripe_types::StripeParseError),
5189        }
5190    }
5191}
5192impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5194        f.write_str(self.as_str())
5195    }
5196}
5197
5198impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5199    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5200        f.write_str(self.as_str())
5201    }
5202}
5203impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5204    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5205    where
5206        S: serde::Serializer,
5207    {
5208        serializer.serialize_str(self.as_str())
5209    }
5210}
5211#[cfg(feature = "deserialize")]
5212impl<'de> serde::Deserialize<'de>
5213    for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
5214{
5215    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5216        use std::str::FromStr;
5217        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5218        Self::from_str(&s).map_err(|_| {
5219            serde::de::Error::custom(
5220                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture",
5221            )
5222        })
5223    }
5224}
5225/// 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).
5226/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
5227/// If not provided, this value defaults to `automatic`.
5228/// 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.
5229#[derive(Copy, Clone, Eq, PartialEq)]
5230pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5231    Any,
5232    Automatic,
5233    Challenge,
5234}
5235impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5236    pub fn as_str(self) -> &'static str {
5237        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
5238        match self {
5239            Any => "any",
5240            Automatic => "automatic",
5241            Challenge => "challenge",
5242        }
5243    }
5244}
5245
5246impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5247    type Err = stripe_types::StripeParseError;
5248    fn from_str(s: &str) -> Result<Self, Self::Err> {
5249        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
5250        match s {
5251            "any" => Ok(Any),
5252            "automatic" => Ok(Automatic),
5253            "challenge" => Ok(Challenge),
5254            _ => Err(stripe_types::StripeParseError),
5255        }
5256    }
5257}
5258impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5260        f.write_str(self.as_str())
5261    }
5262}
5263
5264impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5265    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5266        f.write_str(self.as_str())
5267    }
5268}
5269impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5270    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5271    where
5272        S: serde::Serializer,
5273    {
5274        serializer.serialize_str(self.as_str())
5275    }
5276}
5277#[cfg(feature = "deserialize")]
5278impl<'de> serde::Deserialize<'de>
5279    for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
5280{
5281    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5282        use std::str::FromStr;
5283        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5284        Self::from_str(&s).map_err(|_| {
5285            serde::de::Error::custom(
5286                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
5287            )
5288        })
5289    }
5290}
5291/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5292///
5293/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5294/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5295///
5296/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5297///
5298/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5299///
5300/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
5301#[derive(Copy, Clone, Eq, PartialEq)]
5302pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5303    None,
5304    OffSession,
5305    OnSession,
5306}
5307impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5308    pub fn as_str(self) -> &'static str {
5309        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5310        match self {
5311            None => "none",
5312            OffSession => "off_session",
5313            OnSession => "on_session",
5314        }
5315    }
5316}
5317
5318impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5319    type Err = stripe_types::StripeParseError;
5320    fn from_str(s: &str) -> Result<Self, Self::Err> {
5321        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5322        match s {
5323            "none" => Ok(None),
5324            "off_session" => Ok(OffSession),
5325            "on_session" => Ok(OnSession),
5326            _ => Err(stripe_types::StripeParseError),
5327        }
5328    }
5329}
5330impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5331    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5332        f.write_str(self.as_str())
5333    }
5334}
5335
5336impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5337    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5338        f.write_str(self.as_str())
5339    }
5340}
5341impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5342    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5343    where
5344        S: serde::Serializer,
5345    {
5346        serializer.serialize_str(self.as_str())
5347    }
5348}
5349#[cfg(feature = "deserialize")]
5350impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5351    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5352        use std::str::FromStr;
5353        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5354        Self::from_str(&s).map_err(|_| {
5355            serde::de::Error::custom(
5356                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
5357            )
5358        })
5359    }
5360}
5361/// If 3D Secure authentication was performed with a third-party provider,
5362/// the authentication details to use for this payment.
5363#[derive(Clone, Debug, serde::Serialize)]
5364pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5365    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5366    #[serde(skip_serializing_if = "Option::is_none")]
5367    pub ares_trans_status:
5368        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
5369    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
5370    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
5371    /// (Most 3D Secure providers will return the base64-encoded version, which
5372    /// is what you should specify here.)
5373    pub cryptogram: String,
5374    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5375    /// provider and indicates what degree of authentication was performed.
5376    #[serde(skip_serializing_if = "Option::is_none")]
5377    pub electronic_commerce_indicator:
5378        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
5379    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
5380    #[serde(skip_serializing_if = "Option::is_none")]
5381    pub exemption_indicator:
5382        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
5383    /// Network specific 3DS fields. Network specific arguments require an
5384    /// explicit card brand choice. The parameter `payment_method_options.card.network``
5385    /// must be populated accordingly
5386    #[serde(skip_serializing_if = "Option::is_none")]
5387    pub network_options:
5388        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
5389    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
5390    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
5391    #[serde(skip_serializing_if = "Option::is_none")]
5392    pub requestor_challenge_indicator: Option<String>,
5393    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
5394    /// Transaction ID (dsTransID).
5395    pub transaction_id: String,
5396    /// The version of 3D Secure that was performed.
5397    pub version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
5398}
5399impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5400    pub fn new(
5401        cryptogram: impl Into<String>,
5402        transaction_id: impl Into<String>,
5403        version: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
5404    ) -> Self {
5405        Self {
5406            ares_trans_status: None,
5407            cryptogram: cryptogram.into(),
5408            electronic_commerce_indicator: None,
5409            exemption_indicator: None,
5410            network_options: None,
5411            requestor_challenge_indicator: None,
5412            transaction_id: transaction_id.into(),
5413            version: version.into(),
5414        }
5415    }
5416}
5417/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5418#[derive(Copy, Clone, Eq, PartialEq)]
5419pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5420    A,
5421    C,
5422    I,
5423    N,
5424    R,
5425    U,
5426    Y,
5427}
5428impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5429    pub fn as_str(self) -> &'static str {
5430        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5431        match self {
5432            A => "A",
5433            C => "C",
5434            I => "I",
5435            N => "N",
5436            R => "R",
5437            U => "U",
5438            Y => "Y",
5439        }
5440    }
5441}
5442
5443impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5444    type Err = stripe_types::StripeParseError;
5445    fn from_str(s: &str) -> Result<Self, Self::Err> {
5446        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5447        match s {
5448            "A" => Ok(A),
5449            "C" => Ok(C),
5450            "I" => Ok(I),
5451            "N" => Ok(N),
5452            "R" => Ok(R),
5453            "U" => Ok(U),
5454            "Y" => Ok(Y),
5455            _ => Err(stripe_types::StripeParseError),
5456        }
5457    }
5458}
5459impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5460    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5461        f.write_str(self.as_str())
5462    }
5463}
5464
5465impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5466    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5467        f.write_str(self.as_str())
5468    }
5469}
5470impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5471    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5472    where
5473        S: serde::Serializer,
5474    {
5475        serializer.serialize_str(self.as_str())
5476    }
5477}
5478#[cfg(feature = "deserialize")]
5479impl<'de> serde::Deserialize<'de>
5480    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
5481{
5482    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5483        use std::str::FromStr;
5484        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5485        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
5486    }
5487}
5488/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5489/// provider and indicates what degree of authentication was performed.
5490#[derive(Copy, Clone, Eq, PartialEq)]
5491pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5492    V01,
5493    V02,
5494    V05,
5495    V06,
5496    V07,
5497}
5498impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5499    pub fn as_str(self) -> &'static str {
5500        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5501        match self {
5502            V01 => "01",
5503            V02 => "02",
5504            V05 => "05",
5505            V06 => "06",
5506            V07 => "07",
5507        }
5508    }
5509}
5510
5511impl std::str::FromStr
5512    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5513{
5514    type Err = stripe_types::StripeParseError;
5515    fn from_str(s: &str) -> Result<Self, Self::Err> {
5516        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5517        match s {
5518            "01" => Ok(V01),
5519            "02" => Ok(V02),
5520            "05" => Ok(V05),
5521            "06" => Ok(V06),
5522            "07" => Ok(V07),
5523            _ => Err(stripe_types::StripeParseError),
5524        }
5525    }
5526}
5527impl std::fmt::Display
5528    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5529{
5530    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5531        f.write_str(self.as_str())
5532    }
5533}
5534
5535impl std::fmt::Debug
5536    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5537{
5538    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5539        f.write_str(self.as_str())
5540    }
5541}
5542impl serde::Serialize
5543    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5544{
5545    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5546    where
5547        S: serde::Serializer,
5548    {
5549        serializer.serialize_str(self.as_str())
5550    }
5551}
5552#[cfg(feature = "deserialize")]
5553impl<'de> serde::Deserialize<'de>
5554    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5555{
5556    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5557        use std::str::FromStr;
5558        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5559        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
5560    }
5561}
5562/// The exemption requested via 3DS and accepted by the issuer at authentication time.
5563#[derive(Copy, Clone, Eq, PartialEq)]
5564pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5565    LowRisk,
5566    None,
5567}
5568impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5569    pub fn as_str(self) -> &'static str {
5570        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5571        match self {
5572            LowRisk => "low_risk",
5573            None => "none",
5574        }
5575    }
5576}
5577
5578impl std::str::FromStr
5579    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5580{
5581    type Err = stripe_types::StripeParseError;
5582    fn from_str(s: &str) -> Result<Self, Self::Err> {
5583        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5584        match s {
5585            "low_risk" => Ok(LowRisk),
5586            "none" => Ok(None),
5587            _ => Err(stripe_types::StripeParseError),
5588        }
5589    }
5590}
5591impl std::fmt::Display
5592    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5593{
5594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5595        f.write_str(self.as_str())
5596    }
5597}
5598
5599impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5600    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5601        f.write_str(self.as_str())
5602    }
5603}
5604impl serde::Serialize
5605    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5606{
5607    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5608    where
5609        S: serde::Serializer,
5610    {
5611        serializer.serialize_str(self.as_str())
5612    }
5613}
5614#[cfg(feature = "deserialize")]
5615impl<'de> serde::Deserialize<'de>
5616    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5617{
5618    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5619        use std::str::FromStr;
5620        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5621        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
5622    }
5623}
5624/// Network specific 3DS fields. Network specific arguments require an
5625/// explicit card brand choice. The parameter `payment_method_options.card.network``
5626/// must be populated accordingly
5627#[derive(Clone, Debug, serde::Serialize)]
5628pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5629    /// Cartes Bancaires-specific 3DS fields.
5630    #[serde(skip_serializing_if = "Option::is_none")]
5631    pub cartes_bancaires: Option<
5632        CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
5633    >,
5634}
5635impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5636    pub fn new() -> Self {
5637        Self { cartes_bancaires: None }
5638    }
5639}
5640impl Default for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5641    fn default() -> Self {
5642        Self::new()
5643    }
5644}
5645/// Cartes Bancaires-specific 3DS fields.
5646#[derive(Clone, Debug, serde::Serialize)]
5647pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
5648    /// The cryptogram calculation algorithm used by the card Issuer's ACS
5649    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
5650    /// messageExtension: CB-AVALGO
5651pub cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
5652    /// The exemption indicator returned from Cartes Bancaires in the ARes.
5653    /// message extension: CB-EXEMPTION; string (4 characters)
5654    /// This is a 3 byte bitmap (low significant byte first and most significant
5655    /// bit first) that has been Base64 encoded
5656#[serde(skip_serializing_if = "Option::is_none")]
5657pub cb_exemption: Option<String>,
5658    /// The risk score returned from Cartes Bancaires in the ARes.
5659    /// message extension: CB-SCORE; numeric value 0-99
5660#[serde(skip_serializing_if = "Option::is_none")]
5661pub cb_score: Option<i64>,
5662
5663}
5664impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
5665    pub fn new(
5666        cb_avalgo: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
5667    ) -> Self {
5668        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
5669    }
5670}
5671/// The cryptogram calculation algorithm used by the card Issuer's ACS
5672/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
5673/// messageExtension: CB-AVALGO
5674#[derive(Copy, Clone, Eq, PartialEq)]
5675pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5676{
5677    V0,
5678    V1,
5679    V2,
5680    V3,
5681    V4,
5682    A,
5683}
5684impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
5685    pub fn as_str(self) -> &'static str {
5686        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
5687        match self {
5688            V0 => "0",
5689            V1 => "1",
5690            V2 => "2",
5691            V3 => "3",
5692            V4 => "4",
5693            A => "A",
5694        }
5695    }
5696}
5697
5698impl std::str::FromStr
5699    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5700{
5701    type Err = stripe_types::StripeParseError;
5702    fn from_str(s: &str) -> Result<Self, Self::Err> {
5703        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
5704        match s {
5705            "0" => Ok(V0),
5706            "1" => Ok(V1),
5707            "2" => Ok(V2),
5708            "3" => Ok(V3),
5709            "4" => Ok(V4),
5710            "A" => Ok(A),
5711            _ => Err(stripe_types::StripeParseError),
5712        }
5713    }
5714}
5715impl std::fmt::Display
5716    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5717{
5718    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5719        f.write_str(self.as_str())
5720    }
5721}
5722
5723impl std::fmt::Debug
5724    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5725{
5726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5727        f.write_str(self.as_str())
5728    }
5729}
5730impl serde::Serialize
5731    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5732{
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>
5742    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5743{
5744    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5745        use std::str::FromStr;
5746        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5747        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
5748    }
5749}
5750/// The version of 3D Secure that was performed.
5751#[derive(Copy, Clone, Eq, PartialEq)]
5752pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5753    V1_0_2,
5754    V2_1_0,
5755    V2_2_0,
5756}
5757impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5758    pub fn as_str(self) -> &'static str {
5759        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
5760        match self {
5761            V1_0_2 => "1.0.2",
5762            V2_1_0 => "2.1.0",
5763            V2_2_0 => "2.2.0",
5764        }
5765    }
5766}
5767
5768impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5769    type Err = stripe_types::StripeParseError;
5770    fn from_str(s: &str) -> Result<Self, Self::Err> {
5771        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
5772        match s {
5773            "1.0.2" => Ok(V1_0_2),
5774            "2.1.0" => Ok(V2_1_0),
5775            "2.2.0" => Ok(V2_2_0),
5776            _ => Err(stripe_types::StripeParseError),
5777        }
5778    }
5779}
5780impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5781    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5782        f.write_str(self.as_str())
5783    }
5784}
5785
5786impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5787    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5788        f.write_str(self.as_str())
5789    }
5790}
5791impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5792    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5793    where
5794        S: serde::Serializer,
5795    {
5796        serializer.serialize_str(self.as_str())
5797    }
5798}
5799#[cfg(feature = "deserialize")]
5800impl<'de> serde::Deserialize<'de>
5801    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
5802{
5803    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5804        use std::str::FromStr;
5805        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5806        Self::from_str(&s).map_err(|_| {
5807            serde::de::Error::custom(
5808                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
5809            )
5810        })
5811    }
5812}
5813/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
5814#[derive(Copy, Clone, Debug, serde::Serialize)]
5815pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent {
5816    /// Controls when the funds are captured from the customer's account.
5817    ///
5818    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
5819    ///
5820    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
5821    #[serde(skip_serializing_if = "Option::is_none")]
5822    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod>,
5823    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
5824    #[serde(skip_serializing_if = "Option::is_none")]
5825    pub request_extended_authorization: Option<bool>,
5826    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
5827    /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
5828    #[serde(skip_serializing_if = "Option::is_none")]
5829    pub request_incremental_authorization_support: Option<bool>,
5830    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
5831    #[serde(skip_serializing_if = "Option::is_none")]
5832    pub routing: Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
5833}
5834impl CreatePaymentIntentPaymentMethodOptionsCardPresent {
5835    pub fn new() -> Self {
5836        Self {
5837            capture_method: None,
5838            request_extended_authorization: None,
5839            request_incremental_authorization_support: None,
5840            routing: None,
5841        }
5842    }
5843}
5844impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresent {
5845    fn default() -> Self {
5846        Self::new()
5847    }
5848}
5849/// Controls when the funds are captured from the customer's account.
5850///
5851/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
5852///
5853/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
5854#[derive(Copy, Clone, Eq, PartialEq)]
5855pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
5856    Manual,
5857    ManualPreferred,
5858}
5859impl CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
5860    pub fn as_str(self) -> &'static str {
5861        use CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
5862        match self {
5863            Manual => "manual",
5864            ManualPreferred => "manual_preferred",
5865        }
5866    }
5867}
5868
5869impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
5870    type Err = stripe_types::StripeParseError;
5871    fn from_str(s: &str) -> Result<Self, Self::Err> {
5872        use CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
5873        match s {
5874            "manual" => Ok(Manual),
5875            "manual_preferred" => Ok(ManualPreferred),
5876            _ => Err(stripe_types::StripeParseError),
5877        }
5878    }
5879}
5880impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
5881    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5882        f.write_str(self.as_str())
5883    }
5884}
5885
5886impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
5887    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5888        f.write_str(self.as_str())
5889    }
5890}
5891impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
5892    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5893    where
5894        S: serde::Serializer,
5895    {
5896        serializer.serialize_str(self.as_str())
5897    }
5898}
5899#[cfg(feature = "deserialize")]
5900impl<'de> serde::Deserialize<'de>
5901    for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod
5902{
5903    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5904        use std::str::FromStr;
5905        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5906        Self::from_str(&s).map_err(|_| {
5907            serde::de::Error::custom(
5908                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod",
5909            )
5910        })
5911    }
5912}
5913/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
5914#[derive(Copy, Clone, Debug, serde::Serialize)]
5915pub struct CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5916    /// Routing requested priority
5917    #[serde(skip_serializing_if = "Option::is_none")]
5918    pub requested_priority:
5919        Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
5920}
5921impl CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5922    pub fn new() -> Self {
5923        Self { requested_priority: None }
5924    }
5925}
5926impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5927    fn default() -> Self {
5928        Self::new()
5929    }
5930}
5931/// Routing requested priority
5932#[derive(Copy, Clone, Eq, PartialEq)]
5933pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
5934    Domestic,
5935    International,
5936}
5937impl CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
5938    pub fn as_str(self) -> &'static str {
5939        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
5940        match self {
5941            Domestic => "domestic",
5942            International => "international",
5943        }
5944    }
5945}
5946
5947impl std::str::FromStr
5948    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5949{
5950    type Err = stripe_types::StripeParseError;
5951    fn from_str(s: &str) -> Result<Self, Self::Err> {
5952        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
5953        match s {
5954            "domestic" => Ok(Domestic),
5955            "international" => Ok(International),
5956            _ => Err(stripe_types::StripeParseError),
5957        }
5958    }
5959}
5960impl std::fmt::Display
5961    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5962{
5963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5964        f.write_str(self.as_str())
5965    }
5966}
5967
5968impl std::fmt::Debug
5969    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5970{
5971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5972        f.write_str(self.as_str())
5973    }
5974}
5975impl serde::Serialize
5976    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5977{
5978    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5979    where
5980        S: serde::Serializer,
5981    {
5982        serializer.serialize_str(self.as_str())
5983    }
5984}
5985#[cfg(feature = "deserialize")]
5986impl<'de> serde::Deserialize<'de>
5987    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5988{
5989    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5990        use std::str::FromStr;
5991        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5992        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
5993    }
5994}
5995/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
5996#[derive(Copy, Clone, Debug, serde::Serialize)]
5997pub struct CreatePaymentIntentPaymentMethodOptionsCashapp {
5998    /// Controls when the funds are captured from the customer's account.
5999    ///
6000    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
6001    ///
6002    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
6003    #[serde(skip_serializing_if = "Option::is_none")]
6004    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
6005    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6006    ///
6007    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6008    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6009    ///
6010    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6011    ///
6012    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6013    ///
6014    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6015    #[serde(skip_serializing_if = "Option::is_none")]
6016    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
6017}
6018impl CreatePaymentIntentPaymentMethodOptionsCashapp {
6019    pub fn new() -> Self {
6020        Self { capture_method: None, setup_future_usage: None }
6021    }
6022}
6023impl Default for CreatePaymentIntentPaymentMethodOptionsCashapp {
6024    fn default() -> Self {
6025        Self::new()
6026    }
6027}
6028/// Controls when the funds are captured from the customer's account.
6029///
6030/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
6031///
6032/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
6033#[derive(Copy, Clone, Eq, PartialEq)]
6034pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6035    Manual,
6036}
6037impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6038    pub fn as_str(self) -> &'static str {
6039        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
6040        match self {
6041            Manual => "manual",
6042        }
6043    }
6044}
6045
6046impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6047    type Err = stripe_types::StripeParseError;
6048    fn from_str(s: &str) -> Result<Self, Self::Err> {
6049        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
6050        match s {
6051            "manual" => Ok(Manual),
6052            _ => Err(stripe_types::StripeParseError),
6053        }
6054    }
6055}
6056impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6057    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6058        f.write_str(self.as_str())
6059    }
6060}
6061
6062impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6063    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6064        f.write_str(self.as_str())
6065    }
6066}
6067impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6068    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6069    where
6070        S: serde::Serializer,
6071    {
6072        serializer.serialize_str(self.as_str())
6073    }
6074}
6075#[cfg(feature = "deserialize")]
6076impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6077    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6078        use std::str::FromStr;
6079        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6080        Self::from_str(&s).map_err(|_| {
6081            serde::de::Error::custom(
6082                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod",
6083            )
6084        })
6085    }
6086}
6087/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6088///
6089/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6090/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6091///
6092/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6093///
6094/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6095///
6096/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6097#[derive(Copy, Clone, Eq, PartialEq)]
6098pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6099    None,
6100    OffSession,
6101    OnSession,
6102}
6103impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6104    pub fn as_str(self) -> &'static str {
6105        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
6106        match self {
6107            None => "none",
6108            OffSession => "off_session",
6109            OnSession => "on_session",
6110        }
6111    }
6112}
6113
6114impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6115    type Err = stripe_types::StripeParseError;
6116    fn from_str(s: &str) -> Result<Self, Self::Err> {
6117        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
6118        match s {
6119            "none" => Ok(None),
6120            "off_session" => Ok(OffSession),
6121            "on_session" => Ok(OnSession),
6122            _ => Err(stripe_types::StripeParseError),
6123        }
6124    }
6125}
6126impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6127    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6128        f.write_str(self.as_str())
6129    }
6130}
6131
6132impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6133    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6134        f.write_str(self.as_str())
6135    }
6136}
6137impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6138    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6139    where
6140        S: serde::Serializer,
6141    {
6142        serializer.serialize_str(self.as_str())
6143    }
6144}
6145#[cfg(feature = "deserialize")]
6146impl<'de> serde::Deserialize<'de>
6147    for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
6148{
6149    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6150        use std::str::FromStr;
6151        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6152        Self::from_str(&s).map_err(|_| {
6153            serde::de::Error::custom(
6154                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
6155            )
6156        })
6157    }
6158}
6159/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
6160#[derive(Copy, Clone, Debug, serde::Serialize)]
6161pub struct CreatePaymentIntentPaymentMethodOptionsCrypto {
6162    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6163    ///
6164    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6165    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6166    ///
6167    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6168    ///
6169    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6170    ///
6171    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6172    #[serde(skip_serializing_if = "Option::is_none")]
6173    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
6174}
6175impl CreatePaymentIntentPaymentMethodOptionsCrypto {
6176    pub fn new() -> Self {
6177        Self { setup_future_usage: None }
6178    }
6179}
6180impl Default for CreatePaymentIntentPaymentMethodOptionsCrypto {
6181    fn default() -> Self {
6182        Self::new()
6183    }
6184}
6185/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6186///
6187/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6188/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6189///
6190/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6191///
6192/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6193///
6194/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6195#[derive(Copy, Clone, Eq, PartialEq)]
6196pub enum CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6197    None,
6198}
6199impl CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6200    pub fn as_str(self) -> &'static str {
6201        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
6202        match self {
6203            None => "none",
6204        }
6205    }
6206}
6207
6208impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6209    type Err = stripe_types::StripeParseError;
6210    fn from_str(s: &str) -> Result<Self, Self::Err> {
6211        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
6212        match s {
6213            "none" => Ok(None),
6214            _ => Err(stripe_types::StripeParseError),
6215        }
6216    }
6217}
6218impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6219    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6220        f.write_str(self.as_str())
6221    }
6222}
6223
6224impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6225    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6226        f.write_str(self.as_str())
6227    }
6228}
6229impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6230    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6231    where
6232        S: serde::Serializer,
6233    {
6234        serializer.serialize_str(self.as_str())
6235    }
6236}
6237#[cfg(feature = "deserialize")]
6238impl<'de> serde::Deserialize<'de>
6239    for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
6240{
6241    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6242        use std::str::FromStr;
6243        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6244        Self::from_str(&s).map_err(|_| {
6245            serde::de::Error::custom(
6246                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
6247            )
6248        })
6249    }
6250}
6251/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
6252#[derive(Clone, Debug, serde::Serialize)]
6253pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6254    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
6255    #[serde(skip_serializing_if = "Option::is_none")]
6256    pub bank_transfer: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
6257    /// The funding method type to be used when there are not enough funds in the customer balance.
6258    /// Permitted values include: `bank_transfer`.
6259    #[serde(skip_serializing_if = "Option::is_none")]
6260    pub funding_type: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
6261    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6262    ///
6263    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6264    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6265    ///
6266    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6267    ///
6268    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6269    ///
6270    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6271    #[serde(skip_serializing_if = "Option::is_none")]
6272    pub setup_future_usage:
6273        Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
6274}
6275impl CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6276    pub fn new() -> Self {
6277        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
6278    }
6279}
6280impl Default for CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6281    fn default() -> Self {
6282        Self::new()
6283    }
6284}
6285/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
6286#[derive(Clone, Debug, serde::Serialize)]
6287pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
6288    /// Configuration for the eu_bank_transfer funding type.
6289    #[serde(skip_serializing_if = "Option::is_none")]
6290    pub eu_bank_transfer: Option<EuBankTransferParams>,
6291    /// List of address types that should be returned in the financial_addresses response.
6292    /// If not specified, all valid types will be returned.
6293    ///
6294    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
6295    #[serde(skip_serializing_if = "Option::is_none")]
6296    pub requested_address_types: Option<
6297        Vec<
6298            CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
6299        >,
6300    >,
6301    /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
6302    #[serde(rename = "type")]
6303    pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
6304}
6305impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
6306    pub fn new(
6307        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
6308    ) -> Self {
6309        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
6310    }
6311}
6312/// List of address types that should be returned in the financial_addresses response.
6313/// If not specified, all valid types will be returned.
6314///
6315/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
6316#[derive(Copy, Clone, Eq, PartialEq)]
6317pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
6318    Aba,
6319    Iban,
6320    Sepa,
6321    SortCode,
6322    Spei,
6323    Swift,
6324    Zengin,
6325}
6326impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
6327    pub fn as_str(self) -> &'static str {
6328        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
6329        match self {
6330            Aba => "aba",
6331            Iban => "iban",
6332            Sepa => "sepa",
6333            SortCode => "sort_code",
6334            Spei => "spei",
6335            Swift => "swift",
6336            Zengin => "zengin",
6337        }
6338    }
6339}
6340
6341impl std::str::FromStr
6342    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6343{
6344    type Err = stripe_types::StripeParseError;
6345    fn from_str(s: &str) -> Result<Self, Self::Err> {
6346        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
6347        match s {
6348            "aba" => Ok(Aba),
6349            "iban" => Ok(Iban),
6350            "sepa" => Ok(Sepa),
6351            "sort_code" => Ok(SortCode),
6352            "spei" => Ok(Spei),
6353            "swift" => Ok(Swift),
6354            "zengin" => Ok(Zengin),
6355            _ => Err(stripe_types::StripeParseError),
6356        }
6357    }
6358}
6359impl std::fmt::Display
6360    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6361{
6362    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6363        f.write_str(self.as_str())
6364    }
6365}
6366
6367impl std::fmt::Debug
6368    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6369{
6370    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6371        f.write_str(self.as_str())
6372    }
6373}
6374impl serde::Serialize
6375    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6376{
6377    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6378    where
6379        S: serde::Serializer,
6380    {
6381        serializer.serialize_str(self.as_str())
6382    }
6383}
6384#[cfg(feature = "deserialize")]
6385impl<'de> serde::Deserialize<'de>
6386    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6387{
6388    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6389        use std::str::FromStr;
6390        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6391        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
6392    }
6393}
6394/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
6395#[derive(Copy, Clone, Eq, PartialEq)]
6396pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6397    EuBankTransfer,
6398    GbBankTransfer,
6399    JpBankTransfer,
6400    MxBankTransfer,
6401    UsBankTransfer,
6402}
6403impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6404    pub fn as_str(self) -> &'static str {
6405        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6406        match self {
6407            EuBankTransfer => "eu_bank_transfer",
6408            GbBankTransfer => "gb_bank_transfer",
6409            JpBankTransfer => "jp_bank_transfer",
6410            MxBankTransfer => "mx_bank_transfer",
6411            UsBankTransfer => "us_bank_transfer",
6412        }
6413    }
6414}
6415
6416impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6417    type Err = stripe_types::StripeParseError;
6418    fn from_str(s: &str) -> Result<Self, Self::Err> {
6419        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6420        match s {
6421            "eu_bank_transfer" => Ok(EuBankTransfer),
6422            "gb_bank_transfer" => Ok(GbBankTransfer),
6423            "jp_bank_transfer" => Ok(JpBankTransfer),
6424            "mx_bank_transfer" => Ok(MxBankTransfer),
6425            "us_bank_transfer" => Ok(UsBankTransfer),
6426            _ => Err(stripe_types::StripeParseError),
6427        }
6428    }
6429}
6430impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6431    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6432        f.write_str(self.as_str())
6433    }
6434}
6435
6436impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6438        f.write_str(self.as_str())
6439    }
6440}
6441impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6442    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6443    where
6444        S: serde::Serializer,
6445    {
6446        serializer.serialize_str(self.as_str())
6447    }
6448}
6449#[cfg(feature = "deserialize")]
6450impl<'de> serde::Deserialize<'de>
6451    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
6452{
6453    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6454        use std::str::FromStr;
6455        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6456        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
6457    }
6458}
6459/// The funding method type to be used when there are not enough funds in the customer balance.
6460/// Permitted values include: `bank_transfer`.
6461#[derive(Copy, Clone, Eq, PartialEq)]
6462pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6463    BankTransfer,
6464}
6465impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6466    pub fn as_str(self) -> &'static str {
6467        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6468        match self {
6469            BankTransfer => "bank_transfer",
6470        }
6471    }
6472}
6473
6474impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6475    type Err = stripe_types::StripeParseError;
6476    fn from_str(s: &str) -> Result<Self, Self::Err> {
6477        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6478        match s {
6479            "bank_transfer" => Ok(BankTransfer),
6480            _ => Err(stripe_types::StripeParseError),
6481        }
6482    }
6483}
6484impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6485    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6486        f.write_str(self.as_str())
6487    }
6488}
6489
6490impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6491    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6492        f.write_str(self.as_str())
6493    }
6494}
6495impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6496    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6497    where
6498        S: serde::Serializer,
6499    {
6500        serializer.serialize_str(self.as_str())
6501    }
6502}
6503#[cfg(feature = "deserialize")]
6504impl<'de> serde::Deserialize<'de>
6505    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
6506{
6507    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6508        use std::str::FromStr;
6509        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6510        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
6511    }
6512}
6513/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6514///
6515/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6516/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6517///
6518/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6519///
6520/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6521///
6522/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6523#[derive(Copy, Clone, Eq, PartialEq)]
6524pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6525    None,
6526}
6527impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6528    pub fn as_str(self) -> &'static str {
6529        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
6530        match self {
6531            None => "none",
6532        }
6533    }
6534}
6535
6536impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6537    type Err = stripe_types::StripeParseError;
6538    fn from_str(s: &str) -> Result<Self, Self::Err> {
6539        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
6540        match s {
6541            "none" => Ok(None),
6542            _ => Err(stripe_types::StripeParseError),
6543        }
6544    }
6545}
6546impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6547    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6548        f.write_str(self.as_str())
6549    }
6550}
6551
6552impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6553    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6554        f.write_str(self.as_str())
6555    }
6556}
6557impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6558    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6559    where
6560        S: serde::Serializer,
6561    {
6562        serializer.serialize_str(self.as_str())
6563    }
6564}
6565#[cfg(feature = "deserialize")]
6566impl<'de> serde::Deserialize<'de>
6567    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
6568{
6569    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6570        use std::str::FromStr;
6571        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6572        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
6573    }
6574}
6575/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
6576#[derive(Copy, Clone, Debug, serde::Serialize)]
6577pub struct CreatePaymentIntentPaymentMethodOptionsEps {
6578    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6579    ///
6580    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6581    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6582    ///
6583    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6584    ///
6585    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6586    ///
6587    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6588    #[serde(skip_serializing_if = "Option::is_none")]
6589    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
6590}
6591impl CreatePaymentIntentPaymentMethodOptionsEps {
6592    pub fn new() -> Self {
6593        Self { setup_future_usage: None }
6594    }
6595}
6596impl Default for CreatePaymentIntentPaymentMethodOptionsEps {
6597    fn default() -> Self {
6598        Self::new()
6599    }
6600}
6601/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6602///
6603/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6604/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6605///
6606/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6607///
6608/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6609///
6610/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6611#[derive(Copy, Clone, Eq, PartialEq)]
6612pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6613    None,
6614}
6615impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6616    pub fn as_str(self) -> &'static str {
6617        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
6618        match self {
6619            None => "none",
6620        }
6621    }
6622}
6623
6624impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6625    type Err = stripe_types::StripeParseError;
6626    fn from_str(s: &str) -> Result<Self, Self::Err> {
6627        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
6628        match s {
6629            "none" => Ok(None),
6630            _ => Err(stripe_types::StripeParseError),
6631        }
6632    }
6633}
6634impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6636        f.write_str(self.as_str())
6637    }
6638}
6639
6640impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6641    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6642        f.write_str(self.as_str())
6643    }
6644}
6645impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6646    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6647    where
6648        S: serde::Serializer,
6649    {
6650        serializer.serialize_str(self.as_str())
6651    }
6652}
6653#[cfg(feature = "deserialize")]
6654impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6655    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6656        use std::str::FromStr;
6657        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6658        Self::from_str(&s).map_err(|_| {
6659            serde::de::Error::custom(
6660                "Unknown value for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
6661            )
6662        })
6663    }
6664}
6665/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
6666#[derive(Copy, Clone, Debug, serde::Serialize)]
6667pub struct CreatePaymentIntentPaymentMethodOptionsFpx {
6668    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6669    ///
6670    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6671    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6672    ///
6673    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6674    ///
6675    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6676    ///
6677    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6678    #[serde(skip_serializing_if = "Option::is_none")]
6679    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
6680}
6681impl CreatePaymentIntentPaymentMethodOptionsFpx {
6682    pub fn new() -> Self {
6683        Self { setup_future_usage: None }
6684    }
6685}
6686impl Default for CreatePaymentIntentPaymentMethodOptionsFpx {
6687    fn default() -> Self {
6688        Self::new()
6689    }
6690}
6691/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6692///
6693/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6694/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6695///
6696/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6697///
6698/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6699///
6700/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6701#[derive(Copy, Clone, Eq, PartialEq)]
6702pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6703    None,
6704}
6705impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6706    pub fn as_str(self) -> &'static str {
6707        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
6708        match self {
6709            None => "none",
6710        }
6711    }
6712}
6713
6714impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6715    type Err = stripe_types::StripeParseError;
6716    fn from_str(s: &str) -> Result<Self, Self::Err> {
6717        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
6718        match s {
6719            "none" => Ok(None),
6720            _ => Err(stripe_types::StripeParseError),
6721        }
6722    }
6723}
6724impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6725    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6726        f.write_str(self.as_str())
6727    }
6728}
6729
6730impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6731    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6732        f.write_str(self.as_str())
6733    }
6734}
6735impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6736    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6737    where
6738        S: serde::Serializer,
6739    {
6740        serializer.serialize_str(self.as_str())
6741    }
6742}
6743#[cfg(feature = "deserialize")]
6744impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6745    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6746        use std::str::FromStr;
6747        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6748        Self::from_str(&s).map_err(|_| {
6749            serde::de::Error::custom(
6750                "Unknown value for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
6751            )
6752        })
6753    }
6754}
6755/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
6756#[derive(Copy, Clone, Debug, serde::Serialize)]
6757pub struct CreatePaymentIntentPaymentMethodOptionsGiropay {
6758    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6759    ///
6760    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6761    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6762    ///
6763    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6764    ///
6765    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6766    ///
6767    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6768    #[serde(skip_serializing_if = "Option::is_none")]
6769    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
6770}
6771impl CreatePaymentIntentPaymentMethodOptionsGiropay {
6772    pub fn new() -> Self {
6773        Self { setup_future_usage: None }
6774    }
6775}
6776impl Default for CreatePaymentIntentPaymentMethodOptionsGiropay {
6777    fn default() -> Self {
6778        Self::new()
6779    }
6780}
6781/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6782///
6783/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6784/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6785///
6786/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6787///
6788/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6789///
6790/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6791#[derive(Copy, Clone, Eq, PartialEq)]
6792pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6793    None,
6794}
6795impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6796    pub fn as_str(self) -> &'static str {
6797        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
6798        match self {
6799            None => "none",
6800        }
6801    }
6802}
6803
6804impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6805    type Err = stripe_types::StripeParseError;
6806    fn from_str(s: &str) -> Result<Self, Self::Err> {
6807        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
6808        match s {
6809            "none" => Ok(None),
6810            _ => Err(stripe_types::StripeParseError),
6811        }
6812    }
6813}
6814impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6815    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6816        f.write_str(self.as_str())
6817    }
6818}
6819
6820impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6821    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6822        f.write_str(self.as_str())
6823    }
6824}
6825impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6826    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6827    where
6828        S: serde::Serializer,
6829    {
6830        serializer.serialize_str(self.as_str())
6831    }
6832}
6833#[cfg(feature = "deserialize")]
6834impl<'de> serde::Deserialize<'de>
6835    for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
6836{
6837    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6838        use std::str::FromStr;
6839        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6840        Self::from_str(&s).map_err(|_| {
6841            serde::de::Error::custom(
6842                "Unknown value for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
6843            )
6844        })
6845    }
6846}
6847/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
6848#[derive(Copy, Clone, Debug, serde::Serialize)]
6849pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay {
6850    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6851    ///
6852    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6853    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6854    ///
6855    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6856    ///
6857    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6858    ///
6859    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6860    #[serde(skip_serializing_if = "Option::is_none")]
6861    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
6862}
6863impl CreatePaymentIntentPaymentMethodOptionsGrabpay {
6864    pub fn new() -> Self {
6865        Self { setup_future_usage: None }
6866    }
6867}
6868impl Default for CreatePaymentIntentPaymentMethodOptionsGrabpay {
6869    fn default() -> Self {
6870        Self::new()
6871    }
6872}
6873/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6874///
6875/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6876/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6877///
6878/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6879///
6880/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6881///
6882/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6883#[derive(Copy, Clone, Eq, PartialEq)]
6884pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6885    None,
6886}
6887impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6888    pub fn as_str(self) -> &'static str {
6889        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
6890        match self {
6891            None => "none",
6892        }
6893    }
6894}
6895
6896impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6897    type Err = stripe_types::StripeParseError;
6898    fn from_str(s: &str) -> Result<Self, Self::Err> {
6899        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
6900        match s {
6901            "none" => Ok(None),
6902            _ => Err(stripe_types::StripeParseError),
6903        }
6904    }
6905}
6906impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6907    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6908        f.write_str(self.as_str())
6909    }
6910}
6911
6912impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6913    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6914        f.write_str(self.as_str())
6915    }
6916}
6917impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6918    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6919    where
6920        S: serde::Serializer,
6921    {
6922        serializer.serialize_str(self.as_str())
6923    }
6924}
6925#[cfg(feature = "deserialize")]
6926impl<'de> serde::Deserialize<'de>
6927    for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
6928{
6929    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6930        use std::str::FromStr;
6931        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6932        Self::from_str(&s).map_err(|_| {
6933            serde::de::Error::custom(
6934                "Unknown value for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
6935            )
6936        })
6937    }
6938}
6939/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
6940#[derive(Copy, Clone, Debug, serde::Serialize)]
6941pub struct CreatePaymentIntentPaymentMethodOptionsIdeal {
6942    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6943    ///
6944    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6945    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6946    ///
6947    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6948    ///
6949    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6950    ///
6951    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6952    #[serde(skip_serializing_if = "Option::is_none")]
6953    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
6954}
6955impl CreatePaymentIntentPaymentMethodOptionsIdeal {
6956    pub fn new() -> Self {
6957        Self { setup_future_usage: None }
6958    }
6959}
6960impl Default for CreatePaymentIntentPaymentMethodOptionsIdeal {
6961    fn default() -> Self {
6962        Self::new()
6963    }
6964}
6965/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6966///
6967/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6968/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6969///
6970/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6971///
6972/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6973///
6974/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6975#[derive(Copy, Clone, Eq, PartialEq)]
6976pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6977    None,
6978    OffSession,
6979}
6980impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6981    pub fn as_str(self) -> &'static str {
6982        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
6983        match self {
6984            None => "none",
6985            OffSession => "off_session",
6986        }
6987    }
6988}
6989
6990impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6991    type Err = stripe_types::StripeParseError;
6992    fn from_str(s: &str) -> Result<Self, Self::Err> {
6993        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
6994        match s {
6995            "none" => Ok(None),
6996            "off_session" => Ok(OffSession),
6997            _ => Err(stripe_types::StripeParseError),
6998        }
6999    }
7000}
7001impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7002    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7003        f.write_str(self.as_str())
7004    }
7005}
7006
7007impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7008    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7009        f.write_str(self.as_str())
7010    }
7011}
7012impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7013    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7014    where
7015        S: serde::Serializer,
7016    {
7017        serializer.serialize_str(self.as_str())
7018    }
7019}
7020#[cfg(feature = "deserialize")]
7021impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7022    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7023        use std::str::FromStr;
7024        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7025        Self::from_str(&s).map_err(|_| {
7026            serde::de::Error::custom(
7027                "Unknown value for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
7028            )
7029        })
7030    }
7031}
7032/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
7033#[derive(Copy, Clone, Debug, serde::Serialize)]
7034pub struct CreatePaymentIntentPaymentMethodOptionsKakaoPay {
7035    /// Controls when the funds are captured from the customer's account.
7036    ///
7037    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7038    ///
7039    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7040    #[serde(skip_serializing_if = "Option::is_none")]
7041    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
7042    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7043    ///
7044    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7045    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7046    ///
7047    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7048    ///
7049    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7050    #[serde(skip_serializing_if = "Option::is_none")]
7051    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
7052}
7053impl CreatePaymentIntentPaymentMethodOptionsKakaoPay {
7054    pub fn new() -> Self {
7055        Self { capture_method: None, setup_future_usage: None }
7056    }
7057}
7058impl Default for CreatePaymentIntentPaymentMethodOptionsKakaoPay {
7059    fn default() -> Self {
7060        Self::new()
7061    }
7062}
7063/// Controls when the funds are captured from the customer's account.
7064///
7065/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7066///
7067/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7068#[derive(Copy, Clone, Eq, PartialEq)]
7069pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7070    Manual,
7071}
7072impl CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7073    pub fn as_str(self) -> &'static str {
7074        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
7075        match self {
7076            Manual => "manual",
7077        }
7078    }
7079}
7080
7081impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7082    type Err = stripe_types::StripeParseError;
7083    fn from_str(s: &str) -> Result<Self, Self::Err> {
7084        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
7085        match s {
7086            "manual" => Ok(Manual),
7087            _ => Err(stripe_types::StripeParseError),
7088        }
7089    }
7090}
7091impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7093        f.write_str(self.as_str())
7094    }
7095}
7096
7097impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7099        f.write_str(self.as_str())
7100    }
7101}
7102impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7103    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7104    where
7105        S: serde::Serializer,
7106    {
7107        serializer.serialize_str(self.as_str())
7108    }
7109}
7110#[cfg(feature = "deserialize")]
7111impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7112    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7113        use std::str::FromStr;
7114        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7115        Self::from_str(&s).map_err(|_| {
7116            serde::de::Error::custom(
7117                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
7118            )
7119        })
7120    }
7121}
7122/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7123///
7124/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7125/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7126///
7127/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7128///
7129/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7130#[derive(Copy, Clone, Eq, PartialEq)]
7131pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7132    None,
7133    OffSession,
7134}
7135impl CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7136    pub fn as_str(self) -> &'static str {
7137        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
7138        match self {
7139            None => "none",
7140            OffSession => "off_session",
7141        }
7142    }
7143}
7144
7145impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7146    type Err = stripe_types::StripeParseError;
7147    fn from_str(s: &str) -> Result<Self, Self::Err> {
7148        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
7149        match s {
7150            "none" => Ok(None),
7151            "off_session" => Ok(OffSession),
7152            _ => Err(stripe_types::StripeParseError),
7153        }
7154    }
7155}
7156impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7157    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7158        f.write_str(self.as_str())
7159    }
7160}
7161
7162impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7163    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7164        f.write_str(self.as_str())
7165    }
7166}
7167impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7168    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7169    where
7170        S: serde::Serializer,
7171    {
7172        serializer.serialize_str(self.as_str())
7173    }
7174}
7175#[cfg(feature = "deserialize")]
7176impl<'de> serde::Deserialize<'de>
7177    for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
7178{
7179    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7180        use std::str::FromStr;
7181        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7182        Self::from_str(&s).map_err(|_| {
7183            serde::de::Error::custom(
7184                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage",
7185            )
7186        })
7187    }
7188}
7189/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
7190#[derive(Clone, Debug, serde::Serialize)]
7191pub struct CreatePaymentIntentPaymentMethodOptionsKlarna {
7192    /// Controls when the funds are captured from the customer's account.
7193    ///
7194    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7195    ///
7196    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7197    #[serde(skip_serializing_if = "Option::is_none")]
7198    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
7199    /// On-demand details if setting up or charging an on-demand payment.
7200    #[serde(skip_serializing_if = "Option::is_none")]
7201    pub on_demand: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
7202    /// Preferred language of the Klarna authorization page that the customer is redirected to
7203    #[serde(skip_serializing_if = "Option::is_none")]
7204    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7205    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7206    ///
7207    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7208    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7209    ///
7210    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7211    ///
7212    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7213    ///
7214    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7215    #[serde(skip_serializing_if = "Option::is_none")]
7216    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
7217    /// Subscription details if setting up or charging a subscription.
7218    #[serde(skip_serializing_if = "Option::is_none")]
7219    pub subscriptions: Option<Vec<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7220}
7221impl CreatePaymentIntentPaymentMethodOptionsKlarna {
7222    pub fn new() -> Self {
7223        Self {
7224            capture_method: None,
7225            on_demand: None,
7226            preferred_locale: None,
7227            setup_future_usage: None,
7228            subscriptions: None,
7229        }
7230    }
7231}
7232impl Default for CreatePaymentIntentPaymentMethodOptionsKlarna {
7233    fn default() -> Self {
7234        Self::new()
7235    }
7236}
7237/// Controls when the funds are captured from the customer's account.
7238///
7239/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7240///
7241/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7242#[derive(Copy, Clone, Eq, PartialEq)]
7243pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7244    Manual,
7245}
7246impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7247    pub fn as_str(self) -> &'static str {
7248        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
7249        match self {
7250            Manual => "manual",
7251        }
7252    }
7253}
7254
7255impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7256    type Err = stripe_types::StripeParseError;
7257    fn from_str(s: &str) -> Result<Self, Self::Err> {
7258        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
7259        match s {
7260            "manual" => Ok(Manual),
7261            _ => Err(stripe_types::StripeParseError),
7262        }
7263    }
7264}
7265impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7266    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7267        f.write_str(self.as_str())
7268    }
7269}
7270
7271impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7273        f.write_str(self.as_str())
7274    }
7275}
7276impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7277    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7278    where
7279        S: serde::Serializer,
7280    {
7281        serializer.serialize_str(self.as_str())
7282    }
7283}
7284#[cfg(feature = "deserialize")]
7285impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7286    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7287        use std::str::FromStr;
7288        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7289        Self::from_str(&s).map_err(|_| {
7290            serde::de::Error::custom(
7291                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
7292            )
7293        })
7294    }
7295}
7296/// On-demand details if setting up or charging an on-demand payment.
7297#[derive(Copy, Clone, Debug, serde::Serialize)]
7298pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7299    /// Your average amount value.
7300    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7301    #[serde(skip_serializing_if = "Option::is_none")]
7302    pub average_amount: Option<i64>,
7303    /// The maximum value you may charge a customer per purchase.
7304    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7305    #[serde(skip_serializing_if = "Option::is_none")]
7306    pub maximum_amount: Option<i64>,
7307    /// The lowest or minimum value you may charge a customer per purchase.
7308    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7309    #[serde(skip_serializing_if = "Option::is_none")]
7310    pub minimum_amount: Option<i64>,
7311    /// Interval at which the customer is making purchases
7312    #[serde(skip_serializing_if = "Option::is_none")]
7313    pub purchase_interval:
7314        Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7315    /// The number of `purchase_interval` between charges
7316    #[serde(skip_serializing_if = "Option::is_none")]
7317    pub purchase_interval_count: Option<u64>,
7318}
7319impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7320    pub fn new() -> Self {
7321        Self {
7322            average_amount: None,
7323            maximum_amount: None,
7324            minimum_amount: None,
7325            purchase_interval: None,
7326            purchase_interval_count: None,
7327        }
7328    }
7329}
7330impl Default for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7331    fn default() -> Self {
7332        Self::new()
7333    }
7334}
7335/// Interval at which the customer is making purchases
7336#[derive(Copy, Clone, Eq, PartialEq)]
7337pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7338    Day,
7339    Month,
7340    Week,
7341    Year,
7342}
7343impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7344    pub fn as_str(self) -> &'static str {
7345        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7346        match self {
7347            Day => "day",
7348            Month => "month",
7349            Week => "week",
7350            Year => "year",
7351        }
7352    }
7353}
7354
7355impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7356    type Err = stripe_types::StripeParseError;
7357    fn from_str(s: &str) -> Result<Self, Self::Err> {
7358        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7359        match s {
7360            "day" => Ok(Day),
7361            "month" => Ok(Month),
7362            "week" => Ok(Week),
7363            "year" => Ok(Year),
7364            _ => Err(stripe_types::StripeParseError),
7365        }
7366    }
7367}
7368impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7369    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7370        f.write_str(self.as_str())
7371    }
7372}
7373
7374impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7375    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7376        f.write_str(self.as_str())
7377    }
7378}
7379impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7380    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7381    where
7382        S: serde::Serializer,
7383    {
7384        serializer.serialize_str(self.as_str())
7385    }
7386}
7387#[cfg(feature = "deserialize")]
7388impl<'de> serde::Deserialize<'de>
7389    for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7390{
7391    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7392        use std::str::FromStr;
7393        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7394        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
7395    }
7396}
7397/// Preferred language of the Klarna authorization page that the customer is redirected to
7398#[derive(Clone, Eq, PartialEq)]
7399#[non_exhaustive]
7400pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7401    CsMinusCz,
7402    DaMinusDk,
7403    DeMinusAt,
7404    DeMinusCh,
7405    DeMinusDe,
7406    ElMinusGr,
7407    EnMinusAt,
7408    EnMinusAu,
7409    EnMinusBe,
7410    EnMinusCa,
7411    EnMinusCh,
7412    EnMinusCz,
7413    EnMinusDe,
7414    EnMinusDk,
7415    EnMinusEs,
7416    EnMinusFi,
7417    EnMinusFr,
7418    EnMinusGb,
7419    EnMinusGr,
7420    EnMinusIe,
7421    EnMinusIt,
7422    EnMinusNl,
7423    EnMinusNo,
7424    EnMinusNz,
7425    EnMinusPl,
7426    EnMinusPt,
7427    EnMinusRo,
7428    EnMinusSe,
7429    EnMinusUs,
7430    EsMinusEs,
7431    EsMinusUs,
7432    FiMinusFi,
7433    FrMinusBe,
7434    FrMinusCa,
7435    FrMinusCh,
7436    FrMinusFr,
7437    ItMinusCh,
7438    ItMinusIt,
7439    NbMinusNo,
7440    NlMinusBe,
7441    NlMinusNl,
7442    PlMinusPl,
7443    PtMinusPt,
7444    RoMinusRo,
7445    SvMinusFi,
7446    SvMinusSe,
7447    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7448    Unknown(String),
7449}
7450impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7451    pub fn as_str(&self) -> &str {
7452        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7453        match self {
7454            CsMinusCz => "cs-CZ",
7455            DaMinusDk => "da-DK",
7456            DeMinusAt => "de-AT",
7457            DeMinusCh => "de-CH",
7458            DeMinusDe => "de-DE",
7459            ElMinusGr => "el-GR",
7460            EnMinusAt => "en-AT",
7461            EnMinusAu => "en-AU",
7462            EnMinusBe => "en-BE",
7463            EnMinusCa => "en-CA",
7464            EnMinusCh => "en-CH",
7465            EnMinusCz => "en-CZ",
7466            EnMinusDe => "en-DE",
7467            EnMinusDk => "en-DK",
7468            EnMinusEs => "en-ES",
7469            EnMinusFi => "en-FI",
7470            EnMinusFr => "en-FR",
7471            EnMinusGb => "en-GB",
7472            EnMinusGr => "en-GR",
7473            EnMinusIe => "en-IE",
7474            EnMinusIt => "en-IT",
7475            EnMinusNl => "en-NL",
7476            EnMinusNo => "en-NO",
7477            EnMinusNz => "en-NZ",
7478            EnMinusPl => "en-PL",
7479            EnMinusPt => "en-PT",
7480            EnMinusRo => "en-RO",
7481            EnMinusSe => "en-SE",
7482            EnMinusUs => "en-US",
7483            EsMinusEs => "es-ES",
7484            EsMinusUs => "es-US",
7485            FiMinusFi => "fi-FI",
7486            FrMinusBe => "fr-BE",
7487            FrMinusCa => "fr-CA",
7488            FrMinusCh => "fr-CH",
7489            FrMinusFr => "fr-FR",
7490            ItMinusCh => "it-CH",
7491            ItMinusIt => "it-IT",
7492            NbMinusNo => "nb-NO",
7493            NlMinusBe => "nl-BE",
7494            NlMinusNl => "nl-NL",
7495            PlMinusPl => "pl-PL",
7496            PtMinusPt => "pt-PT",
7497            RoMinusRo => "ro-RO",
7498            SvMinusFi => "sv-FI",
7499            SvMinusSe => "sv-SE",
7500            Unknown(v) => v,
7501        }
7502    }
7503}
7504
7505impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7506    type Err = std::convert::Infallible;
7507    fn from_str(s: &str) -> Result<Self, Self::Err> {
7508        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7509        match s {
7510            "cs-CZ" => Ok(CsMinusCz),
7511            "da-DK" => Ok(DaMinusDk),
7512            "de-AT" => Ok(DeMinusAt),
7513            "de-CH" => Ok(DeMinusCh),
7514            "de-DE" => Ok(DeMinusDe),
7515            "el-GR" => Ok(ElMinusGr),
7516            "en-AT" => Ok(EnMinusAt),
7517            "en-AU" => Ok(EnMinusAu),
7518            "en-BE" => Ok(EnMinusBe),
7519            "en-CA" => Ok(EnMinusCa),
7520            "en-CH" => Ok(EnMinusCh),
7521            "en-CZ" => Ok(EnMinusCz),
7522            "en-DE" => Ok(EnMinusDe),
7523            "en-DK" => Ok(EnMinusDk),
7524            "en-ES" => Ok(EnMinusEs),
7525            "en-FI" => Ok(EnMinusFi),
7526            "en-FR" => Ok(EnMinusFr),
7527            "en-GB" => Ok(EnMinusGb),
7528            "en-GR" => Ok(EnMinusGr),
7529            "en-IE" => Ok(EnMinusIe),
7530            "en-IT" => Ok(EnMinusIt),
7531            "en-NL" => Ok(EnMinusNl),
7532            "en-NO" => Ok(EnMinusNo),
7533            "en-NZ" => Ok(EnMinusNz),
7534            "en-PL" => Ok(EnMinusPl),
7535            "en-PT" => Ok(EnMinusPt),
7536            "en-RO" => Ok(EnMinusRo),
7537            "en-SE" => Ok(EnMinusSe),
7538            "en-US" => Ok(EnMinusUs),
7539            "es-ES" => Ok(EsMinusEs),
7540            "es-US" => Ok(EsMinusUs),
7541            "fi-FI" => Ok(FiMinusFi),
7542            "fr-BE" => Ok(FrMinusBe),
7543            "fr-CA" => Ok(FrMinusCa),
7544            "fr-CH" => Ok(FrMinusCh),
7545            "fr-FR" => Ok(FrMinusFr),
7546            "it-CH" => Ok(ItMinusCh),
7547            "it-IT" => Ok(ItMinusIt),
7548            "nb-NO" => Ok(NbMinusNo),
7549            "nl-BE" => Ok(NlMinusBe),
7550            "nl-NL" => Ok(NlMinusNl),
7551            "pl-PL" => Ok(PlMinusPl),
7552            "pt-PT" => Ok(PtMinusPt),
7553            "ro-RO" => Ok(RoMinusRo),
7554            "sv-FI" => Ok(SvMinusFi),
7555            "sv-SE" => Ok(SvMinusSe),
7556            v => Ok(Unknown(v.to_owned())),
7557        }
7558    }
7559}
7560impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7561    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7562        f.write_str(self.as_str())
7563    }
7564}
7565
7566impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7567    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7568        f.write_str(self.as_str())
7569    }
7570}
7571impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7572    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7573    where
7574        S: serde::Serializer,
7575    {
7576        serializer.serialize_str(self.as_str())
7577    }
7578}
7579#[cfg(feature = "deserialize")]
7580impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7581    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7582        use std::str::FromStr;
7583        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7584        Ok(Self::from_str(&s).unwrap())
7585    }
7586}
7587/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7588///
7589/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7590/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7591///
7592/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7593///
7594/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7595///
7596/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7597#[derive(Copy, Clone, Eq, PartialEq)]
7598pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7599    None,
7600    OffSession,
7601    OnSession,
7602}
7603impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7604    pub fn as_str(self) -> &'static str {
7605        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
7606        match self {
7607            None => "none",
7608            OffSession => "off_session",
7609            OnSession => "on_session",
7610        }
7611    }
7612}
7613
7614impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7615    type Err = stripe_types::StripeParseError;
7616    fn from_str(s: &str) -> Result<Self, Self::Err> {
7617        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
7618        match s {
7619            "none" => Ok(None),
7620            "off_session" => Ok(OffSession),
7621            "on_session" => Ok(OnSession),
7622            _ => Err(stripe_types::StripeParseError),
7623        }
7624    }
7625}
7626impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7628        f.write_str(self.as_str())
7629    }
7630}
7631
7632impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7634        f.write_str(self.as_str())
7635    }
7636}
7637impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7638    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7639    where
7640        S: serde::Serializer,
7641    {
7642        serializer.serialize_str(self.as_str())
7643    }
7644}
7645#[cfg(feature = "deserialize")]
7646impl<'de> serde::Deserialize<'de>
7647    for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
7648{
7649    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7650        use std::str::FromStr;
7651        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7652        Self::from_str(&s).map_err(|_| {
7653            serde::de::Error::custom(
7654                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
7655            )
7656        })
7657    }
7658}
7659/// Subscription details if setting up or charging a subscription.
7660#[derive(Clone, Debug, serde::Serialize)]
7661pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
7662    /// Unit of time between subscription charges.
7663    pub interval: CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
7664    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
7665    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
7666    #[serde(skip_serializing_if = "Option::is_none")]
7667    pub interval_count: Option<u64>,
7668    /// Name for subscription.
7669    #[serde(skip_serializing_if = "Option::is_none")]
7670    pub name: Option<String>,
7671    /// Describes the upcoming charge for this subscription.
7672    #[serde(skip_serializing_if = "Option::is_none")]
7673    pub next_billing: Option<SubscriptionNextBillingParam>,
7674    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
7675    /// Use a value that persists across subscription charges.
7676    pub reference: String,
7677}
7678impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
7679    pub fn new(
7680        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
7681        reference: impl Into<String>,
7682    ) -> Self {
7683        Self {
7684            interval: interval.into(),
7685            interval_count: None,
7686            name: None,
7687            next_billing: None,
7688            reference: reference.into(),
7689        }
7690    }
7691}
7692/// Unit of time between subscription charges.
7693#[derive(Copy, Clone, Eq, PartialEq)]
7694pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7695    Day,
7696    Month,
7697    Week,
7698    Year,
7699}
7700impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7701    pub fn as_str(self) -> &'static str {
7702        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7703        match self {
7704            Day => "day",
7705            Month => "month",
7706            Week => "week",
7707            Year => "year",
7708        }
7709    }
7710}
7711
7712impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7713    type Err = stripe_types::StripeParseError;
7714    fn from_str(s: &str) -> Result<Self, Self::Err> {
7715        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7716        match s {
7717            "day" => Ok(Day),
7718            "month" => Ok(Month),
7719            "week" => Ok(Week),
7720            "year" => Ok(Year),
7721            _ => Err(stripe_types::StripeParseError),
7722        }
7723    }
7724}
7725impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7727        f.write_str(self.as_str())
7728    }
7729}
7730
7731impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7733        f.write_str(self.as_str())
7734    }
7735}
7736impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7737    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7738    where
7739        S: serde::Serializer,
7740    {
7741        serializer.serialize_str(self.as_str())
7742    }
7743}
7744#[cfg(feature = "deserialize")]
7745impl<'de> serde::Deserialize<'de>
7746    for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
7747{
7748    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7749        use std::str::FromStr;
7750        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7751        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
7752    }
7753}
7754/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
7755#[derive(Clone, Debug, serde::Serialize)]
7756pub struct CreatePaymentIntentPaymentMethodOptionsKonbini {
7757    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
7758    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
7759    /// We recommend to use the customer's phone number.
7760    #[serde(skip_serializing_if = "Option::is_none")]
7761    pub confirmation_number: Option<String>,
7762    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
7763    /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST.
7764    /// Defaults to 3 days.
7765    #[serde(skip_serializing_if = "Option::is_none")]
7766    pub expires_after_days: Option<u32>,
7767    /// The timestamp at which the Konbini payment instructions will expire.
7768    /// Only one of `expires_after_days` or `expires_at` may be set.
7769    #[serde(skip_serializing_if = "Option::is_none")]
7770    pub expires_at: Option<stripe_types::Timestamp>,
7771    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
7772    #[serde(skip_serializing_if = "Option::is_none")]
7773    pub product_description: Option<String>,
7774    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7775    ///
7776    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7777    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7778    ///
7779    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7780    ///
7781    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7782    ///
7783    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7784    #[serde(skip_serializing_if = "Option::is_none")]
7785    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
7786}
7787impl CreatePaymentIntentPaymentMethodOptionsKonbini {
7788    pub fn new() -> Self {
7789        Self {
7790            confirmation_number: None,
7791            expires_after_days: None,
7792            expires_at: None,
7793            product_description: None,
7794            setup_future_usage: None,
7795        }
7796    }
7797}
7798impl Default for CreatePaymentIntentPaymentMethodOptionsKonbini {
7799    fn default() -> Self {
7800        Self::new()
7801    }
7802}
7803/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7804///
7805/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7806/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7807///
7808/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7809///
7810/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7811///
7812/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7813#[derive(Copy, Clone, Eq, PartialEq)]
7814pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7815    None,
7816}
7817impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7818    pub fn as_str(self) -> &'static str {
7819        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
7820        match self {
7821            None => "none",
7822        }
7823    }
7824}
7825
7826impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7827    type Err = stripe_types::StripeParseError;
7828    fn from_str(s: &str) -> Result<Self, Self::Err> {
7829        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
7830        match s {
7831            "none" => Ok(None),
7832            _ => Err(stripe_types::StripeParseError),
7833        }
7834    }
7835}
7836impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7837    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7838        f.write_str(self.as_str())
7839    }
7840}
7841
7842impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7843    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7844        f.write_str(self.as_str())
7845    }
7846}
7847impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7848    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7849    where
7850        S: serde::Serializer,
7851    {
7852        serializer.serialize_str(self.as_str())
7853    }
7854}
7855#[cfg(feature = "deserialize")]
7856impl<'de> serde::Deserialize<'de>
7857    for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
7858{
7859    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7860        use std::str::FromStr;
7861        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7862        Self::from_str(&s).map_err(|_| {
7863            serde::de::Error::custom(
7864                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
7865            )
7866        })
7867    }
7868}
7869/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
7870#[derive(Copy, Clone, Debug, serde::Serialize)]
7871pub struct CreatePaymentIntentPaymentMethodOptionsKrCard {
7872    /// Controls when the funds are captured from the customer's account.
7873    ///
7874    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7875    ///
7876    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7877    #[serde(skip_serializing_if = "Option::is_none")]
7878    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
7879    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7880    ///
7881    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7882    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7883    ///
7884    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7885    ///
7886    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7887    #[serde(skip_serializing_if = "Option::is_none")]
7888    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
7889}
7890impl CreatePaymentIntentPaymentMethodOptionsKrCard {
7891    pub fn new() -> Self {
7892        Self { capture_method: None, setup_future_usage: None }
7893    }
7894}
7895impl Default for CreatePaymentIntentPaymentMethodOptionsKrCard {
7896    fn default() -> Self {
7897        Self::new()
7898    }
7899}
7900/// Controls when the funds are captured from the customer's account.
7901///
7902/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7903///
7904/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7905#[derive(Copy, Clone, Eq, PartialEq)]
7906pub enum CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7907    Manual,
7908}
7909impl CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7910    pub fn as_str(self) -> &'static str {
7911        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
7912        match self {
7913            Manual => "manual",
7914        }
7915    }
7916}
7917
7918impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7919    type Err = stripe_types::StripeParseError;
7920    fn from_str(s: &str) -> Result<Self, Self::Err> {
7921        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
7922        match s {
7923            "manual" => Ok(Manual),
7924            _ => Err(stripe_types::StripeParseError),
7925        }
7926    }
7927}
7928impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7930        f.write_str(self.as_str())
7931    }
7932}
7933
7934impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7936        f.write_str(self.as_str())
7937    }
7938}
7939impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7940    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7941    where
7942        S: serde::Serializer,
7943    {
7944        serializer.serialize_str(self.as_str())
7945    }
7946}
7947#[cfg(feature = "deserialize")]
7948impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7949    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7950        use std::str::FromStr;
7951        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7952        Self::from_str(&s).map_err(|_| {
7953            serde::de::Error::custom(
7954                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
7955            )
7956        })
7957    }
7958}
7959/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7960///
7961/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7962/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7963///
7964/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7965///
7966/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7967#[derive(Copy, Clone, Eq, PartialEq)]
7968pub enum CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7969    None,
7970    OffSession,
7971}
7972impl CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7973    pub fn as_str(self) -> &'static str {
7974        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
7975        match self {
7976            None => "none",
7977            OffSession => "off_session",
7978        }
7979    }
7980}
7981
7982impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7983    type Err = stripe_types::StripeParseError;
7984    fn from_str(s: &str) -> Result<Self, Self::Err> {
7985        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
7986        match s {
7987            "none" => Ok(None),
7988            "off_session" => Ok(OffSession),
7989            _ => Err(stripe_types::StripeParseError),
7990        }
7991    }
7992}
7993impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7994    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7995        f.write_str(self.as_str())
7996    }
7997}
7998
7999impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8000    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8001        f.write_str(self.as_str())
8002    }
8003}
8004impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8005    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8006    where
8007        S: serde::Serializer,
8008    {
8009        serializer.serialize_str(self.as_str())
8010    }
8011}
8012#[cfg(feature = "deserialize")]
8013impl<'de> serde::Deserialize<'de>
8014    for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
8015{
8016    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8017        use std::str::FromStr;
8018        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8019        Self::from_str(&s).map_err(|_| {
8020            serde::de::Error::custom(
8021                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
8022            )
8023        })
8024    }
8025}
8026/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
8027#[derive(Clone, Debug, serde::Serialize)]
8028pub struct CreatePaymentIntentPaymentMethodOptionsLink {
8029    /// Controls when the funds are captured from the customer's account.
8030    ///
8031    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8032    ///
8033    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8034    #[serde(skip_serializing_if = "Option::is_none")]
8035    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
8036    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
8037    #[serde(skip_serializing_if = "Option::is_none")]
8038    pub persistent_token: Option<String>,
8039    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8040    ///
8041    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8042    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8043    ///
8044    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8045    ///
8046    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8047    ///
8048    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8049    #[serde(skip_serializing_if = "Option::is_none")]
8050    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
8051}
8052impl CreatePaymentIntentPaymentMethodOptionsLink {
8053    pub fn new() -> Self {
8054        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
8055    }
8056}
8057impl Default for CreatePaymentIntentPaymentMethodOptionsLink {
8058    fn default() -> Self {
8059        Self::new()
8060    }
8061}
8062/// Controls when the funds are captured from the customer's account.
8063///
8064/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8065///
8066/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8067#[derive(Copy, Clone, Eq, PartialEq)]
8068pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8069    Manual,
8070}
8071impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8072    pub fn as_str(self) -> &'static str {
8073        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
8074        match self {
8075            Manual => "manual",
8076        }
8077    }
8078}
8079
8080impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8081    type Err = stripe_types::StripeParseError;
8082    fn from_str(s: &str) -> Result<Self, Self::Err> {
8083        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
8084        match s {
8085            "manual" => Ok(Manual),
8086            _ => Err(stripe_types::StripeParseError),
8087        }
8088    }
8089}
8090impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8091    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8092        f.write_str(self.as_str())
8093    }
8094}
8095
8096impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8097    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8098        f.write_str(self.as_str())
8099    }
8100}
8101impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8102    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8103    where
8104        S: serde::Serializer,
8105    {
8106        serializer.serialize_str(self.as_str())
8107    }
8108}
8109#[cfg(feature = "deserialize")]
8110impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8111    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8112        use std::str::FromStr;
8113        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8114        Self::from_str(&s).map_err(|_| {
8115            serde::de::Error::custom(
8116                "Unknown value for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod",
8117            )
8118        })
8119    }
8120}
8121/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8122///
8123/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8124/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8125///
8126/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8127///
8128/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8129///
8130/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8131#[derive(Copy, Clone, Eq, PartialEq)]
8132pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8133    None,
8134    OffSession,
8135}
8136impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8137    pub fn as_str(self) -> &'static str {
8138        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
8139        match self {
8140            None => "none",
8141            OffSession => "off_session",
8142        }
8143    }
8144}
8145
8146impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8147    type Err = stripe_types::StripeParseError;
8148    fn from_str(s: &str) -> Result<Self, Self::Err> {
8149        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
8150        match s {
8151            "none" => Ok(None),
8152            "off_session" => Ok(OffSession),
8153            _ => Err(stripe_types::StripeParseError),
8154        }
8155    }
8156}
8157impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8158    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8159        f.write_str(self.as_str())
8160    }
8161}
8162
8163impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8165        f.write_str(self.as_str())
8166    }
8167}
8168impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8169    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8170    where
8171        S: serde::Serializer,
8172    {
8173        serializer.serialize_str(self.as_str())
8174    }
8175}
8176#[cfg(feature = "deserialize")]
8177impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8178    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8179        use std::str::FromStr;
8180        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8181        Self::from_str(&s).map_err(|_| {
8182            serde::de::Error::custom(
8183                "Unknown value for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
8184            )
8185        })
8186    }
8187}
8188/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
8189#[derive(Copy, Clone, Debug, serde::Serialize)]
8190pub struct CreatePaymentIntentPaymentMethodOptionsMbWay {
8191    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8192    ///
8193    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8194    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8195    ///
8196    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8197    ///
8198    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8199    ///
8200    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8201    #[serde(skip_serializing_if = "Option::is_none")]
8202    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
8203}
8204impl CreatePaymentIntentPaymentMethodOptionsMbWay {
8205    pub fn new() -> Self {
8206        Self { setup_future_usage: None }
8207    }
8208}
8209impl Default for CreatePaymentIntentPaymentMethodOptionsMbWay {
8210    fn default() -> Self {
8211        Self::new()
8212    }
8213}
8214/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8215///
8216/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8217/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8218///
8219/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8220///
8221/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8222///
8223/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8224#[derive(Copy, Clone, Eq, PartialEq)]
8225pub enum CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8226    None,
8227}
8228impl CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8229    pub fn as_str(self) -> &'static str {
8230        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
8231        match self {
8232            None => "none",
8233        }
8234    }
8235}
8236
8237impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8238    type Err = stripe_types::StripeParseError;
8239    fn from_str(s: &str) -> Result<Self, Self::Err> {
8240        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
8241        match s {
8242            "none" => Ok(None),
8243            _ => Err(stripe_types::StripeParseError),
8244        }
8245    }
8246}
8247impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8248    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8249        f.write_str(self.as_str())
8250    }
8251}
8252
8253impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8254    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8255        f.write_str(self.as_str())
8256    }
8257}
8258impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8259    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8260    where
8261        S: serde::Serializer,
8262    {
8263        serializer.serialize_str(self.as_str())
8264    }
8265}
8266#[cfg(feature = "deserialize")]
8267impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8268    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8269        use std::str::FromStr;
8270        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8271        Self::from_str(&s).map_err(|_| {
8272            serde::de::Error::custom(
8273                "Unknown value for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
8274            )
8275        })
8276    }
8277}
8278/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
8279#[derive(Copy, Clone, Debug, serde::Serialize)]
8280pub struct CreatePaymentIntentPaymentMethodOptionsMobilepay {
8281    /// Controls when the funds are captured from the customer's account.
8282    ///
8283    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8284    ///
8285    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8286    #[serde(skip_serializing_if = "Option::is_none")]
8287    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
8288    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8289    ///
8290    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8291    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8292    ///
8293    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8294    ///
8295    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8296    ///
8297    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8298    #[serde(skip_serializing_if = "Option::is_none")]
8299    pub setup_future_usage:
8300        Option<CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
8301}
8302impl CreatePaymentIntentPaymentMethodOptionsMobilepay {
8303    pub fn new() -> Self {
8304        Self { capture_method: None, setup_future_usage: None }
8305    }
8306}
8307impl Default for CreatePaymentIntentPaymentMethodOptionsMobilepay {
8308    fn default() -> Self {
8309        Self::new()
8310    }
8311}
8312/// Controls when the funds are captured from the customer's account.
8313///
8314/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8315///
8316/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8317#[derive(Copy, Clone, Eq, PartialEq)]
8318pub enum CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8319    Manual,
8320}
8321impl CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8322    pub fn as_str(self) -> &'static str {
8323        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
8324        match self {
8325            Manual => "manual",
8326        }
8327    }
8328}
8329
8330impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8331    type Err = stripe_types::StripeParseError;
8332    fn from_str(s: &str) -> Result<Self, Self::Err> {
8333        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
8334        match s {
8335            "manual" => Ok(Manual),
8336            _ => Err(stripe_types::StripeParseError),
8337        }
8338    }
8339}
8340impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8341    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8342        f.write_str(self.as_str())
8343    }
8344}
8345
8346impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8347    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8348        f.write_str(self.as_str())
8349    }
8350}
8351impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8352    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8353    where
8354        S: serde::Serializer,
8355    {
8356        serializer.serialize_str(self.as_str())
8357    }
8358}
8359#[cfg(feature = "deserialize")]
8360impl<'de> serde::Deserialize<'de>
8361    for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
8362{
8363    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8364        use std::str::FromStr;
8365        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8366        Self::from_str(&s).map_err(|_| {
8367            serde::de::Error::custom(
8368                "Unknown value for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
8369            )
8370        })
8371    }
8372}
8373/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8374///
8375/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8376/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8377///
8378/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8379///
8380/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8381///
8382/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8383#[derive(Copy, Clone, Eq, PartialEq)]
8384pub enum CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8385    None,
8386}
8387impl CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8388    pub fn as_str(self) -> &'static str {
8389        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
8390        match self {
8391            None => "none",
8392        }
8393    }
8394}
8395
8396impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8397    type Err = stripe_types::StripeParseError;
8398    fn from_str(s: &str) -> Result<Self, Self::Err> {
8399        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
8400        match s {
8401            "none" => Ok(None),
8402            _ => Err(stripe_types::StripeParseError),
8403        }
8404    }
8405}
8406impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8407    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8408        f.write_str(self.as_str())
8409    }
8410}
8411
8412impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8413    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8414        f.write_str(self.as_str())
8415    }
8416}
8417impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8418    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8419    where
8420        S: serde::Serializer,
8421    {
8422        serializer.serialize_str(self.as_str())
8423    }
8424}
8425#[cfg(feature = "deserialize")]
8426impl<'de> serde::Deserialize<'de>
8427    for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
8428{
8429    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8430        use std::str::FromStr;
8431        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8432        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
8433    }
8434}
8435/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
8436#[derive(Copy, Clone, Debug, serde::Serialize)]
8437pub struct CreatePaymentIntentPaymentMethodOptionsMultibanco {
8438    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8439    ///
8440    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8441    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8442    ///
8443    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8444    ///
8445    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8446    ///
8447    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8448    #[serde(skip_serializing_if = "Option::is_none")]
8449    pub setup_future_usage:
8450        Option<CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
8451}
8452impl CreatePaymentIntentPaymentMethodOptionsMultibanco {
8453    pub fn new() -> Self {
8454        Self { setup_future_usage: None }
8455    }
8456}
8457impl Default for CreatePaymentIntentPaymentMethodOptionsMultibanco {
8458    fn default() -> Self {
8459        Self::new()
8460    }
8461}
8462/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8463///
8464/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8465/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8466///
8467/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8468///
8469/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8470///
8471/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8472#[derive(Copy, Clone, Eq, PartialEq)]
8473pub enum CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8474    None,
8475}
8476impl CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8477    pub fn as_str(self) -> &'static str {
8478        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
8479        match self {
8480            None => "none",
8481        }
8482    }
8483}
8484
8485impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8486    type Err = stripe_types::StripeParseError;
8487    fn from_str(s: &str) -> Result<Self, Self::Err> {
8488        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
8489        match s {
8490            "none" => Ok(None),
8491            _ => Err(stripe_types::StripeParseError),
8492        }
8493    }
8494}
8495impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8496    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8497        f.write_str(self.as_str())
8498    }
8499}
8500
8501impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8502    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8503        f.write_str(self.as_str())
8504    }
8505}
8506impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8507    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8508    where
8509        S: serde::Serializer,
8510    {
8511        serializer.serialize_str(self.as_str())
8512    }
8513}
8514#[cfg(feature = "deserialize")]
8515impl<'de> serde::Deserialize<'de>
8516    for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
8517{
8518    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8519        use std::str::FromStr;
8520        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8521        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
8522    }
8523}
8524/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
8525#[derive(Copy, Clone, Debug, serde::Serialize)]
8526pub struct CreatePaymentIntentPaymentMethodOptionsNaverPay {
8527    /// Controls when the funds are captured from the customer's account.
8528    ///
8529    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8530    ///
8531    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8532    #[serde(skip_serializing_if = "Option::is_none")]
8533    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
8534    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8535    ///
8536    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8537    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8538    ///
8539    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8540    ///
8541    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8542    #[serde(skip_serializing_if = "Option::is_none")]
8543    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
8544}
8545impl CreatePaymentIntentPaymentMethodOptionsNaverPay {
8546    pub fn new() -> Self {
8547        Self { capture_method: None, setup_future_usage: None }
8548    }
8549}
8550impl Default for CreatePaymentIntentPaymentMethodOptionsNaverPay {
8551    fn default() -> Self {
8552        Self::new()
8553    }
8554}
8555/// Controls when the funds are captured from the customer's account.
8556///
8557/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8558///
8559/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8560#[derive(Copy, Clone, Eq, PartialEq)]
8561pub enum CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8562    Manual,
8563}
8564impl CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8565    pub fn as_str(self) -> &'static str {
8566        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
8567        match self {
8568            Manual => "manual",
8569        }
8570    }
8571}
8572
8573impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8574    type Err = stripe_types::StripeParseError;
8575    fn from_str(s: &str) -> Result<Self, Self::Err> {
8576        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
8577        match s {
8578            "manual" => Ok(Manual),
8579            _ => Err(stripe_types::StripeParseError),
8580        }
8581    }
8582}
8583impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8584    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8585        f.write_str(self.as_str())
8586    }
8587}
8588
8589impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8590    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8591        f.write_str(self.as_str())
8592    }
8593}
8594impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8595    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8596    where
8597        S: serde::Serializer,
8598    {
8599        serializer.serialize_str(self.as_str())
8600    }
8601}
8602#[cfg(feature = "deserialize")]
8603impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8604    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8605        use std::str::FromStr;
8606        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8607        Self::from_str(&s).map_err(|_| {
8608            serde::de::Error::custom(
8609                "Unknown value for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
8610            )
8611        })
8612    }
8613}
8614/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8615///
8616/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8617/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8618///
8619/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8620///
8621/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8622#[derive(Copy, Clone, Eq, PartialEq)]
8623pub enum CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8624    None,
8625    OffSession,
8626}
8627impl CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8628    pub fn as_str(self) -> &'static str {
8629        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
8630        match self {
8631            None => "none",
8632            OffSession => "off_session",
8633        }
8634    }
8635}
8636
8637impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8638    type Err = stripe_types::StripeParseError;
8639    fn from_str(s: &str) -> Result<Self, Self::Err> {
8640        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
8641        match s {
8642            "none" => Ok(None),
8643            "off_session" => Ok(OffSession),
8644            _ => Err(stripe_types::StripeParseError),
8645        }
8646    }
8647}
8648impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8649    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8650        f.write_str(self.as_str())
8651    }
8652}
8653
8654impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8656        f.write_str(self.as_str())
8657    }
8658}
8659impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8660    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8661    where
8662        S: serde::Serializer,
8663    {
8664        serializer.serialize_str(self.as_str())
8665    }
8666}
8667#[cfg(feature = "deserialize")]
8668impl<'de> serde::Deserialize<'de>
8669    for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
8670{
8671    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8672        use std::str::FromStr;
8673        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8674        Self::from_str(&s).map_err(|_| {
8675            serde::de::Error::custom(
8676                "Unknown value for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage",
8677            )
8678        })
8679    }
8680}
8681/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
8682#[derive(Clone, Debug, serde::Serialize)]
8683pub struct CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8684    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8685    ///
8686    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8687    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8688    ///
8689    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8690    ///
8691    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8692    ///
8693    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8694    #[serde(skip_serializing_if = "Option::is_none")]
8695    pub setup_future_usage:
8696        Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
8697    /// Controls when Stripe will attempt to debit the funds from the customer's account.
8698    /// The date must be a string in YYYY-MM-DD format.
8699    /// The date must be in the future and between 3 and 15 calendar days from now.
8700    #[serde(skip_serializing_if = "Option::is_none")]
8701    pub target_date: Option<String>,
8702}
8703impl CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8704    pub fn new() -> Self {
8705        Self { setup_future_usage: None, target_date: None }
8706    }
8707}
8708impl Default for CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8709    fn default() -> Self {
8710        Self::new()
8711    }
8712}
8713/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8714///
8715/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8716/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8717///
8718/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8719///
8720/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8721///
8722/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8723#[derive(Copy, Clone, Eq, PartialEq)]
8724pub enum CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8725    None,
8726    OffSession,
8727    OnSession,
8728}
8729impl CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8730    pub fn as_str(self) -> &'static str {
8731        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
8732        match self {
8733            None => "none",
8734            OffSession => "off_session",
8735            OnSession => "on_session",
8736        }
8737    }
8738}
8739
8740impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8741    type Err = stripe_types::StripeParseError;
8742    fn from_str(s: &str) -> Result<Self, Self::Err> {
8743        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
8744        match s {
8745            "none" => Ok(None),
8746            "off_session" => Ok(OffSession),
8747            "on_session" => Ok(OnSession),
8748            _ => Err(stripe_types::StripeParseError),
8749        }
8750    }
8751}
8752impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8753    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8754        f.write_str(self.as_str())
8755    }
8756}
8757
8758impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8759    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8760        f.write_str(self.as_str())
8761    }
8762}
8763impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8764    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8765    where
8766        S: serde::Serializer,
8767    {
8768        serializer.serialize_str(self.as_str())
8769    }
8770}
8771#[cfg(feature = "deserialize")]
8772impl<'de> serde::Deserialize<'de>
8773    for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
8774{
8775    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8776        use std::str::FromStr;
8777        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8778        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
8779    }
8780}
8781/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
8782#[derive(Copy, Clone, Debug, serde::Serialize)]
8783pub struct CreatePaymentIntentPaymentMethodOptionsOxxo {
8784    /// The number of calendar days before an OXXO voucher expires.
8785    /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
8786    #[serde(skip_serializing_if = "Option::is_none")]
8787    pub expires_after_days: Option<u32>,
8788    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8789    ///
8790    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8791    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8792    ///
8793    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8794    ///
8795    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8796    ///
8797    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8798    #[serde(skip_serializing_if = "Option::is_none")]
8799    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
8800}
8801impl CreatePaymentIntentPaymentMethodOptionsOxxo {
8802    pub fn new() -> Self {
8803        Self { expires_after_days: None, setup_future_usage: None }
8804    }
8805}
8806impl Default for CreatePaymentIntentPaymentMethodOptionsOxxo {
8807    fn default() -> Self {
8808        Self::new()
8809    }
8810}
8811/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8812///
8813/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8814/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8815///
8816/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8817///
8818/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8819///
8820/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8821#[derive(Copy, Clone, Eq, PartialEq)]
8822pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8823    None,
8824}
8825impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8826    pub fn as_str(self) -> &'static str {
8827        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
8828        match self {
8829            None => "none",
8830        }
8831    }
8832}
8833
8834impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8835    type Err = stripe_types::StripeParseError;
8836    fn from_str(s: &str) -> Result<Self, Self::Err> {
8837        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
8838        match s {
8839            "none" => Ok(None),
8840            _ => Err(stripe_types::StripeParseError),
8841        }
8842    }
8843}
8844impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8846        f.write_str(self.as_str())
8847    }
8848}
8849
8850impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8852        f.write_str(self.as_str())
8853    }
8854}
8855impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8856    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8857    where
8858        S: serde::Serializer,
8859    {
8860        serializer.serialize_str(self.as_str())
8861    }
8862}
8863#[cfg(feature = "deserialize")]
8864impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8865    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8866        use std::str::FromStr;
8867        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8868        Self::from_str(&s).map_err(|_| {
8869            serde::de::Error::custom(
8870                "Unknown value for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
8871            )
8872        })
8873    }
8874}
8875/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
8876#[derive(Copy, Clone, Debug, serde::Serialize)]
8877pub struct CreatePaymentIntentPaymentMethodOptionsP24 {
8878    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8879    ///
8880    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8881    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8882    ///
8883    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8884    ///
8885    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8886    ///
8887    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8888    #[serde(skip_serializing_if = "Option::is_none")]
8889    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
8890    /// Confirm that the payer has accepted the P24 terms and conditions.
8891    #[serde(skip_serializing_if = "Option::is_none")]
8892    pub tos_shown_and_accepted: Option<bool>,
8893}
8894impl CreatePaymentIntentPaymentMethodOptionsP24 {
8895    pub fn new() -> Self {
8896        Self { setup_future_usage: None, tos_shown_and_accepted: None }
8897    }
8898}
8899impl Default for CreatePaymentIntentPaymentMethodOptionsP24 {
8900    fn default() -> Self {
8901        Self::new()
8902    }
8903}
8904/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8905///
8906/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8907/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8908///
8909/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8910///
8911/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8912///
8913/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8914#[derive(Copy, Clone, Eq, PartialEq)]
8915pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8916    None,
8917}
8918impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8919    pub fn as_str(self) -> &'static str {
8920        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
8921        match self {
8922            None => "none",
8923        }
8924    }
8925}
8926
8927impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8928    type Err = stripe_types::StripeParseError;
8929    fn from_str(s: &str) -> Result<Self, Self::Err> {
8930        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
8931        match s {
8932            "none" => Ok(None),
8933            _ => Err(stripe_types::StripeParseError),
8934        }
8935    }
8936}
8937impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8938    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8939        f.write_str(self.as_str())
8940    }
8941}
8942
8943impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8944    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8945        f.write_str(self.as_str())
8946    }
8947}
8948impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8949    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8950    where
8951        S: serde::Serializer,
8952    {
8953        serializer.serialize_str(self.as_str())
8954    }
8955}
8956#[cfg(feature = "deserialize")]
8957impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8958    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8959        use std::str::FromStr;
8960        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8961        Self::from_str(&s).map_err(|_| {
8962            serde::de::Error::custom(
8963                "Unknown value for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
8964            )
8965        })
8966    }
8967}
8968/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
8969#[derive(Copy, Clone, Debug, serde::Serialize)]
8970pub struct CreatePaymentIntentPaymentMethodOptionsPayco {
8971    /// Controls when the funds are captured from the customer's account.
8972    ///
8973    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8974    ///
8975    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8976    #[serde(skip_serializing_if = "Option::is_none")]
8977    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
8978}
8979impl CreatePaymentIntentPaymentMethodOptionsPayco {
8980    pub fn new() -> Self {
8981        Self { capture_method: None }
8982    }
8983}
8984impl Default for CreatePaymentIntentPaymentMethodOptionsPayco {
8985    fn default() -> Self {
8986        Self::new()
8987    }
8988}
8989/// Controls when the funds are captured from the customer's account.
8990///
8991/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
8992///
8993/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
8994#[derive(Copy, Clone, Eq, PartialEq)]
8995pub enum CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8996    Manual,
8997}
8998impl CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8999    pub fn as_str(self) -> &'static str {
9000        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
9001        match self {
9002            Manual => "manual",
9003        }
9004    }
9005}
9006
9007impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9008    type Err = stripe_types::StripeParseError;
9009    fn from_str(s: &str) -> Result<Self, Self::Err> {
9010        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
9011        match s {
9012            "manual" => Ok(Manual),
9013            _ => Err(stripe_types::StripeParseError),
9014        }
9015    }
9016}
9017impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9018    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9019        f.write_str(self.as_str())
9020    }
9021}
9022
9023impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9024    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9025        f.write_str(self.as_str())
9026    }
9027}
9028impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9029    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9030    where
9031        S: serde::Serializer,
9032    {
9033        serializer.serialize_str(self.as_str())
9034    }
9035}
9036#[cfg(feature = "deserialize")]
9037impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9038    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9039        use std::str::FromStr;
9040        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9041        Self::from_str(&s).map_err(|_| {
9042            serde::de::Error::custom(
9043                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
9044            )
9045        })
9046    }
9047}
9048/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
9049#[derive(Copy, Clone, Debug, serde::Serialize)]
9050pub struct CreatePaymentIntentPaymentMethodOptionsPaynow {
9051    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9052    ///
9053    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9054    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9055    ///
9056    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9057    ///
9058    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9059    ///
9060    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9061    #[serde(skip_serializing_if = "Option::is_none")]
9062    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
9063}
9064impl CreatePaymentIntentPaymentMethodOptionsPaynow {
9065    pub fn new() -> Self {
9066        Self { setup_future_usage: None }
9067    }
9068}
9069impl Default for CreatePaymentIntentPaymentMethodOptionsPaynow {
9070    fn default() -> Self {
9071        Self::new()
9072    }
9073}
9074/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9075///
9076/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9077/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9078///
9079/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9080///
9081/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9082///
9083/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9084#[derive(Copy, Clone, Eq, PartialEq)]
9085pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9086    None,
9087}
9088impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9089    pub fn as_str(self) -> &'static str {
9090        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
9091        match self {
9092            None => "none",
9093        }
9094    }
9095}
9096
9097impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9098    type Err = stripe_types::StripeParseError;
9099    fn from_str(s: &str) -> Result<Self, Self::Err> {
9100        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
9101        match s {
9102            "none" => Ok(None),
9103            _ => Err(stripe_types::StripeParseError),
9104        }
9105    }
9106}
9107impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9108    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9109        f.write_str(self.as_str())
9110    }
9111}
9112
9113impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9114    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9115        f.write_str(self.as_str())
9116    }
9117}
9118impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9119    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9120    where
9121        S: serde::Serializer,
9122    {
9123        serializer.serialize_str(self.as_str())
9124    }
9125}
9126#[cfg(feature = "deserialize")]
9127impl<'de> serde::Deserialize<'de>
9128    for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
9129{
9130    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9131        use std::str::FromStr;
9132        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9133        Self::from_str(&s).map_err(|_| {
9134            serde::de::Error::custom(
9135                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
9136            )
9137        })
9138    }
9139}
9140/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
9141#[derive(Clone, Debug, serde::Serialize)]
9142pub struct CreatePaymentIntentPaymentMethodOptionsPaypal {
9143    /// Controls when the funds will be captured from the customer's account.
9144    #[serde(skip_serializing_if = "Option::is_none")]
9145    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
9146    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
9147    #[serde(skip_serializing_if = "Option::is_none")]
9148    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
9149    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
9150    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
9151    #[serde(skip_serializing_if = "Option::is_none")]
9152    pub reference: Option<String>,
9153    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
9154    #[serde(skip_serializing_if = "Option::is_none")]
9155    pub risk_correlation_id: Option<String>,
9156    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9157    ///
9158    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9159    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9160    ///
9161    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9162    ///
9163    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9164    ///
9165    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9166    #[serde(skip_serializing_if = "Option::is_none")]
9167    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
9168}
9169impl CreatePaymentIntentPaymentMethodOptionsPaypal {
9170    pub fn new() -> Self {
9171        Self {
9172            capture_method: None,
9173            preferred_locale: None,
9174            reference: None,
9175            risk_correlation_id: None,
9176            setup_future_usage: None,
9177        }
9178    }
9179}
9180impl Default for CreatePaymentIntentPaymentMethodOptionsPaypal {
9181    fn default() -> Self {
9182        Self::new()
9183    }
9184}
9185/// Controls when the funds will be captured from the customer's account.
9186#[derive(Copy, Clone, Eq, PartialEq)]
9187pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9188    Manual,
9189}
9190impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9191    pub fn as_str(self) -> &'static str {
9192        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
9193        match self {
9194            Manual => "manual",
9195        }
9196    }
9197}
9198
9199impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9200    type Err = stripe_types::StripeParseError;
9201    fn from_str(s: &str) -> Result<Self, Self::Err> {
9202        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
9203        match s {
9204            "manual" => Ok(Manual),
9205            _ => Err(stripe_types::StripeParseError),
9206        }
9207    }
9208}
9209impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9210    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9211        f.write_str(self.as_str())
9212    }
9213}
9214
9215impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9216    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9217        f.write_str(self.as_str())
9218    }
9219}
9220impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9221    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9222    where
9223        S: serde::Serializer,
9224    {
9225        serializer.serialize_str(self.as_str())
9226    }
9227}
9228#[cfg(feature = "deserialize")]
9229impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9230    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9231        use std::str::FromStr;
9232        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9233        Self::from_str(&s).map_err(|_| {
9234            serde::de::Error::custom(
9235                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
9236            )
9237        })
9238    }
9239}
9240/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
9241#[derive(Clone, Eq, PartialEq)]
9242#[non_exhaustive]
9243pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9244    CsMinusCz,
9245    DaMinusDk,
9246    DeMinusAt,
9247    DeMinusDe,
9248    DeMinusLu,
9249    ElMinusGr,
9250    EnMinusGb,
9251    EnMinusUs,
9252    EsMinusEs,
9253    FiMinusFi,
9254    FrMinusBe,
9255    FrMinusFr,
9256    FrMinusLu,
9257    HuMinusHu,
9258    ItMinusIt,
9259    NlMinusBe,
9260    NlMinusNl,
9261    PlMinusPl,
9262    PtMinusPt,
9263    SkMinusSk,
9264    SvMinusSe,
9265    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9266    Unknown(String),
9267}
9268impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9269    pub fn as_str(&self) -> &str {
9270        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
9271        match self {
9272            CsMinusCz => "cs-CZ",
9273            DaMinusDk => "da-DK",
9274            DeMinusAt => "de-AT",
9275            DeMinusDe => "de-DE",
9276            DeMinusLu => "de-LU",
9277            ElMinusGr => "el-GR",
9278            EnMinusGb => "en-GB",
9279            EnMinusUs => "en-US",
9280            EsMinusEs => "es-ES",
9281            FiMinusFi => "fi-FI",
9282            FrMinusBe => "fr-BE",
9283            FrMinusFr => "fr-FR",
9284            FrMinusLu => "fr-LU",
9285            HuMinusHu => "hu-HU",
9286            ItMinusIt => "it-IT",
9287            NlMinusBe => "nl-BE",
9288            NlMinusNl => "nl-NL",
9289            PlMinusPl => "pl-PL",
9290            PtMinusPt => "pt-PT",
9291            SkMinusSk => "sk-SK",
9292            SvMinusSe => "sv-SE",
9293            Unknown(v) => v,
9294        }
9295    }
9296}
9297
9298impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9299    type Err = std::convert::Infallible;
9300    fn from_str(s: &str) -> Result<Self, Self::Err> {
9301        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
9302        match s {
9303            "cs-CZ" => Ok(CsMinusCz),
9304            "da-DK" => Ok(DaMinusDk),
9305            "de-AT" => Ok(DeMinusAt),
9306            "de-DE" => Ok(DeMinusDe),
9307            "de-LU" => Ok(DeMinusLu),
9308            "el-GR" => Ok(ElMinusGr),
9309            "en-GB" => Ok(EnMinusGb),
9310            "en-US" => Ok(EnMinusUs),
9311            "es-ES" => Ok(EsMinusEs),
9312            "fi-FI" => Ok(FiMinusFi),
9313            "fr-BE" => Ok(FrMinusBe),
9314            "fr-FR" => Ok(FrMinusFr),
9315            "fr-LU" => Ok(FrMinusLu),
9316            "hu-HU" => Ok(HuMinusHu),
9317            "it-IT" => Ok(ItMinusIt),
9318            "nl-BE" => Ok(NlMinusBe),
9319            "nl-NL" => Ok(NlMinusNl),
9320            "pl-PL" => Ok(PlMinusPl),
9321            "pt-PT" => Ok(PtMinusPt),
9322            "sk-SK" => Ok(SkMinusSk),
9323            "sv-SE" => Ok(SvMinusSe),
9324            v => Ok(Unknown(v.to_owned())),
9325        }
9326    }
9327}
9328impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
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 CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
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 CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
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 CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
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        Ok(Self::from_str(&s).unwrap())
9353    }
9354}
9355/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9356///
9357/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9358/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9359///
9360/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9361///
9362/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9363///
9364/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9365#[derive(Copy, Clone, Eq, PartialEq)]
9366pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9367    None,
9368    OffSession,
9369}
9370impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9371    pub fn as_str(self) -> &'static str {
9372        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
9373        match self {
9374            None => "none",
9375            OffSession => "off_session",
9376        }
9377    }
9378}
9379
9380impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9381    type Err = stripe_types::StripeParseError;
9382    fn from_str(s: &str) -> Result<Self, Self::Err> {
9383        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
9384        match s {
9385            "none" => Ok(None),
9386            "off_session" => Ok(OffSession),
9387            _ => Err(stripe_types::StripeParseError),
9388        }
9389    }
9390}
9391impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9392    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9393        f.write_str(self.as_str())
9394    }
9395}
9396
9397impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9398    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9399        f.write_str(self.as_str())
9400    }
9401}
9402impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9403    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9404    where
9405        S: serde::Serializer,
9406    {
9407        serializer.serialize_str(self.as_str())
9408    }
9409}
9410#[cfg(feature = "deserialize")]
9411impl<'de> serde::Deserialize<'de>
9412    for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
9413{
9414    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9415        use std::str::FromStr;
9416        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9417        Self::from_str(&s).map_err(|_| {
9418            serde::de::Error::custom(
9419                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
9420            )
9421        })
9422    }
9423}
9424/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
9425#[derive(Copy, Clone, Debug, serde::Serialize)]
9426pub struct CreatePaymentIntentPaymentMethodOptionsPix {
9427    /// Determines if the amount includes the IOF tax. Defaults to `never`.
9428    #[serde(skip_serializing_if = "Option::is_none")]
9429    pub amount_includes_iof: Option<CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
9430    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
9431    /// Defaults to 86400 seconds.
9432    #[serde(skip_serializing_if = "Option::is_none")]
9433    pub expires_after_seconds: Option<i64>,
9434    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
9435    /// Defaults to 1 day in the future.
9436    #[serde(skip_serializing_if = "Option::is_none")]
9437    pub expires_at: Option<stripe_types::Timestamp>,
9438    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9439    ///
9440    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9441    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9442    ///
9443    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9444    ///
9445    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9446    ///
9447    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9448    #[serde(skip_serializing_if = "Option::is_none")]
9449    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
9450}
9451impl CreatePaymentIntentPaymentMethodOptionsPix {
9452    pub fn new() -> Self {
9453        Self {
9454            amount_includes_iof: None,
9455            expires_after_seconds: None,
9456            expires_at: None,
9457            setup_future_usage: None,
9458        }
9459    }
9460}
9461impl Default for CreatePaymentIntentPaymentMethodOptionsPix {
9462    fn default() -> Self {
9463        Self::new()
9464    }
9465}
9466/// Determines if the amount includes the IOF tax. Defaults to `never`.
9467#[derive(Copy, Clone, Eq, PartialEq)]
9468pub enum CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9469    Always,
9470    Never,
9471}
9472impl CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9473    pub fn as_str(self) -> &'static str {
9474        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
9475        match self {
9476            Always => "always",
9477            Never => "never",
9478        }
9479    }
9480}
9481
9482impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9483    type Err = stripe_types::StripeParseError;
9484    fn from_str(s: &str) -> Result<Self, Self::Err> {
9485        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
9486        match s {
9487            "always" => Ok(Always),
9488            "never" => Ok(Never),
9489            _ => Err(stripe_types::StripeParseError),
9490        }
9491    }
9492}
9493impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9494    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9495        f.write_str(self.as_str())
9496    }
9497}
9498
9499impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9500    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9501        f.write_str(self.as_str())
9502    }
9503}
9504impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9505    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9506    where
9507        S: serde::Serializer,
9508    {
9509        serializer.serialize_str(self.as_str())
9510    }
9511}
9512#[cfg(feature = "deserialize")]
9513impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9514    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9515        use std::str::FromStr;
9516        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9517        Self::from_str(&s).map_err(|_| {
9518            serde::de::Error::custom(
9519                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
9520            )
9521        })
9522    }
9523}
9524/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9525///
9526/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9527/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9528///
9529/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9530///
9531/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9532///
9533/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9534#[derive(Copy, Clone, Eq, PartialEq)]
9535pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9536    None,
9537}
9538impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9539    pub fn as_str(self) -> &'static str {
9540        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
9541        match self {
9542            None => "none",
9543        }
9544    }
9545}
9546
9547impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9548    type Err = stripe_types::StripeParseError;
9549    fn from_str(s: &str) -> Result<Self, Self::Err> {
9550        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
9551        match s {
9552            "none" => Ok(None),
9553            _ => Err(stripe_types::StripeParseError),
9554        }
9555    }
9556}
9557impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9558    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9559        f.write_str(self.as_str())
9560    }
9561}
9562
9563impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9564    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9565        f.write_str(self.as_str())
9566    }
9567}
9568impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9569    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9570    where
9571        S: serde::Serializer,
9572    {
9573        serializer.serialize_str(self.as_str())
9574    }
9575}
9576#[cfg(feature = "deserialize")]
9577impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9578    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9579        use std::str::FromStr;
9580        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9581        Self::from_str(&s).map_err(|_| {
9582            serde::de::Error::custom(
9583                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
9584            )
9585        })
9586    }
9587}
9588/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
9589#[derive(Copy, Clone, Debug, serde::Serialize)]
9590pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay {
9591    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9592    ///
9593    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9594    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9595    ///
9596    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9597    ///
9598    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9599    ///
9600    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9601    #[serde(skip_serializing_if = "Option::is_none")]
9602    pub setup_future_usage:
9603        Option<CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
9604}
9605impl CreatePaymentIntentPaymentMethodOptionsPromptpay {
9606    pub fn new() -> Self {
9607        Self { setup_future_usage: None }
9608    }
9609}
9610impl Default for CreatePaymentIntentPaymentMethodOptionsPromptpay {
9611    fn default() -> Self {
9612        Self::new()
9613    }
9614}
9615/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9616///
9617/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9618/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9619///
9620/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9621///
9622/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9623///
9624/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9625#[derive(Copy, Clone, Eq, PartialEq)]
9626pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9627    None,
9628}
9629impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9630    pub fn as_str(self) -> &'static str {
9631        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
9632        match self {
9633            None => "none",
9634        }
9635    }
9636}
9637
9638impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9639    type Err = stripe_types::StripeParseError;
9640    fn from_str(s: &str) -> Result<Self, Self::Err> {
9641        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
9642        match s {
9643            "none" => Ok(None),
9644            _ => Err(stripe_types::StripeParseError),
9645        }
9646    }
9647}
9648impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9649    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9650        f.write_str(self.as_str())
9651    }
9652}
9653
9654impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9656        f.write_str(self.as_str())
9657    }
9658}
9659impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9660    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9661    where
9662        S: serde::Serializer,
9663    {
9664        serializer.serialize_str(self.as_str())
9665    }
9666}
9667#[cfg(feature = "deserialize")]
9668impl<'de> serde::Deserialize<'de>
9669    for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
9670{
9671    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9672        use std::str::FromStr;
9673        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9674        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
9675    }
9676}
9677/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
9678#[derive(Copy, Clone, Debug, serde::Serialize)]
9679pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9680    /// Controls when the funds are captured from the customer's account.
9681    ///
9682    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9683    ///
9684    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9685    #[serde(skip_serializing_if = "Option::is_none")]
9686    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
9687    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9688    ///
9689    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9690    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9691    ///
9692    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9693    ///
9694    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9695    #[serde(skip_serializing_if = "Option::is_none")]
9696    pub setup_future_usage:
9697        Option<CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
9698}
9699impl CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9700    pub fn new() -> Self {
9701        Self { capture_method: None, setup_future_usage: None }
9702    }
9703}
9704impl Default for CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9705    fn default() -> Self {
9706        Self::new()
9707    }
9708}
9709/// Controls when the funds are captured from the customer's account.
9710///
9711/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9712///
9713/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9714#[derive(Copy, Clone, Eq, PartialEq)]
9715pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9716    Manual,
9717}
9718impl CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9719    pub fn as_str(self) -> &'static str {
9720        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
9721        match self {
9722            Manual => "manual",
9723        }
9724    }
9725}
9726
9727impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9728    type Err = stripe_types::StripeParseError;
9729    fn from_str(s: &str) -> Result<Self, Self::Err> {
9730        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
9731        match s {
9732            "manual" => Ok(Manual),
9733            _ => Err(stripe_types::StripeParseError),
9734        }
9735    }
9736}
9737impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9738    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9739        f.write_str(self.as_str())
9740    }
9741}
9742
9743impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9744    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9745        f.write_str(self.as_str())
9746    }
9747}
9748impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9749    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9750    where
9751        S: serde::Serializer,
9752    {
9753        serializer.serialize_str(self.as_str())
9754    }
9755}
9756#[cfg(feature = "deserialize")]
9757impl<'de> serde::Deserialize<'de>
9758    for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
9759{
9760    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9761        use std::str::FromStr;
9762        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9763        Self::from_str(&s).map_err(|_| {
9764            serde::de::Error::custom(
9765                "Unknown value for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
9766            )
9767        })
9768    }
9769}
9770/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9771///
9772/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9773/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9774///
9775/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9776///
9777/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9778#[derive(Copy, Clone, Eq, PartialEq)]
9779pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9780    None,
9781    OffSession,
9782}
9783impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9784    pub fn as_str(self) -> &'static str {
9785        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
9786        match self {
9787            None => "none",
9788            OffSession => "off_session",
9789        }
9790    }
9791}
9792
9793impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9794    type Err = stripe_types::StripeParseError;
9795    fn from_str(s: &str) -> Result<Self, Self::Err> {
9796        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
9797        match s {
9798            "none" => Ok(None),
9799            "off_session" => Ok(OffSession),
9800            _ => Err(stripe_types::StripeParseError),
9801        }
9802    }
9803}
9804impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9806        f.write_str(self.as_str())
9807    }
9808}
9809
9810impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9812        f.write_str(self.as_str())
9813    }
9814}
9815impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9817    where
9818        S: serde::Serializer,
9819    {
9820        serializer.serialize_str(self.as_str())
9821    }
9822}
9823#[cfg(feature = "deserialize")]
9824impl<'de> serde::Deserialize<'de>
9825    for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
9826{
9827    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9828        use std::str::FromStr;
9829        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9830        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
9831    }
9832}
9833/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
9834#[derive(Copy, Clone, Debug, serde::Serialize)]
9835pub struct CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9836    /// Controls when the funds are captured from the customer's account.
9837    ///
9838    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9839    ///
9840    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9841    #[serde(skip_serializing_if = "Option::is_none")]
9842    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
9843}
9844impl CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9845    pub fn new() -> Self {
9846        Self { capture_method: None }
9847    }
9848}
9849impl Default for CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9850    fn default() -> Self {
9851        Self::new()
9852    }
9853}
9854/// Controls when the funds are captured from the customer's account.
9855///
9856/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9857///
9858/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9859#[derive(Copy, Clone, Eq, PartialEq)]
9860pub enum CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9861    Manual,
9862}
9863impl CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9864    pub fn as_str(self) -> &'static str {
9865        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
9866        match self {
9867            Manual => "manual",
9868        }
9869    }
9870}
9871
9872impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9873    type Err = stripe_types::StripeParseError;
9874    fn from_str(s: &str) -> Result<Self, Self::Err> {
9875        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
9876        match s {
9877            "manual" => Ok(Manual),
9878            _ => Err(stripe_types::StripeParseError),
9879        }
9880    }
9881}
9882impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9883    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9884        f.write_str(self.as_str())
9885    }
9886}
9887
9888impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9889    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9890        f.write_str(self.as_str())
9891    }
9892}
9893impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9894    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9895    where
9896        S: serde::Serializer,
9897    {
9898        serializer.serialize_str(self.as_str())
9899    }
9900}
9901#[cfg(feature = "deserialize")]
9902impl<'de> serde::Deserialize<'de>
9903    for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
9904{
9905    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9906        use std::str::FromStr;
9907        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9908        Self::from_str(&s).map_err(|_| {
9909            serde::de::Error::custom(
9910                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
9911            )
9912        })
9913    }
9914}
9915/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
9916#[derive(Copy, Clone, Debug, serde::Serialize)]
9917pub struct CreatePaymentIntentPaymentMethodOptionsSatispay {
9918    /// Controls when the funds are captured from the customer's account.
9919    ///
9920    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9921    ///
9922    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9923    #[serde(skip_serializing_if = "Option::is_none")]
9924    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
9925}
9926impl CreatePaymentIntentPaymentMethodOptionsSatispay {
9927    pub fn new() -> Self {
9928        Self { capture_method: None }
9929    }
9930}
9931impl Default for CreatePaymentIntentPaymentMethodOptionsSatispay {
9932    fn default() -> Self {
9933        Self::new()
9934    }
9935}
9936/// Controls when the funds are captured from the customer's account.
9937///
9938/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
9939///
9940/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
9941#[derive(Copy, Clone, Eq, PartialEq)]
9942pub enum CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9943    Manual,
9944}
9945impl CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9946    pub fn as_str(self) -> &'static str {
9947        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
9948        match self {
9949            Manual => "manual",
9950        }
9951    }
9952}
9953
9954impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9955    type Err = stripe_types::StripeParseError;
9956    fn from_str(s: &str) -> Result<Self, Self::Err> {
9957        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
9958        match s {
9959            "manual" => Ok(Manual),
9960            _ => Err(stripe_types::StripeParseError),
9961        }
9962    }
9963}
9964impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9966        f.write_str(self.as_str())
9967    }
9968}
9969
9970impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9972        f.write_str(self.as_str())
9973    }
9974}
9975impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9976    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9977    where
9978        S: serde::Serializer,
9979    {
9980        serializer.serialize_str(self.as_str())
9981    }
9982}
9983#[cfg(feature = "deserialize")]
9984impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9985    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9986        use std::str::FromStr;
9987        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9988        Self::from_str(&s).map_err(|_| {
9989            serde::de::Error::custom(
9990                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
9991            )
9992        })
9993    }
9994}
9995/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
9996#[derive(Clone, Debug, serde::Serialize)]
9997pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9998    /// Additional fields for Mandate creation
9999    #[serde(skip_serializing_if = "Option::is_none")]
10000    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
10001    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10002    ///
10003    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10004    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10005    ///
10006    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10007    ///
10008    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10009    ///
10010    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10011    #[serde(skip_serializing_if = "Option::is_none")]
10012    pub setup_future_usage:
10013        Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
10014    /// Controls when Stripe will attempt to debit the funds from the customer's account.
10015    /// The date must be a string in YYYY-MM-DD format.
10016    /// The date must be in the future and between 3 and 15 calendar days from now.
10017    #[serde(skip_serializing_if = "Option::is_none")]
10018    pub target_date: Option<String>,
10019}
10020impl CreatePaymentIntentPaymentMethodOptionsSepaDebit {
10021    pub fn new() -> Self {
10022        Self { mandate_options: None, setup_future_usage: None, target_date: None }
10023    }
10024}
10025impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebit {
10026    fn default() -> Self {
10027        Self::new()
10028    }
10029}
10030/// Additional fields for Mandate creation
10031#[derive(Clone, Debug, serde::Serialize)]
10032pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
10033    /// Prefix used to generate the Mandate reference.
10034    /// Must be at most 12 characters long.
10035    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
10036    /// Cannot begin with 'STRIPE'.
10037    #[serde(skip_serializing_if = "Option::is_none")]
10038    pub reference_prefix: Option<String>,
10039}
10040impl CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
10041    pub fn new() -> Self {
10042        Self { reference_prefix: None }
10043    }
10044}
10045impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
10046    fn default() -> Self {
10047        Self::new()
10048    }
10049}
10050/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10051///
10052/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10053/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10054///
10055/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10056///
10057/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10058///
10059/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10060#[derive(Copy, Clone, Eq, PartialEq)]
10061pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10062    None,
10063    OffSession,
10064    OnSession,
10065}
10066impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10067    pub fn as_str(self) -> &'static str {
10068        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
10069        match self {
10070            None => "none",
10071            OffSession => "off_session",
10072            OnSession => "on_session",
10073        }
10074    }
10075}
10076
10077impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10078    type Err = stripe_types::StripeParseError;
10079    fn from_str(s: &str) -> Result<Self, Self::Err> {
10080        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
10081        match s {
10082            "none" => Ok(None),
10083            "off_session" => Ok(OffSession),
10084            "on_session" => Ok(OnSession),
10085            _ => Err(stripe_types::StripeParseError),
10086        }
10087    }
10088}
10089impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10090    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10091        f.write_str(self.as_str())
10092    }
10093}
10094
10095impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10096    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10097        f.write_str(self.as_str())
10098    }
10099}
10100impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10101    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10102    where
10103        S: serde::Serializer,
10104    {
10105        serializer.serialize_str(self.as_str())
10106    }
10107}
10108#[cfg(feature = "deserialize")]
10109impl<'de> serde::Deserialize<'de>
10110    for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
10111{
10112    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10113        use std::str::FromStr;
10114        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10115        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
10116    }
10117}
10118/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
10119#[derive(Copy, Clone, Debug, serde::Serialize)]
10120pub struct CreatePaymentIntentPaymentMethodOptionsSofort {
10121    /// Language shown to the payer on redirect.
10122    #[serde(skip_serializing_if = "Option::is_none")]
10123    pub preferred_language: Option<CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
10124    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10125    ///
10126    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10127    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10128    ///
10129    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10130    ///
10131    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10132    ///
10133    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10134    #[serde(skip_serializing_if = "Option::is_none")]
10135    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
10136}
10137impl CreatePaymentIntentPaymentMethodOptionsSofort {
10138    pub fn new() -> Self {
10139        Self { preferred_language: None, setup_future_usage: None }
10140    }
10141}
10142impl Default for CreatePaymentIntentPaymentMethodOptionsSofort {
10143    fn default() -> Self {
10144        Self::new()
10145    }
10146}
10147/// Language shown to the payer on redirect.
10148#[derive(Copy, Clone, Eq, PartialEq)]
10149pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10150    De,
10151    En,
10152    Es,
10153    Fr,
10154    It,
10155    Nl,
10156    Pl,
10157}
10158impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10159    pub fn as_str(self) -> &'static str {
10160        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
10161        match self {
10162            De => "de",
10163            En => "en",
10164            Es => "es",
10165            Fr => "fr",
10166            It => "it",
10167            Nl => "nl",
10168            Pl => "pl",
10169        }
10170    }
10171}
10172
10173impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10174    type Err = stripe_types::StripeParseError;
10175    fn from_str(s: &str) -> Result<Self, Self::Err> {
10176        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
10177        match s {
10178            "de" => Ok(De),
10179            "en" => Ok(En),
10180            "es" => Ok(Es),
10181            "fr" => Ok(Fr),
10182            "it" => Ok(It),
10183            "nl" => Ok(Nl),
10184            "pl" => Ok(Pl),
10185            _ => Err(stripe_types::StripeParseError),
10186        }
10187    }
10188}
10189impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10190    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10191        f.write_str(self.as_str())
10192    }
10193}
10194
10195impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10197        f.write_str(self.as_str())
10198    }
10199}
10200impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10201    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10202    where
10203        S: serde::Serializer,
10204    {
10205        serializer.serialize_str(self.as_str())
10206    }
10207}
10208#[cfg(feature = "deserialize")]
10209impl<'de> serde::Deserialize<'de>
10210    for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
10211{
10212    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10213        use std::str::FromStr;
10214        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10215        Self::from_str(&s).map_err(|_| {
10216            serde::de::Error::custom(
10217                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
10218            )
10219        })
10220    }
10221}
10222/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10223///
10224/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10225/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10226///
10227/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10228///
10229/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10230///
10231/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10232#[derive(Copy, Clone, Eq, PartialEq)]
10233pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10234    None,
10235    OffSession,
10236}
10237impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10238    pub fn as_str(self) -> &'static str {
10239        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
10240        match self {
10241            None => "none",
10242            OffSession => "off_session",
10243        }
10244    }
10245}
10246
10247impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10248    type Err = stripe_types::StripeParseError;
10249    fn from_str(s: &str) -> Result<Self, Self::Err> {
10250        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
10251        match s {
10252            "none" => Ok(None),
10253            "off_session" => Ok(OffSession),
10254            _ => Err(stripe_types::StripeParseError),
10255        }
10256    }
10257}
10258impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10260        f.write_str(self.as_str())
10261    }
10262}
10263
10264impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10265    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10266        f.write_str(self.as_str())
10267    }
10268}
10269impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10270    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10271    where
10272        S: serde::Serializer,
10273    {
10274        serializer.serialize_str(self.as_str())
10275    }
10276}
10277#[cfg(feature = "deserialize")]
10278impl<'de> serde::Deserialize<'de>
10279    for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
10280{
10281    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10282        use std::str::FromStr;
10283        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10284        Self::from_str(&s).map_err(|_| {
10285            serde::de::Error::custom(
10286                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
10287            )
10288        })
10289    }
10290}
10291/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
10292#[derive(Clone, Debug, serde::Serialize)]
10293pub struct CreatePaymentIntentPaymentMethodOptionsSwish {
10294    /// A reference for this payment to be displayed in the Swish app.
10295    #[serde(skip_serializing_if = "Option::is_none")]
10296    pub reference: Option<String>,
10297    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10298    ///
10299    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10300    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10301    ///
10302    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10303    ///
10304    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10305    ///
10306    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10307    #[serde(skip_serializing_if = "Option::is_none")]
10308    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
10309}
10310impl CreatePaymentIntentPaymentMethodOptionsSwish {
10311    pub fn new() -> Self {
10312        Self { reference: None, setup_future_usage: None }
10313    }
10314}
10315impl Default for CreatePaymentIntentPaymentMethodOptionsSwish {
10316    fn default() -> Self {
10317        Self::new()
10318    }
10319}
10320/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10321///
10322/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10323/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10324///
10325/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10326///
10327/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10328///
10329/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10330#[derive(Copy, Clone, Eq, PartialEq)]
10331pub enum CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10332    None,
10333}
10334impl CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10335    pub fn as_str(self) -> &'static str {
10336        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
10337        match self {
10338            None => "none",
10339        }
10340    }
10341}
10342
10343impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10344    type Err = stripe_types::StripeParseError;
10345    fn from_str(s: &str) -> Result<Self, Self::Err> {
10346        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
10347        match s {
10348            "none" => Ok(None),
10349            _ => Err(stripe_types::StripeParseError),
10350        }
10351    }
10352}
10353impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10354    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10355        f.write_str(self.as_str())
10356    }
10357}
10358
10359impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10360    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10361        f.write_str(self.as_str())
10362    }
10363}
10364impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10365    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10366    where
10367        S: serde::Serializer,
10368    {
10369        serializer.serialize_str(self.as_str())
10370    }
10371}
10372#[cfg(feature = "deserialize")]
10373impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10374    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10375        use std::str::FromStr;
10376        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10377        Self::from_str(&s).map_err(|_| {
10378            serde::de::Error::custom(
10379                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
10380            )
10381        })
10382    }
10383}
10384/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
10385#[derive(Copy, Clone, Debug, serde::Serialize)]
10386pub struct CreatePaymentIntentPaymentMethodOptionsTwint {
10387    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10388    ///
10389    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10390    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10391    ///
10392    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10393    ///
10394    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10395    ///
10396    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10397    #[serde(skip_serializing_if = "Option::is_none")]
10398    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
10399}
10400impl CreatePaymentIntentPaymentMethodOptionsTwint {
10401    pub fn new() -> Self {
10402        Self { setup_future_usage: None }
10403    }
10404}
10405impl Default for CreatePaymentIntentPaymentMethodOptionsTwint {
10406    fn default() -> Self {
10407        Self::new()
10408    }
10409}
10410/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10411///
10412/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10413/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10414///
10415/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10416///
10417/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10418///
10419/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10420#[derive(Copy, Clone, Eq, PartialEq)]
10421pub enum CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10422    None,
10423}
10424impl CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10425    pub fn as_str(self) -> &'static str {
10426        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
10427        match self {
10428            None => "none",
10429        }
10430    }
10431}
10432
10433impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10434    type Err = stripe_types::StripeParseError;
10435    fn from_str(s: &str) -> Result<Self, Self::Err> {
10436        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
10437        match s {
10438            "none" => Ok(None),
10439            _ => Err(stripe_types::StripeParseError),
10440        }
10441    }
10442}
10443impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10445        f.write_str(self.as_str())
10446    }
10447}
10448
10449impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10451        f.write_str(self.as_str())
10452    }
10453}
10454impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10455    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10456    where
10457        S: serde::Serializer,
10458    {
10459        serializer.serialize_str(self.as_str())
10460    }
10461}
10462#[cfg(feature = "deserialize")]
10463impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10464    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10465        use std::str::FromStr;
10466        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10467        Self::from_str(&s).map_err(|_| {
10468            serde::de::Error::custom(
10469                "Unknown value for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
10470            )
10471        })
10472    }
10473}
10474/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
10475#[derive(Clone, Debug, serde::Serialize)]
10476pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10477    /// Additional fields for Financial Connections Session creation
10478    #[serde(skip_serializing_if = "Option::is_none")]
10479    pub financial_connections:
10480        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
10481    /// Additional fields for Mandate creation
10482    #[serde(skip_serializing_if = "Option::is_none")]
10483    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
10484    /// Additional fields for network related functions
10485    #[serde(skip_serializing_if = "Option::is_none")]
10486    pub networks: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
10487    /// Preferred transaction settlement speed
10488    #[serde(skip_serializing_if = "Option::is_none")]
10489    pub preferred_settlement_speed:
10490        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
10491    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10492    ///
10493    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10494    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10495    ///
10496    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10497    ///
10498    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10499    ///
10500    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10501    #[serde(skip_serializing_if = "Option::is_none")]
10502    pub setup_future_usage:
10503        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
10504    /// Controls when Stripe will attempt to debit the funds from the customer's account.
10505    /// The date must be a string in YYYY-MM-DD format.
10506    /// The date must be in the future and between 3 and 15 calendar days from now.
10507    #[serde(skip_serializing_if = "Option::is_none")]
10508    pub target_date: Option<String>,
10509    /// Bank account verification method.
10510    #[serde(skip_serializing_if = "Option::is_none")]
10511    pub verification_method:
10512        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
10513}
10514impl CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10515    pub fn new() -> Self {
10516        Self {
10517            financial_connections: None,
10518            mandate_options: None,
10519            networks: None,
10520            preferred_settlement_speed: None,
10521            setup_future_usage: None,
10522            target_date: None,
10523            verification_method: None,
10524        }
10525    }
10526}
10527impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10528    fn default() -> Self {
10529        Self::new()
10530    }
10531}
10532/// Additional fields for Financial Connections Session creation
10533#[derive(Clone, Debug, serde::Serialize)]
10534pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10535    /// Provide filters for the linked accounts that the customer can select for the payment method.
10536    #[serde(skip_serializing_if = "Option::is_none")]
10537    pub filters:
10538        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
10539    /// The list of permissions to request.
10540    /// If this parameter is passed, the `payment_method` permission must be included.
10541    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
10542    #[serde(skip_serializing_if = "Option::is_none")]
10543    pub permissions: Option<
10544        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
10545    >,
10546    /// List of data features that you would like to retrieve upon account creation.
10547    #[serde(skip_serializing_if = "Option::is_none")]
10548    pub prefetch: Option<
10549        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
10550    >,
10551    /// For webview integrations only.
10552    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
10553    #[serde(skip_serializing_if = "Option::is_none")]
10554    pub return_url: Option<String>,
10555}
10556impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10557    pub fn new() -> Self {
10558        Self { filters: None, permissions: None, prefetch: None, return_url: None }
10559    }
10560}
10561impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10562    fn default() -> Self {
10563        Self::new()
10564    }
10565}
10566/// Provide filters for the linked accounts that the customer can select for the payment method.
10567#[derive(Clone, Debug, serde::Serialize)]
10568pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10569        /// The account subcategories to use to filter for selectable accounts.
10570    /// Valid subcategories are `checking` and `savings`.
10571#[serde(skip_serializing_if = "Option::is_none")]
10572pub account_subcategories: Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
10573
10574}
10575impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10576    pub fn new() -> Self {
10577        Self { account_subcategories: None }
10578    }
10579}
10580impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10581    fn default() -> Self {
10582        Self::new()
10583    }
10584}
10585/// The account subcategories to use to filter for selectable accounts.
10586/// Valid subcategories are `checking` and `savings`.
10587#[derive(Copy, Clone, Eq, PartialEq)]
10588pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
10589{
10590    Checking,
10591    Savings,
10592}
10593impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10594    pub fn as_str(self) -> &'static str {
10595        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
10596        match self {
10597Checking => "checking",
10598Savings => "savings",
10599
10600        }
10601    }
10602}
10603
10604impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10605    type Err = stripe_types::StripeParseError;
10606    fn from_str(s: &str) -> Result<Self, Self::Err> {
10607        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
10608        match s {
10609    "checking" => Ok(Checking),
10610"savings" => Ok(Savings),
10611_ => Err(stripe_types::StripeParseError)
10612
10613        }
10614    }
10615}
10616impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10617    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10618        f.write_str(self.as_str())
10619    }
10620}
10621
10622impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10623    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10624        f.write_str(self.as_str())
10625    }
10626}
10627impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10628    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
10629        serializer.serialize_str(self.as_str())
10630    }
10631}
10632#[cfg(feature = "deserialize")]
10633impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10634    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10635        use std::str::FromStr;
10636        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10637        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
10638    }
10639}
10640/// The list of permissions to request.
10641/// If this parameter is passed, the `payment_method` permission must be included.
10642/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
10643#[derive(Copy, Clone, Eq, PartialEq)]
10644pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
10645    Balances,
10646    Ownership,
10647    PaymentMethod,
10648    Transactions,
10649}
10650impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
10651    pub fn as_str(self) -> &'static str {
10652        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
10653        match self {
10654            Balances => "balances",
10655            Ownership => "ownership",
10656            PaymentMethod => "payment_method",
10657            Transactions => "transactions",
10658        }
10659    }
10660}
10661
10662impl std::str::FromStr
10663    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10664{
10665    type Err = stripe_types::StripeParseError;
10666    fn from_str(s: &str) -> Result<Self, Self::Err> {
10667        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
10668        match s {
10669            "balances" => Ok(Balances),
10670            "ownership" => Ok(Ownership),
10671            "payment_method" => Ok(PaymentMethod),
10672            "transactions" => Ok(Transactions),
10673            _ => Err(stripe_types::StripeParseError),
10674        }
10675    }
10676}
10677impl std::fmt::Display
10678    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10679{
10680    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10681        f.write_str(self.as_str())
10682    }
10683}
10684
10685impl std::fmt::Debug
10686    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10687{
10688    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10689        f.write_str(self.as_str())
10690    }
10691}
10692impl serde::Serialize
10693    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10694{
10695    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10696    where
10697        S: serde::Serializer,
10698    {
10699        serializer.serialize_str(self.as_str())
10700    }
10701}
10702#[cfg(feature = "deserialize")]
10703impl<'de> serde::Deserialize<'de>
10704    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10705{
10706    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10707        use std::str::FromStr;
10708        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10709        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
10710    }
10711}
10712/// List of data features that you would like to retrieve upon account creation.
10713#[derive(Copy, Clone, Eq, PartialEq)]
10714pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
10715    Balances,
10716    Ownership,
10717    Transactions,
10718}
10719impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
10720    pub fn as_str(self) -> &'static str {
10721        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
10722        match self {
10723            Balances => "balances",
10724            Ownership => "ownership",
10725            Transactions => "transactions",
10726        }
10727    }
10728}
10729
10730impl std::str::FromStr
10731    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10732{
10733    type Err = stripe_types::StripeParseError;
10734    fn from_str(s: &str) -> Result<Self, Self::Err> {
10735        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
10736        match s {
10737            "balances" => Ok(Balances),
10738            "ownership" => Ok(Ownership),
10739            "transactions" => Ok(Transactions),
10740            _ => Err(stripe_types::StripeParseError),
10741        }
10742    }
10743}
10744impl std::fmt::Display
10745    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10746{
10747    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10748        f.write_str(self.as_str())
10749    }
10750}
10751
10752impl std::fmt::Debug
10753    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10754{
10755    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10756        f.write_str(self.as_str())
10757    }
10758}
10759impl serde::Serialize
10760    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10761{
10762    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10763    where
10764        S: serde::Serializer,
10765    {
10766        serializer.serialize_str(self.as_str())
10767    }
10768}
10769#[cfg(feature = "deserialize")]
10770impl<'de> serde::Deserialize<'de>
10771    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10772{
10773    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10774        use std::str::FromStr;
10775        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10776        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
10777    }
10778}
10779/// Additional fields for Mandate creation
10780#[derive(Copy, Clone, Debug, serde::Serialize)]
10781pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10782    /// The method used to collect offline mandate customer acceptance.
10783    #[serde(skip_serializing_if = "Option::is_none")]
10784    pub collection_method:
10785        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
10786}
10787impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10788    pub fn new() -> Self {
10789        Self { collection_method: None }
10790    }
10791}
10792impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10793    fn default() -> Self {
10794        Self::new()
10795    }
10796}
10797/// The method used to collect offline mandate customer acceptance.
10798#[derive(Copy, Clone, Eq, PartialEq)]
10799pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
10800    Paper,
10801}
10802impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
10803    pub fn as_str(self) -> &'static str {
10804        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
10805        match self {
10806            Paper => "paper",
10807        }
10808    }
10809}
10810
10811impl std::str::FromStr
10812    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10813{
10814    type Err = stripe_types::StripeParseError;
10815    fn from_str(s: &str) -> Result<Self, Self::Err> {
10816        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
10817        match s {
10818            "paper" => Ok(Paper),
10819            _ => Err(stripe_types::StripeParseError),
10820        }
10821    }
10822}
10823impl std::fmt::Display
10824    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10825{
10826    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10827        f.write_str(self.as_str())
10828    }
10829}
10830
10831impl std::fmt::Debug
10832    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10833{
10834    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10835        f.write_str(self.as_str())
10836    }
10837}
10838impl serde::Serialize
10839    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10840{
10841    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10842    where
10843        S: serde::Serializer,
10844    {
10845        serializer.serialize_str(self.as_str())
10846    }
10847}
10848#[cfg(feature = "deserialize")]
10849impl<'de> serde::Deserialize<'de>
10850    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10851{
10852    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10853        use std::str::FromStr;
10854        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10855        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
10856    }
10857}
10858/// Additional fields for network related functions
10859#[derive(Clone, Debug, serde::Serialize)]
10860pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10861    /// Triggers validations to run across the selected networks
10862    #[serde(skip_serializing_if = "Option::is_none")]
10863    pub requested:
10864        Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
10865}
10866impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10867    pub fn new() -> Self {
10868        Self { requested: None }
10869    }
10870}
10871impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10872    fn default() -> Self {
10873        Self::new()
10874    }
10875}
10876/// Triggers validations to run across the selected networks
10877#[derive(Copy, Clone, Eq, PartialEq)]
10878pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10879    Ach,
10880    UsDomesticWire,
10881}
10882impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10883    pub fn as_str(self) -> &'static str {
10884        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
10885        match self {
10886            Ach => "ach",
10887            UsDomesticWire => "us_domestic_wire",
10888        }
10889    }
10890}
10891
10892impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10893    type Err = stripe_types::StripeParseError;
10894    fn from_str(s: &str) -> Result<Self, Self::Err> {
10895        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
10896        match s {
10897            "ach" => Ok(Ach),
10898            "us_domestic_wire" => Ok(UsDomesticWire),
10899            _ => Err(stripe_types::StripeParseError),
10900        }
10901    }
10902}
10903impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10904    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10905        f.write_str(self.as_str())
10906    }
10907}
10908
10909impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10910    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10911        f.write_str(self.as_str())
10912    }
10913}
10914impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10915    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10916    where
10917        S: serde::Serializer,
10918    {
10919        serializer.serialize_str(self.as_str())
10920    }
10921}
10922#[cfg(feature = "deserialize")]
10923impl<'de> serde::Deserialize<'de>
10924    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
10925{
10926    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10927        use std::str::FromStr;
10928        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10929        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
10930    }
10931}
10932/// Preferred transaction settlement speed
10933#[derive(Copy, Clone, Eq, PartialEq)]
10934pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
10935    Fastest,
10936    Standard,
10937}
10938impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
10939    pub fn as_str(self) -> &'static str {
10940        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
10941        match self {
10942            Fastest => "fastest",
10943            Standard => "standard",
10944        }
10945    }
10946}
10947
10948impl std::str::FromStr
10949    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10950{
10951    type Err = stripe_types::StripeParseError;
10952    fn from_str(s: &str) -> Result<Self, Self::Err> {
10953        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
10954        match s {
10955            "fastest" => Ok(Fastest),
10956            "standard" => Ok(Standard),
10957            _ => Err(stripe_types::StripeParseError),
10958        }
10959    }
10960}
10961impl std::fmt::Display
10962    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10963{
10964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10965        f.write_str(self.as_str())
10966    }
10967}
10968
10969impl std::fmt::Debug
10970    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10971{
10972    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10973        f.write_str(self.as_str())
10974    }
10975}
10976impl serde::Serialize
10977    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10978{
10979    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10980    where
10981        S: serde::Serializer,
10982    {
10983        serializer.serialize_str(self.as_str())
10984    }
10985}
10986#[cfg(feature = "deserialize")]
10987impl<'de> serde::Deserialize<'de>
10988    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10989{
10990    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10991        use std::str::FromStr;
10992        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10993        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
10994    }
10995}
10996/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10997///
10998/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10999/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11000///
11001/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11002///
11003/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11004///
11005/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11006#[derive(Copy, Clone, Eq, PartialEq)]
11007pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11008    None,
11009    OffSession,
11010    OnSession,
11011}
11012impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11013    pub fn as_str(self) -> &'static str {
11014        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
11015        match self {
11016            None => "none",
11017            OffSession => "off_session",
11018            OnSession => "on_session",
11019        }
11020    }
11021}
11022
11023impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11024    type Err = stripe_types::StripeParseError;
11025    fn from_str(s: &str) -> Result<Self, Self::Err> {
11026        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
11027        match s {
11028            "none" => Ok(None),
11029            "off_session" => Ok(OffSession),
11030            "on_session" => Ok(OnSession),
11031            _ => Err(stripe_types::StripeParseError),
11032        }
11033    }
11034}
11035impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11036    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11037        f.write_str(self.as_str())
11038    }
11039}
11040
11041impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11043        f.write_str(self.as_str())
11044    }
11045}
11046impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11047    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11048    where
11049        S: serde::Serializer,
11050    {
11051        serializer.serialize_str(self.as_str())
11052    }
11053}
11054#[cfg(feature = "deserialize")]
11055impl<'de> serde::Deserialize<'de>
11056    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
11057{
11058    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11059        use std::str::FromStr;
11060        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11061        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
11062    }
11063}
11064/// Bank account verification method.
11065#[derive(Copy, Clone, Eq, PartialEq)]
11066pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11067    Automatic,
11068    Instant,
11069    Microdeposits,
11070}
11071impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11072    pub fn as_str(self) -> &'static str {
11073        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
11074        match self {
11075            Automatic => "automatic",
11076            Instant => "instant",
11077            Microdeposits => "microdeposits",
11078        }
11079    }
11080}
11081
11082impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11083    type Err = stripe_types::StripeParseError;
11084    fn from_str(s: &str) -> Result<Self, Self::Err> {
11085        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
11086        match s {
11087            "automatic" => Ok(Automatic),
11088            "instant" => Ok(Instant),
11089            "microdeposits" => Ok(Microdeposits),
11090            _ => Err(stripe_types::StripeParseError),
11091        }
11092    }
11093}
11094impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11095    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11096        f.write_str(self.as_str())
11097    }
11098}
11099
11100impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11101    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11102        f.write_str(self.as_str())
11103    }
11104}
11105impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11106    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11107    where
11108        S: serde::Serializer,
11109    {
11110        serializer.serialize_str(self.as_str())
11111    }
11112}
11113#[cfg(feature = "deserialize")]
11114impl<'de> serde::Deserialize<'de>
11115    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
11116{
11117    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11118        use std::str::FromStr;
11119        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11120        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
11121    }
11122}
11123/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
11124#[derive(Clone, Debug, serde::Serialize)]
11125pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay {
11126    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
11127    #[serde(skip_serializing_if = "Option::is_none")]
11128    pub app_id: Option<String>,
11129    /// The client type that the end customer will pay from
11130    #[serde(skip_serializing_if = "Option::is_none")]
11131    pub client: Option<CreatePaymentIntentPaymentMethodOptionsWechatPayClient>,
11132    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11133    ///
11134    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11135    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11136    ///
11137    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11138    ///
11139    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11140    ///
11141    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11142    #[serde(skip_serializing_if = "Option::is_none")]
11143    pub setup_future_usage:
11144        Option<CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
11145}
11146impl CreatePaymentIntentPaymentMethodOptionsWechatPay {
11147    pub fn new() -> Self {
11148        Self { app_id: None, client: None, setup_future_usage: None }
11149    }
11150}
11151impl Default for CreatePaymentIntentPaymentMethodOptionsWechatPay {
11152    fn default() -> Self {
11153        Self::new()
11154    }
11155}
11156/// The client type that the end customer will pay from
11157#[derive(Copy, Clone, Eq, PartialEq)]
11158pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11159    Android,
11160    Ios,
11161    Web,
11162}
11163impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11164    pub fn as_str(self) -> &'static str {
11165        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
11166        match self {
11167            Android => "android",
11168            Ios => "ios",
11169            Web => "web",
11170        }
11171    }
11172}
11173
11174impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11175    type Err = stripe_types::StripeParseError;
11176    fn from_str(s: &str) -> Result<Self, Self::Err> {
11177        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
11178        match s {
11179            "android" => Ok(Android),
11180            "ios" => Ok(Ios),
11181            "web" => Ok(Web),
11182            _ => Err(stripe_types::StripeParseError),
11183        }
11184    }
11185}
11186impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11187    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11188        f.write_str(self.as_str())
11189    }
11190}
11191
11192impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11194        f.write_str(self.as_str())
11195    }
11196}
11197impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11198    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11199    where
11200        S: serde::Serializer,
11201    {
11202        serializer.serialize_str(self.as_str())
11203    }
11204}
11205#[cfg(feature = "deserialize")]
11206impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11207    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11208        use std::str::FromStr;
11209        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11210        Self::from_str(&s).map_err(|_| {
11211            serde::de::Error::custom(
11212                "Unknown value for CreatePaymentIntentPaymentMethodOptionsWechatPayClient",
11213            )
11214        })
11215    }
11216}
11217/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11218///
11219/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11220/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11221///
11222/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11223///
11224/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11225///
11226/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11227#[derive(Copy, Clone, Eq, PartialEq)]
11228pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11229    None,
11230}
11231impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11232    pub fn as_str(self) -> &'static str {
11233        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
11234        match self {
11235            None => "none",
11236        }
11237    }
11238}
11239
11240impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11241    type Err = stripe_types::StripeParseError;
11242    fn from_str(s: &str) -> Result<Self, Self::Err> {
11243        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
11244        match s {
11245            "none" => Ok(None),
11246            _ => Err(stripe_types::StripeParseError),
11247        }
11248    }
11249}
11250impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11252        f.write_str(self.as_str())
11253    }
11254}
11255
11256impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11257    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11258        f.write_str(self.as_str())
11259    }
11260}
11261impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11262    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11263    where
11264        S: serde::Serializer,
11265    {
11266        serializer.serialize_str(self.as_str())
11267    }
11268}
11269#[cfg(feature = "deserialize")]
11270impl<'de> serde::Deserialize<'de>
11271    for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
11272{
11273    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11274        use std::str::FromStr;
11275        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11276        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
11277    }
11278}
11279/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
11280#[derive(Copy, Clone, Debug, serde::Serialize)]
11281pub struct CreatePaymentIntentPaymentMethodOptionsZip {
11282    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11283    ///
11284    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11285    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11286    ///
11287    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11288    ///
11289    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11290    ///
11291    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11292    #[serde(skip_serializing_if = "Option::is_none")]
11293    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
11294}
11295impl CreatePaymentIntentPaymentMethodOptionsZip {
11296    pub fn new() -> Self {
11297        Self { setup_future_usage: None }
11298    }
11299}
11300impl Default for CreatePaymentIntentPaymentMethodOptionsZip {
11301    fn default() -> Self {
11302        Self::new()
11303    }
11304}
11305/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11306///
11307/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11308/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11309///
11310/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11311///
11312/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11313///
11314/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11315#[derive(Copy, Clone, Eq, PartialEq)]
11316pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11317    None,
11318}
11319impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11320    pub fn as_str(self) -> &'static str {
11321        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
11322        match self {
11323            None => "none",
11324        }
11325    }
11326}
11327
11328impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11329    type Err = stripe_types::StripeParseError;
11330    fn from_str(s: &str) -> Result<Self, Self::Err> {
11331        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
11332        match s {
11333            "none" => Ok(None),
11334            _ => Err(stripe_types::StripeParseError),
11335        }
11336    }
11337}
11338impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11339    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11340        f.write_str(self.as_str())
11341    }
11342}
11343
11344impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11345    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11346        f.write_str(self.as_str())
11347    }
11348}
11349impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11350    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11351    where
11352        S: serde::Serializer,
11353    {
11354        serializer.serialize_str(self.as_str())
11355    }
11356}
11357#[cfg(feature = "deserialize")]
11358impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11359    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11360        use std::str::FromStr;
11361        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11362        Self::from_str(&s).map_err(|_| {
11363            serde::de::Error::custom(
11364                "Unknown value for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
11365            )
11366        })
11367    }
11368}
11369/// Options to configure Radar.
11370/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
11371#[derive(Clone, Debug, serde::Serialize)]
11372pub struct CreatePaymentIntentRadarOptions {
11373    /// 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.
11374    #[serde(skip_serializing_if = "Option::is_none")]
11375    pub session: Option<String>,
11376}
11377impl CreatePaymentIntentRadarOptions {
11378    pub fn new() -> Self {
11379        Self { session: None }
11380    }
11381}
11382impl Default for CreatePaymentIntentRadarOptions {
11383    fn default() -> Self {
11384        Self::new()
11385    }
11386}
11387/// Shipping information for this PaymentIntent.
11388#[derive(Clone, Debug, serde::Serialize)]
11389pub struct CreatePaymentIntentShipping {
11390    /// Shipping address.
11391    pub address: CreatePaymentIntentShippingAddress,
11392    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
11393    #[serde(skip_serializing_if = "Option::is_none")]
11394    pub carrier: Option<String>,
11395    /// Recipient name.
11396    pub name: String,
11397    /// Recipient phone (including extension).
11398    #[serde(skip_serializing_if = "Option::is_none")]
11399    pub phone: Option<String>,
11400    /// The tracking number for a physical product, obtained from the delivery service.
11401    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
11402    #[serde(skip_serializing_if = "Option::is_none")]
11403    pub tracking_number: Option<String>,
11404}
11405impl CreatePaymentIntentShipping {
11406    pub fn new(
11407        address: impl Into<CreatePaymentIntentShippingAddress>,
11408        name: impl Into<String>,
11409    ) -> Self {
11410        Self {
11411            address: address.into(),
11412            carrier: None,
11413            name: name.into(),
11414            phone: None,
11415            tracking_number: None,
11416        }
11417    }
11418}
11419/// Shipping address.
11420#[derive(Clone, Debug, serde::Serialize)]
11421pub struct CreatePaymentIntentShippingAddress {
11422    /// City, district, suburb, town, or village.
11423    #[serde(skip_serializing_if = "Option::is_none")]
11424    pub city: Option<String>,
11425    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
11426    #[serde(skip_serializing_if = "Option::is_none")]
11427    pub country: Option<String>,
11428    /// Address line 1, such as the street, PO Box, or company name.
11429    #[serde(skip_serializing_if = "Option::is_none")]
11430    pub line1: Option<String>,
11431    /// Address line 2, such as the apartment, suite, unit, or building.
11432    #[serde(skip_serializing_if = "Option::is_none")]
11433    pub line2: Option<String>,
11434    /// ZIP or postal code.
11435    #[serde(skip_serializing_if = "Option::is_none")]
11436    pub postal_code: Option<String>,
11437    /// State, county, province, or region.
11438    #[serde(skip_serializing_if = "Option::is_none")]
11439    pub state: Option<String>,
11440}
11441impl CreatePaymentIntentShippingAddress {
11442    pub fn new() -> Self {
11443        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
11444    }
11445}
11446impl Default for CreatePaymentIntentShippingAddress {
11447    fn default() -> Self {
11448        Self::new()
11449    }
11450}
11451/// The parameters that you can use to automatically create a Transfer.
11452/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11453#[derive(Clone, Debug, serde::Serialize)]
11454pub struct CreatePaymentIntentTransferData {
11455    /// The amount that will be transferred automatically when a charge succeeds.
11456    /// The amount is capped at the total transaction amount and if no amount is set,
11457    /// the full amount is transferred.
11458    ///
11459    /// If you intend to collect a fee and you need a more robust reporting experience, using
11460    /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount).
11461    /// might be a better fit for your integration.
11462    #[serde(skip_serializing_if = "Option::is_none")]
11463    pub amount: Option<i64>,
11464    /// If specified, successful charges will be attributed to the destination
11465    /// account for tax reporting, and the funds from charges will be transferred
11466    /// to the destination account. The ID of the resulting transfer will be
11467    /// returned on the successful charge's `transfer` field.
11468    pub destination: String,
11469}
11470impl CreatePaymentIntentTransferData {
11471    pub fn new(destination: impl Into<String>) -> Self {
11472        Self { amount: None, destination: destination.into() }
11473    }
11474}
11475/// Creates a PaymentIntent object.
11476///
11477/// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm).
11478/// to continue the payment. Learn more about [the available payment flows
11479/// with the Payment Intents API](https://stripe.com/docs/payments/payment-intents).
11480///
11481/// When you use `confirm=true` during creation, it’s equivalent to creating
11482/// and confirming the PaymentIntent in the same call. You can use any parameters
11483/// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
11484/// `confirm=true`.
11485#[derive(Clone, Debug, serde::Serialize)]
11486pub struct CreatePaymentIntent {
11487    inner: CreatePaymentIntentBuilder,
11488}
11489impl CreatePaymentIntent {
11490    /// Construct a new `CreatePaymentIntent`.
11491    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
11492        Self { inner: CreatePaymentIntentBuilder::new(amount.into(), currency.into()) }
11493    }
11494    /// Provides industry-specific information about the amount.
11495    pub fn amount_details(
11496        mut self,
11497        amount_details: impl Into<CreatePaymentIntentAmountDetails>,
11498    ) -> Self {
11499        self.inner.amount_details = Some(amount_details.into());
11500        self
11501    }
11502    /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
11503    /// The amount of the application fee collected will be capped at the total amount captured.
11504    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11505    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
11506        self.inner.application_fee_amount = Some(application_fee_amount.into());
11507        self
11508    }
11509    /// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters.
11510    pub fn automatic_payment_methods(
11511        mut self,
11512        automatic_payment_methods: impl Into<CreatePaymentIntentAutomaticPaymentMethods>,
11513    ) -> Self {
11514        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
11515        self
11516    }
11517    /// Controls when the funds will be captured from the customer's account.
11518    pub fn capture_method(
11519        mut self,
11520        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
11521    ) -> Self {
11522        self.inner.capture_method = Some(capture_method.into());
11523        self
11524    }
11525    /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately.
11526    /// This parameter defaults to `false`.
11527    /// When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm).
11528    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
11529        self.inner.confirm = Some(confirm.into());
11530        self
11531    }
11532    /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
11533    pub fn confirmation_method(
11534        mut self,
11535        confirmation_method: impl Into<stripe_shared::PaymentIntentConfirmationMethod>,
11536    ) -> Self {
11537        self.inner.confirmation_method = Some(confirmation_method.into());
11538        self
11539    }
11540    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
11541    ///
11542    /// 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.
11543    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
11544        self.inner.confirmation_token = Some(confirmation_token.into());
11545        self
11546    }
11547    /// ID of the Customer this PaymentIntent belongs to, if one exists.
11548    ///
11549    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
11550    ///
11551    /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
11552    /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead.
11553    pub fn customer(mut self, customer: impl Into<String>) -> Self {
11554        self.inner.customer = Some(customer.into());
11555        self
11556    }
11557    /// An arbitrary string attached to the object. Often useful for displaying to users.
11558    pub fn description(mut self, description: impl Into<String>) -> Self {
11559        self.inner.description = Some(description.into());
11560        self
11561    }
11562    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
11563    /// Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication).
11564    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11565    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
11566        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
11567        self
11568    }
11569    /// The list of payment method types to exclude from use with this payment.
11570    pub fn excluded_payment_method_types(
11571        mut self,
11572        excluded_payment_method_types: impl Into<
11573            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
11574        >,
11575    ) -> Self {
11576        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
11577        self
11578    }
11579    /// Specifies which fields in the response should be expanded.
11580    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
11581        self.inner.expand = Some(expand.into());
11582        self
11583    }
11584    /// Automations to be run during the PaymentIntent lifecycle
11585    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
11586        self.inner.hooks = Some(hooks.into());
11587        self
11588    }
11589    /// ID of the mandate that's used for this payment.
11590    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11591    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
11592        self.inner.mandate = Some(mandate.into());
11593        self
11594    }
11595    /// This hash contains details about the Mandate to create.
11596    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11597    pub fn mandate_data(mut self, mandate_data: impl Into<CreatePaymentIntentMandateData>) -> Self {
11598        self.inner.mandate_data = Some(mandate_data.into());
11599        self
11600    }
11601    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
11602    /// This can be useful for storing additional information about the object in a structured format.
11603    /// Individual keys can be unset by posting an empty value to them.
11604    /// All keys can be unset by posting an empty value to `metadata`.
11605    pub fn metadata(
11606        mut self,
11607        metadata: impl Into<std::collections::HashMap<String, String>>,
11608    ) -> Self {
11609        self.inner.metadata = Some(metadata.into());
11610        self
11611    }
11612    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
11613    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
11614    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11615    pub fn off_session(mut self, off_session: impl Into<CreatePaymentIntentOffSession>) -> Self {
11616        self.inner.off_session = Some(off_session.into());
11617        self
11618    }
11619    /// The Stripe account ID that these funds are intended for.
11620    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11621    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
11622        self.inner.on_behalf_of = Some(on_behalf_of.into());
11623        self
11624    }
11625    /// Provides industry-specific information about the charge.
11626    pub fn payment_details(
11627        mut self,
11628        payment_details: impl Into<CreatePaymentIntentPaymentDetails>,
11629    ) -> Self {
11630        self.inner.payment_details = Some(payment_details.into());
11631        self
11632    }
11633    /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent.
11634    ///
11635    /// If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API.
11636    /// We recommend that you explicitly provide the `payment_method` moving forward.
11637    /// If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://stripe.com/docs/api#create_payment_intent-customer) parameter of this PaymentIntent.
11638    /// end
11639    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
11640        self.inner.payment_method = Some(payment_method.into());
11641        self
11642    }
11643    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
11644    pub fn payment_method_configuration(
11645        mut self,
11646        payment_method_configuration: impl Into<String>,
11647    ) -> Self {
11648        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
11649        self
11650    }
11651    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
11652    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
11653    /// property on the PaymentIntent.
11654    pub fn payment_method_data(
11655        mut self,
11656        payment_method_data: impl Into<CreatePaymentIntentPaymentMethodData>,
11657    ) -> Self {
11658        self.inner.payment_method_data = Some(payment_method_data.into());
11659        self
11660    }
11661    /// Payment method-specific configuration for this PaymentIntent.
11662    pub fn payment_method_options(
11663        mut self,
11664        payment_method_options: impl Into<CreatePaymentIntentPaymentMethodOptions>,
11665    ) -> Self {
11666        self.inner.payment_method_options = Some(payment_method_options.into());
11667        self
11668    }
11669    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
11670    /// 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).
11671    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
11672    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
11673        self.inner.payment_method_types = Some(payment_method_types.into());
11674        self
11675    }
11676    /// Options to configure Radar.
11677    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
11678    pub fn radar_options(
11679        mut self,
11680        radar_options: impl Into<CreatePaymentIntentRadarOptions>,
11681    ) -> Self {
11682        self.inner.radar_options = Some(radar_options.into());
11683        self
11684    }
11685    /// Email address to send the receipt to.
11686    /// If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails).
11687    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
11688        self.inner.receipt_email = Some(receipt_email.into());
11689        self
11690    }
11691    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
11692    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
11693    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11694    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
11695        self.inner.return_url = Some(return_url.into());
11696        self
11697    }
11698    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11699    ///
11700    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11701    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11702    ///
11703    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11704    ///
11705    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11706    pub fn setup_future_usage(
11707        mut self,
11708        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
11709    ) -> Self {
11710        self.inner.setup_future_usage = Some(setup_future_usage.into());
11711        self
11712    }
11713    /// Shipping information for this PaymentIntent.
11714    pub fn shipping(mut self, shipping: impl Into<CreatePaymentIntentShipping>) -> Self {
11715        self.inner.shipping = Some(shipping.into());
11716        self
11717    }
11718    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
11719    /// This value overrides the account's default statement descriptor.
11720    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
11721    ///
11722    /// Setting this value for a card charge returns an error.
11723    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
11724    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
11725        self.inner.statement_descriptor = Some(statement_descriptor.into());
11726        self
11727    }
11728    /// Provides information about a card charge.
11729    /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
11730    pub fn statement_descriptor_suffix(
11731        mut self,
11732        statement_descriptor_suffix: impl Into<String>,
11733    ) -> Self {
11734        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
11735        self
11736    }
11737    /// The parameters that you can use to automatically create a Transfer.
11738    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11739    pub fn transfer_data(
11740        mut self,
11741        transfer_data: impl Into<CreatePaymentIntentTransferData>,
11742    ) -> Self {
11743        self.inner.transfer_data = Some(transfer_data.into());
11744        self
11745    }
11746    /// A string that identifies the resulting payment as part of a group.
11747    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers).
11748    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
11749        self.inner.transfer_group = Some(transfer_group.into());
11750        self
11751    }
11752    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
11753    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
11754        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
11755        self
11756    }
11757}
11758impl CreatePaymentIntent {
11759    /// Send the request and return the deserialized response.
11760    pub async fn send<C: StripeClient>(
11761        &self,
11762        client: &C,
11763    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
11764        self.customize().send(client).await
11765    }
11766
11767    /// Send the request and return the deserialized response, blocking until completion.
11768    pub fn send_blocking<C: StripeBlockingClient>(
11769        &self,
11770        client: &C,
11771    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
11772        self.customize().send_blocking(client)
11773    }
11774}
11775
11776impl StripeRequest for CreatePaymentIntent {
11777    type Output = stripe_shared::PaymentIntent;
11778
11779    fn build(&self) -> RequestBuilder {
11780        RequestBuilder::new(StripeMethod::Post, "/payment_intents").form(&self.inner)
11781    }
11782}
11783#[derive(Clone, Debug, serde::Serialize)]
11784struct UpdatePaymentIntentBuilder {
11785    #[serde(skip_serializing_if = "Option::is_none")]
11786    amount: Option<i64>,
11787    #[serde(skip_serializing_if = "Option::is_none")]
11788    amount_details: Option<UpdatePaymentIntentAmountDetails>,
11789    #[serde(skip_serializing_if = "Option::is_none")]
11790    application_fee_amount: Option<i64>,
11791    #[serde(skip_serializing_if = "Option::is_none")]
11792    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
11793    #[serde(skip_serializing_if = "Option::is_none")]
11794    currency: Option<stripe_types::Currency>,
11795    #[serde(skip_serializing_if = "Option::is_none")]
11796    customer: Option<String>,
11797    #[serde(skip_serializing_if = "Option::is_none")]
11798    description: Option<String>,
11799    #[serde(skip_serializing_if = "Option::is_none")]
11800    excluded_payment_method_types:
11801        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
11802    #[serde(skip_serializing_if = "Option::is_none")]
11803    expand: Option<Vec<String>>,
11804    #[serde(skip_serializing_if = "Option::is_none")]
11805    hooks: Option<AsyncWorkflowsParam>,
11806    #[serde(skip_serializing_if = "Option::is_none")]
11807    metadata: Option<std::collections::HashMap<String, String>>,
11808    #[serde(skip_serializing_if = "Option::is_none")]
11809    payment_details: Option<UpdatePaymentIntentPaymentDetails>,
11810    #[serde(skip_serializing_if = "Option::is_none")]
11811    payment_method: Option<String>,
11812    #[serde(skip_serializing_if = "Option::is_none")]
11813    payment_method_configuration: Option<String>,
11814    #[serde(skip_serializing_if = "Option::is_none")]
11815    payment_method_data: Option<UpdatePaymentIntentPaymentMethodData>,
11816    #[serde(skip_serializing_if = "Option::is_none")]
11817    payment_method_options: Option<UpdatePaymentIntentPaymentMethodOptions>,
11818    #[serde(skip_serializing_if = "Option::is_none")]
11819    payment_method_types: Option<Vec<String>>,
11820    #[serde(skip_serializing_if = "Option::is_none")]
11821    receipt_email: Option<String>,
11822    #[serde(skip_serializing_if = "Option::is_none")]
11823    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
11824    #[serde(skip_serializing_if = "Option::is_none")]
11825    shipping: Option<UpdatePaymentIntentShipping>,
11826    #[serde(skip_serializing_if = "Option::is_none")]
11827    statement_descriptor: Option<String>,
11828    #[serde(skip_serializing_if = "Option::is_none")]
11829    statement_descriptor_suffix: Option<String>,
11830    #[serde(skip_serializing_if = "Option::is_none")]
11831    transfer_data: Option<UpdatePaymentIntentTransferData>,
11832    #[serde(skip_serializing_if = "Option::is_none")]
11833    transfer_group: Option<String>,
11834}
11835impl UpdatePaymentIntentBuilder {
11836    fn new() -> Self {
11837        Self {
11838            amount: None,
11839            amount_details: None,
11840            application_fee_amount: None,
11841            capture_method: None,
11842            currency: None,
11843            customer: None,
11844            description: None,
11845            excluded_payment_method_types: None,
11846            expand: None,
11847            hooks: None,
11848            metadata: None,
11849            payment_details: None,
11850            payment_method: None,
11851            payment_method_configuration: None,
11852            payment_method_data: None,
11853            payment_method_options: None,
11854            payment_method_types: None,
11855            receipt_email: None,
11856            setup_future_usage: None,
11857            shipping: None,
11858            statement_descriptor: None,
11859            statement_descriptor_suffix: None,
11860            transfer_data: None,
11861            transfer_group: None,
11862        }
11863    }
11864}
11865/// Provides industry-specific information about the amount.
11866#[derive(Clone, Debug, serde::Serialize)]
11867pub struct UpdatePaymentIntentAmountDetails {
11868    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11869    /// An integer greater than 0.
11870    ///
11871    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
11872    #[serde(skip_serializing_if = "Option::is_none")]
11873    pub discount_amount: Option<i64>,
11874    /// A list of line items, each containing information about a product in the PaymentIntent.
11875    /// There is a maximum of 100 line items.
11876    #[serde(skip_serializing_if = "Option::is_none")]
11877    pub line_items: Option<Vec<UpdatePaymentIntentAmountDetailsLineItems>>,
11878    /// Contains information about the shipping portion of the amount.
11879    #[serde(skip_serializing_if = "Option::is_none")]
11880    pub shipping: Option<AmountDetailsShippingParam>,
11881    /// Contains information about the tax portion of the amount.
11882    #[serde(skip_serializing_if = "Option::is_none")]
11883    pub tax: Option<AmountDetailsTaxParam>,
11884}
11885impl UpdatePaymentIntentAmountDetails {
11886    pub fn new() -> Self {
11887        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
11888    }
11889}
11890impl Default for UpdatePaymentIntentAmountDetails {
11891    fn default() -> Self {
11892        Self::new()
11893    }
11894}
11895/// A list of line items, each containing information about a product in the PaymentIntent.
11896/// There is a maximum of 100 line items.
11897#[derive(Clone, Debug, serde::Serialize)]
11898pub struct UpdatePaymentIntentAmountDetailsLineItems {
11899    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11900    /// An integer greater than 0.
11901    ///
11902    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
11903    #[serde(skip_serializing_if = "Option::is_none")]
11904    pub discount_amount: Option<i64>,
11905    /// Payment method-specific information for line items.
11906    #[serde(skip_serializing_if = "Option::is_none")]
11907    pub payment_method_options:
11908        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
11909    /// The product code of the line item, such as an SKU.
11910    /// Required for L3 rates.
11911    /// At most 12 characters long.
11912    #[serde(skip_serializing_if = "Option::is_none")]
11913    pub product_code: Option<String>,
11914    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
11915    ///
11916    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
11917    /// For Paypal, this field is truncated to 127 characters.
11918    pub product_name: String,
11919    /// The quantity of items. Required for L3 rates. An integer greater than 0.
11920    pub quantity: u64,
11921    /// Contains information about the tax on the item.
11922    #[serde(skip_serializing_if = "Option::is_none")]
11923    pub tax: Option<AmountDetailsLineItemTaxParam>,
11924    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11925    /// Required for L3 rates.
11926    /// An integer greater than or equal to 0.
11927    pub unit_cost: i64,
11928    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
11929    #[serde(skip_serializing_if = "Option::is_none")]
11930    pub unit_of_measure: Option<String>,
11931}
11932impl UpdatePaymentIntentAmountDetailsLineItems {
11933    pub fn new(
11934        product_name: impl Into<String>,
11935        quantity: impl Into<u64>,
11936        unit_cost: impl Into<i64>,
11937    ) -> Self {
11938        Self {
11939            discount_amount: None,
11940            payment_method_options: None,
11941            product_code: None,
11942            product_name: product_name.into(),
11943            quantity: quantity.into(),
11944            tax: None,
11945            unit_cost: unit_cost.into(),
11946            unit_of_measure: None,
11947        }
11948    }
11949}
11950/// Payment method-specific information for line items.
11951#[derive(Clone, Debug, serde::Serialize)]
11952pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
11953    /// This sub-hash contains line item details that are specific to `card` payment method."
11954    #[serde(skip_serializing_if = "Option::is_none")]
11955    pub card: Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
11956    /// This sub-hash contains line item details that are specific to `card_present` payment method."
11957    #[serde(skip_serializing_if = "Option::is_none")]
11958    pub card_present:
11959        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
11960    /// This sub-hash contains line item details that are specific to `klarna` payment method."
11961    #[serde(skip_serializing_if = "Option::is_none")]
11962    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
11963    /// This sub-hash contains line item details that are specific to `paypal` payment method."
11964    #[serde(skip_serializing_if = "Option::is_none")]
11965    pub paypal: Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
11966}
11967impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
11968    pub fn new() -> Self {
11969        Self { card: None, card_present: None, klarna: None, paypal: None }
11970    }
11971}
11972impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
11973    fn default() -> Self {
11974        Self::new()
11975    }
11976}
11977/// This sub-hash contains line item details that are specific to `card` payment method."
11978#[derive(Clone, Debug, serde::Serialize)]
11979pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
11980    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
11981    #[serde(skip_serializing_if = "Option::is_none")]
11982    pub commodity_code: Option<String>,
11983}
11984impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
11985    pub fn new() -> Self {
11986        Self { commodity_code: None }
11987    }
11988}
11989impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
11990    fn default() -> Self {
11991        Self::new()
11992    }
11993}
11994/// This sub-hash contains line item details that are specific to `card_present` payment method."
11995#[derive(Clone, Debug, serde::Serialize)]
11996pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
11997    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
11998    #[serde(skip_serializing_if = "Option::is_none")]
11999    pub commodity_code: Option<String>,
12000}
12001impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
12002    pub fn new() -> Self {
12003        Self { commodity_code: None }
12004    }
12005}
12006impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
12007    fn default() -> Self {
12008        Self::new()
12009    }
12010}
12011/// This sub-hash contains line item details that are specific to `paypal` payment method."
12012#[derive(Clone, Debug, serde::Serialize)]
12013pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
12014    /// Type of the line item.
12015    #[serde(skip_serializing_if = "Option::is_none")]
12016    pub category:
12017        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
12018    /// Description of the line item.
12019    #[serde(skip_serializing_if = "Option::is_none")]
12020    pub description: Option<String>,
12021    /// The Stripe account ID of the connected account that sells the item.
12022    #[serde(skip_serializing_if = "Option::is_none")]
12023    pub sold_by: Option<String>,
12024}
12025impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
12026    pub fn new() -> Self {
12027        Self { category: None, description: None, sold_by: None }
12028    }
12029}
12030impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
12031    fn default() -> Self {
12032        Self::new()
12033    }
12034}
12035/// Type of the line item.
12036#[derive(Copy, Clone, Eq, PartialEq)]
12037pub enum UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
12038    DigitalGoods,
12039    Donation,
12040    PhysicalGoods,
12041}
12042impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
12043    pub fn as_str(self) -> &'static str {
12044        use UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
12045        match self {
12046            DigitalGoods => "digital_goods",
12047            Donation => "donation",
12048            PhysicalGoods => "physical_goods",
12049        }
12050    }
12051}
12052
12053impl std::str::FromStr
12054    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
12055{
12056    type Err = stripe_types::StripeParseError;
12057    fn from_str(s: &str) -> Result<Self, Self::Err> {
12058        use UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
12059        match s {
12060            "digital_goods" => Ok(DigitalGoods),
12061            "donation" => Ok(Donation),
12062            "physical_goods" => Ok(PhysicalGoods),
12063            _ => Err(stripe_types::StripeParseError),
12064        }
12065    }
12066}
12067impl std::fmt::Display
12068    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
12069{
12070    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12071        f.write_str(self.as_str())
12072    }
12073}
12074
12075impl std::fmt::Debug
12076    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
12077{
12078    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12079        f.write_str(self.as_str())
12080    }
12081}
12082impl serde::Serialize
12083    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
12084{
12085    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12086    where
12087        S: serde::Serializer,
12088    {
12089        serializer.serialize_str(self.as_str())
12090    }
12091}
12092#[cfg(feature = "deserialize")]
12093impl<'de> serde::Deserialize<'de>
12094    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
12095{
12096    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12097        use std::str::FromStr;
12098        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12099        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
12100    }
12101}
12102/// Provides industry-specific information about the charge.
12103#[derive(Clone, Debug, serde::Serialize)]
12104pub struct UpdatePaymentIntentPaymentDetails {
12105    /// A unique value to identify the customer. This field is available only for card payments.
12106    ///
12107    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
12108    #[serde(skip_serializing_if = "Option::is_none")]
12109    pub customer_reference: Option<String>,
12110    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
12111    ///
12112    /// Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`.
12113    ///
12114    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
12115    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
12116    #[serde(skip_serializing_if = "Option::is_none")]
12117    pub order_reference: Option<String>,
12118}
12119impl UpdatePaymentIntentPaymentDetails {
12120    pub fn new() -> Self {
12121        Self { customer_reference: None, order_reference: None }
12122    }
12123}
12124impl Default for UpdatePaymentIntentPaymentDetails {
12125    fn default() -> Self {
12126        Self::new()
12127    }
12128}
12129/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
12130/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
12131/// property on the PaymentIntent.
12132#[derive(Clone, Debug, serde::Serialize)]
12133pub struct UpdatePaymentIntentPaymentMethodData {
12134    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
12135    #[serde(skip_serializing_if = "Option::is_none")]
12136    pub acss_debit: Option<PaymentMethodParam>,
12137    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
12138    #[serde(skip_serializing_if = "Option::is_none")]
12139    #[serde(with = "stripe_types::with_serde_json_opt")]
12140    pub affirm: Option<miniserde::json::Value>,
12141    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
12142    #[serde(skip_serializing_if = "Option::is_none")]
12143    #[serde(with = "stripe_types::with_serde_json_opt")]
12144    pub afterpay_clearpay: Option<miniserde::json::Value>,
12145    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
12146    #[serde(skip_serializing_if = "Option::is_none")]
12147    #[serde(with = "stripe_types::with_serde_json_opt")]
12148    pub alipay: Option<miniserde::json::Value>,
12149    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
12150    /// 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.
12151    /// The field defaults to `unspecified`.
12152    #[serde(skip_serializing_if = "Option::is_none")]
12153    pub allow_redisplay: Option<UpdatePaymentIntentPaymentMethodDataAllowRedisplay>,
12154    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
12155    #[serde(skip_serializing_if = "Option::is_none")]
12156    #[serde(with = "stripe_types::with_serde_json_opt")]
12157    pub alma: Option<miniserde::json::Value>,
12158    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
12159    #[serde(skip_serializing_if = "Option::is_none")]
12160    #[serde(with = "stripe_types::with_serde_json_opt")]
12161    pub amazon_pay: Option<miniserde::json::Value>,
12162    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
12163    #[serde(skip_serializing_if = "Option::is_none")]
12164    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodDataAuBecsDebit>,
12165    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
12166    #[serde(skip_serializing_if = "Option::is_none")]
12167    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodDataBacsDebit>,
12168    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
12169    #[serde(skip_serializing_if = "Option::is_none")]
12170    #[serde(with = "stripe_types::with_serde_json_opt")]
12171    pub bancontact: Option<miniserde::json::Value>,
12172    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
12173    #[serde(skip_serializing_if = "Option::is_none")]
12174    #[serde(with = "stripe_types::with_serde_json_opt")]
12175    pub billie: Option<miniserde::json::Value>,
12176    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
12177    #[serde(skip_serializing_if = "Option::is_none")]
12178    pub billing_details: Option<UpdatePaymentIntentPaymentMethodDataBillingDetails>,
12179    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
12180    #[serde(skip_serializing_if = "Option::is_none")]
12181    #[serde(with = "stripe_types::with_serde_json_opt")]
12182    pub blik: Option<miniserde::json::Value>,
12183    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
12184    #[serde(skip_serializing_if = "Option::is_none")]
12185    pub boleto: Option<UpdatePaymentIntentPaymentMethodDataBoleto>,
12186    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
12187    #[serde(skip_serializing_if = "Option::is_none")]
12188    #[serde(with = "stripe_types::with_serde_json_opt")]
12189    pub cashapp: Option<miniserde::json::Value>,
12190    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
12191    #[serde(skip_serializing_if = "Option::is_none")]
12192    #[serde(with = "stripe_types::with_serde_json_opt")]
12193    pub crypto: Option<miniserde::json::Value>,
12194    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
12195    #[serde(skip_serializing_if = "Option::is_none")]
12196    #[serde(with = "stripe_types::with_serde_json_opt")]
12197    pub customer_balance: Option<miniserde::json::Value>,
12198    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
12199    #[serde(skip_serializing_if = "Option::is_none")]
12200    pub eps: Option<UpdatePaymentIntentPaymentMethodDataEps>,
12201    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
12202    #[serde(skip_serializing_if = "Option::is_none")]
12203    pub fpx: Option<UpdatePaymentIntentPaymentMethodDataFpx>,
12204    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
12205    #[serde(skip_serializing_if = "Option::is_none")]
12206    #[serde(with = "stripe_types::with_serde_json_opt")]
12207    pub giropay: Option<miniserde::json::Value>,
12208    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
12209    #[serde(skip_serializing_if = "Option::is_none")]
12210    #[serde(with = "stripe_types::with_serde_json_opt")]
12211    pub grabpay: Option<miniserde::json::Value>,
12212    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
12213    #[serde(skip_serializing_if = "Option::is_none")]
12214    pub ideal: Option<UpdatePaymentIntentPaymentMethodDataIdeal>,
12215    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
12216    #[serde(skip_serializing_if = "Option::is_none")]
12217    #[serde(with = "stripe_types::with_serde_json_opt")]
12218    pub interac_present: Option<miniserde::json::Value>,
12219    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
12220    #[serde(skip_serializing_if = "Option::is_none")]
12221    #[serde(with = "stripe_types::with_serde_json_opt")]
12222    pub kakao_pay: Option<miniserde::json::Value>,
12223    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
12224    #[serde(skip_serializing_if = "Option::is_none")]
12225    pub klarna: Option<UpdatePaymentIntentPaymentMethodDataKlarna>,
12226    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
12227    #[serde(skip_serializing_if = "Option::is_none")]
12228    #[serde(with = "stripe_types::with_serde_json_opt")]
12229    pub konbini: Option<miniserde::json::Value>,
12230    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
12231    #[serde(skip_serializing_if = "Option::is_none")]
12232    #[serde(with = "stripe_types::with_serde_json_opt")]
12233    pub kr_card: Option<miniserde::json::Value>,
12234    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
12235    #[serde(skip_serializing_if = "Option::is_none")]
12236    #[serde(with = "stripe_types::with_serde_json_opt")]
12237    pub link: Option<miniserde::json::Value>,
12238    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
12239    #[serde(skip_serializing_if = "Option::is_none")]
12240    #[serde(with = "stripe_types::with_serde_json_opt")]
12241    pub mb_way: Option<miniserde::json::Value>,
12242    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
12243    /// This can be useful for storing additional information about the object in a structured format.
12244    /// Individual keys can be unset by posting an empty value to them.
12245    /// All keys can be unset by posting an empty value to `metadata`.
12246    #[serde(skip_serializing_if = "Option::is_none")]
12247    pub metadata: Option<std::collections::HashMap<String, String>>,
12248    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
12249    #[serde(skip_serializing_if = "Option::is_none")]
12250    #[serde(with = "stripe_types::with_serde_json_opt")]
12251    pub mobilepay: Option<miniserde::json::Value>,
12252    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
12253    #[serde(skip_serializing_if = "Option::is_none")]
12254    #[serde(with = "stripe_types::with_serde_json_opt")]
12255    pub multibanco: Option<miniserde::json::Value>,
12256    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
12257    #[serde(skip_serializing_if = "Option::is_none")]
12258    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodDataNaverPay>,
12259    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
12260    #[serde(skip_serializing_if = "Option::is_none")]
12261    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodDataNzBankAccount>,
12262    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
12263    #[serde(skip_serializing_if = "Option::is_none")]
12264    #[serde(with = "stripe_types::with_serde_json_opt")]
12265    pub oxxo: Option<miniserde::json::Value>,
12266    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
12267    #[serde(skip_serializing_if = "Option::is_none")]
12268    pub p24: Option<UpdatePaymentIntentPaymentMethodDataP24>,
12269    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
12270    #[serde(skip_serializing_if = "Option::is_none")]
12271    #[serde(with = "stripe_types::with_serde_json_opt")]
12272    pub pay_by_bank: Option<miniserde::json::Value>,
12273    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
12274    #[serde(skip_serializing_if = "Option::is_none")]
12275    #[serde(with = "stripe_types::with_serde_json_opt")]
12276    pub payco: Option<miniserde::json::Value>,
12277    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
12278    #[serde(skip_serializing_if = "Option::is_none")]
12279    #[serde(with = "stripe_types::with_serde_json_opt")]
12280    pub paynow: Option<miniserde::json::Value>,
12281    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
12282    #[serde(skip_serializing_if = "Option::is_none")]
12283    #[serde(with = "stripe_types::with_serde_json_opt")]
12284    pub paypal: Option<miniserde::json::Value>,
12285    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
12286    #[serde(skip_serializing_if = "Option::is_none")]
12287    #[serde(with = "stripe_types::with_serde_json_opt")]
12288    pub pix: Option<miniserde::json::Value>,
12289    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
12290    #[serde(skip_serializing_if = "Option::is_none")]
12291    #[serde(with = "stripe_types::with_serde_json_opt")]
12292    pub promptpay: Option<miniserde::json::Value>,
12293    /// Options to configure Radar.
12294    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
12295    #[serde(skip_serializing_if = "Option::is_none")]
12296    pub radar_options: Option<UpdatePaymentIntentPaymentMethodDataRadarOptions>,
12297    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
12298    #[serde(skip_serializing_if = "Option::is_none")]
12299    #[serde(with = "stripe_types::with_serde_json_opt")]
12300    pub revolut_pay: Option<miniserde::json::Value>,
12301    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
12302    #[serde(skip_serializing_if = "Option::is_none")]
12303    #[serde(with = "stripe_types::with_serde_json_opt")]
12304    pub samsung_pay: Option<miniserde::json::Value>,
12305    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
12306    #[serde(skip_serializing_if = "Option::is_none")]
12307    #[serde(with = "stripe_types::with_serde_json_opt")]
12308    pub satispay: Option<miniserde::json::Value>,
12309    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
12310    #[serde(skip_serializing_if = "Option::is_none")]
12311    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodDataSepaDebit>,
12312    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
12313    #[serde(skip_serializing_if = "Option::is_none")]
12314    pub sofort: Option<UpdatePaymentIntentPaymentMethodDataSofort>,
12315    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
12316    #[serde(skip_serializing_if = "Option::is_none")]
12317    #[serde(with = "stripe_types::with_serde_json_opt")]
12318    pub swish: Option<miniserde::json::Value>,
12319    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
12320    #[serde(skip_serializing_if = "Option::is_none")]
12321    #[serde(with = "stripe_types::with_serde_json_opt")]
12322    pub twint: Option<miniserde::json::Value>,
12323    /// The type of the PaymentMethod.
12324    /// An additional hash is included on the PaymentMethod with a name matching this value.
12325    /// It contains additional information specific to the PaymentMethod type.
12326    #[serde(rename = "type")]
12327    pub type_: UpdatePaymentIntentPaymentMethodDataType,
12328    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
12329    #[serde(skip_serializing_if = "Option::is_none")]
12330    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccount>,
12331    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
12332    #[serde(skip_serializing_if = "Option::is_none")]
12333    #[serde(with = "stripe_types::with_serde_json_opt")]
12334    pub wechat_pay: Option<miniserde::json::Value>,
12335    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
12336    #[serde(skip_serializing_if = "Option::is_none")]
12337    #[serde(with = "stripe_types::with_serde_json_opt")]
12338    pub zip: Option<miniserde::json::Value>,
12339}
12340impl UpdatePaymentIntentPaymentMethodData {
12341    pub fn new(type_: impl Into<UpdatePaymentIntentPaymentMethodDataType>) -> Self {
12342        Self {
12343            acss_debit: None,
12344            affirm: None,
12345            afterpay_clearpay: None,
12346            alipay: None,
12347            allow_redisplay: None,
12348            alma: None,
12349            amazon_pay: None,
12350            au_becs_debit: None,
12351            bacs_debit: None,
12352            bancontact: None,
12353            billie: None,
12354            billing_details: None,
12355            blik: None,
12356            boleto: None,
12357            cashapp: None,
12358            crypto: None,
12359            customer_balance: None,
12360            eps: None,
12361            fpx: None,
12362            giropay: None,
12363            grabpay: None,
12364            ideal: None,
12365            interac_present: None,
12366            kakao_pay: None,
12367            klarna: None,
12368            konbini: None,
12369            kr_card: None,
12370            link: None,
12371            mb_way: None,
12372            metadata: None,
12373            mobilepay: None,
12374            multibanco: None,
12375            naver_pay: None,
12376            nz_bank_account: None,
12377            oxxo: None,
12378            p24: None,
12379            pay_by_bank: None,
12380            payco: None,
12381            paynow: None,
12382            paypal: None,
12383            pix: None,
12384            promptpay: None,
12385            radar_options: None,
12386            revolut_pay: None,
12387            samsung_pay: None,
12388            satispay: None,
12389            sepa_debit: None,
12390            sofort: None,
12391            swish: None,
12392            twint: None,
12393            type_: type_.into(),
12394            us_bank_account: None,
12395            wechat_pay: None,
12396            zip: None,
12397        }
12398    }
12399}
12400/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
12401/// 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.
12402/// The field defaults to `unspecified`.
12403#[derive(Copy, Clone, Eq, PartialEq)]
12404pub enum UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12405    Always,
12406    Limited,
12407    Unspecified,
12408}
12409impl UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12410    pub fn as_str(self) -> &'static str {
12411        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
12412        match self {
12413            Always => "always",
12414            Limited => "limited",
12415            Unspecified => "unspecified",
12416        }
12417    }
12418}
12419
12420impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12421    type Err = stripe_types::StripeParseError;
12422    fn from_str(s: &str) -> Result<Self, Self::Err> {
12423        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
12424        match s {
12425            "always" => Ok(Always),
12426            "limited" => Ok(Limited),
12427            "unspecified" => Ok(Unspecified),
12428            _ => Err(stripe_types::StripeParseError),
12429        }
12430    }
12431}
12432impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12433    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12434        f.write_str(self.as_str())
12435    }
12436}
12437
12438impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12439    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12440        f.write_str(self.as_str())
12441    }
12442}
12443impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12444    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12445    where
12446        S: serde::Serializer,
12447    {
12448        serializer.serialize_str(self.as_str())
12449    }
12450}
12451#[cfg(feature = "deserialize")]
12452impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12453    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12454        use std::str::FromStr;
12455        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12456        Self::from_str(&s).map_err(|_| {
12457            serde::de::Error::custom(
12458                "Unknown value for UpdatePaymentIntentPaymentMethodDataAllowRedisplay",
12459            )
12460        })
12461    }
12462}
12463/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
12464#[derive(Clone, Debug, serde::Serialize)]
12465pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
12466    /// The account number for the bank account.
12467    pub account_number: String,
12468    /// Bank-State-Branch number of the bank account.
12469    pub bsb_number: String,
12470}
12471impl UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
12472    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
12473        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
12474    }
12475}
12476/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
12477#[derive(Clone, Debug, serde::Serialize)]
12478pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit {
12479    /// Account number of the bank account that the funds will be debited from.
12480    #[serde(skip_serializing_if = "Option::is_none")]
12481    pub account_number: Option<String>,
12482    /// Sort code of the bank account. (e.g., `10-20-30`)
12483    #[serde(skip_serializing_if = "Option::is_none")]
12484    pub sort_code: Option<String>,
12485}
12486impl UpdatePaymentIntentPaymentMethodDataBacsDebit {
12487    pub fn new() -> Self {
12488        Self { account_number: None, sort_code: None }
12489    }
12490}
12491impl Default for UpdatePaymentIntentPaymentMethodDataBacsDebit {
12492    fn default() -> Self {
12493        Self::new()
12494    }
12495}
12496/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
12497#[derive(Clone, Debug, serde::Serialize)]
12498pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails {
12499    /// Billing address.
12500    #[serde(skip_serializing_if = "Option::is_none")]
12501    pub address: Option<UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
12502    /// Email address.
12503    #[serde(skip_serializing_if = "Option::is_none")]
12504    pub email: Option<String>,
12505    /// Full name.
12506    #[serde(skip_serializing_if = "Option::is_none")]
12507    pub name: Option<String>,
12508    /// Billing phone number (including extension).
12509    #[serde(skip_serializing_if = "Option::is_none")]
12510    pub phone: Option<String>,
12511    /// Taxpayer identification number.
12512    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
12513    #[serde(skip_serializing_if = "Option::is_none")]
12514    pub tax_id: Option<String>,
12515}
12516impl UpdatePaymentIntentPaymentMethodDataBillingDetails {
12517    pub fn new() -> Self {
12518        Self { address: None, email: None, name: None, phone: None, tax_id: None }
12519    }
12520}
12521impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetails {
12522    fn default() -> Self {
12523        Self::new()
12524    }
12525}
12526/// Billing address.
12527#[derive(Clone, Debug, serde::Serialize)]
12528pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
12529    /// City, district, suburb, town, or village.
12530    #[serde(skip_serializing_if = "Option::is_none")]
12531    pub city: Option<String>,
12532    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
12533    #[serde(skip_serializing_if = "Option::is_none")]
12534    pub country: Option<String>,
12535    /// Address line 1, such as the street, PO Box, or company name.
12536    #[serde(skip_serializing_if = "Option::is_none")]
12537    pub line1: Option<String>,
12538    /// Address line 2, such as the apartment, suite, unit, or building.
12539    #[serde(skip_serializing_if = "Option::is_none")]
12540    pub line2: Option<String>,
12541    /// ZIP or postal code.
12542    #[serde(skip_serializing_if = "Option::is_none")]
12543    pub postal_code: Option<String>,
12544    /// State, county, province, or region.
12545    #[serde(skip_serializing_if = "Option::is_none")]
12546    pub state: Option<String>,
12547}
12548impl UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
12549    pub fn new() -> Self {
12550        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
12551    }
12552}
12553impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
12554    fn default() -> Self {
12555        Self::new()
12556    }
12557}
12558/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
12559#[derive(Clone, Debug, serde::Serialize)]
12560pub struct UpdatePaymentIntentPaymentMethodDataBoleto {
12561    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
12562    pub tax_id: String,
12563}
12564impl UpdatePaymentIntentPaymentMethodDataBoleto {
12565    pub fn new(tax_id: impl Into<String>) -> Self {
12566        Self { tax_id: tax_id.into() }
12567    }
12568}
12569/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
12570#[derive(Clone, Debug, serde::Serialize)]
12571pub struct UpdatePaymentIntentPaymentMethodDataEps {
12572    /// The customer's bank.
12573    #[serde(skip_serializing_if = "Option::is_none")]
12574    pub bank: Option<UpdatePaymentIntentPaymentMethodDataEpsBank>,
12575}
12576impl UpdatePaymentIntentPaymentMethodDataEps {
12577    pub fn new() -> Self {
12578        Self { bank: None }
12579    }
12580}
12581impl Default for UpdatePaymentIntentPaymentMethodDataEps {
12582    fn default() -> Self {
12583        Self::new()
12584    }
12585}
12586/// The customer's bank.
12587#[derive(Clone, Eq, PartialEq)]
12588#[non_exhaustive]
12589pub enum UpdatePaymentIntentPaymentMethodDataEpsBank {
12590    ArzteUndApothekerBank,
12591    AustrianAnadiBankAg,
12592    BankAustria,
12593    BankhausCarlSpangler,
12594    BankhausSchelhammerUndSchatteraAg,
12595    BawagPskAg,
12596    BksBankAg,
12597    BrullKallmusBankAg,
12598    BtvVierLanderBank,
12599    CapitalBankGraweGruppeAg,
12600    DeutscheBankAg,
12601    Dolomitenbank,
12602    EasybankAg,
12603    ErsteBankUndSparkassen,
12604    HypoAlpeadriabankInternationalAg,
12605    HypoBankBurgenlandAktiengesellschaft,
12606    HypoNoeLbFurNiederosterreichUWien,
12607    HypoOberosterreichSalzburgSteiermark,
12608    HypoTirolBankAg,
12609    HypoVorarlbergBankAg,
12610    MarchfelderBank,
12611    OberbankAg,
12612    RaiffeisenBankengruppeOsterreich,
12613    SchoellerbankAg,
12614    SpardaBankWien,
12615    VolksbankGruppe,
12616    VolkskreditbankAg,
12617    VrBankBraunau,
12618    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12619    Unknown(String),
12620}
12621impl UpdatePaymentIntentPaymentMethodDataEpsBank {
12622    pub fn as_str(&self) -> &str {
12623        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
12624        match self {
12625            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
12626            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
12627            BankAustria => "bank_austria",
12628            BankhausCarlSpangler => "bankhaus_carl_spangler",
12629            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
12630            BawagPskAg => "bawag_psk_ag",
12631            BksBankAg => "bks_bank_ag",
12632            BrullKallmusBankAg => "brull_kallmus_bank_ag",
12633            BtvVierLanderBank => "btv_vier_lander_bank",
12634            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
12635            DeutscheBankAg => "deutsche_bank_ag",
12636            Dolomitenbank => "dolomitenbank",
12637            EasybankAg => "easybank_ag",
12638            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
12639            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
12640            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
12641            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
12642            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
12643            HypoTirolBankAg => "hypo_tirol_bank_ag",
12644            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
12645            MarchfelderBank => "marchfelder_bank",
12646            OberbankAg => "oberbank_ag",
12647            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
12648            SchoellerbankAg => "schoellerbank_ag",
12649            SpardaBankWien => "sparda_bank_wien",
12650            VolksbankGruppe => "volksbank_gruppe",
12651            VolkskreditbankAg => "volkskreditbank_ag",
12652            VrBankBraunau => "vr_bank_braunau",
12653            Unknown(v) => v,
12654        }
12655    }
12656}
12657
12658impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataEpsBank {
12659    type Err = std::convert::Infallible;
12660    fn from_str(s: &str) -> Result<Self, Self::Err> {
12661        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
12662        match s {
12663            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
12664            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
12665            "bank_austria" => Ok(BankAustria),
12666            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
12667            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
12668            "bawag_psk_ag" => Ok(BawagPskAg),
12669            "bks_bank_ag" => Ok(BksBankAg),
12670            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
12671            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
12672            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
12673            "deutsche_bank_ag" => Ok(DeutscheBankAg),
12674            "dolomitenbank" => Ok(Dolomitenbank),
12675            "easybank_ag" => Ok(EasybankAg),
12676            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
12677            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
12678            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
12679            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
12680            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
12681            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
12682            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
12683            "marchfelder_bank" => Ok(MarchfelderBank),
12684            "oberbank_ag" => Ok(OberbankAg),
12685            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
12686            "schoellerbank_ag" => Ok(SchoellerbankAg),
12687            "sparda_bank_wien" => Ok(SpardaBankWien),
12688            "volksbank_gruppe" => Ok(VolksbankGruppe),
12689            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
12690            "vr_bank_braunau" => Ok(VrBankBraunau),
12691            v => Ok(Unknown(v.to_owned())),
12692        }
12693    }
12694}
12695impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank {
12696    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12697        f.write_str(self.as_str())
12698    }
12699}
12700
12701impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataEpsBank {
12702    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12703        f.write_str(self.as_str())
12704    }
12705}
12706impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataEpsBank {
12707    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12708    where
12709        S: serde::Serializer,
12710    {
12711        serializer.serialize_str(self.as_str())
12712    }
12713}
12714#[cfg(feature = "deserialize")]
12715impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataEpsBank {
12716    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12717        use std::str::FromStr;
12718        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12719        Ok(Self::from_str(&s).unwrap())
12720    }
12721}
12722/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
12723#[derive(Clone, Debug, serde::Serialize)]
12724pub struct UpdatePaymentIntentPaymentMethodDataFpx {
12725    /// Account holder type for FPX transaction
12726    #[serde(skip_serializing_if = "Option::is_none")]
12727    pub account_holder_type: Option<UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
12728    /// The customer's bank.
12729    pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank,
12730}
12731impl UpdatePaymentIntentPaymentMethodDataFpx {
12732    pub fn new(bank: impl Into<UpdatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
12733        Self { account_holder_type: None, bank: bank.into() }
12734    }
12735}
12736/// Account holder type for FPX transaction
12737#[derive(Copy, Clone, Eq, PartialEq)]
12738pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12739    Company,
12740    Individual,
12741}
12742impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12743    pub fn as_str(self) -> &'static str {
12744        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
12745        match self {
12746            Company => "company",
12747            Individual => "individual",
12748        }
12749    }
12750}
12751
12752impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12753    type Err = stripe_types::StripeParseError;
12754    fn from_str(s: &str) -> Result<Self, Self::Err> {
12755        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
12756        match s {
12757            "company" => Ok(Company),
12758            "individual" => Ok(Individual),
12759            _ => Err(stripe_types::StripeParseError),
12760        }
12761    }
12762}
12763impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12765        f.write_str(self.as_str())
12766    }
12767}
12768
12769impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12771        f.write_str(self.as_str())
12772    }
12773}
12774impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12775    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12776    where
12777        S: serde::Serializer,
12778    {
12779        serializer.serialize_str(self.as_str())
12780    }
12781}
12782#[cfg(feature = "deserialize")]
12783impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12785        use std::str::FromStr;
12786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12787        Self::from_str(&s).map_err(|_| {
12788            serde::de::Error::custom(
12789                "Unknown value for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType",
12790            )
12791        })
12792    }
12793}
12794/// The customer's bank.
12795#[derive(Clone, Eq, PartialEq)]
12796#[non_exhaustive]
12797pub enum UpdatePaymentIntentPaymentMethodDataFpxBank {
12798    AffinBank,
12799    Agrobank,
12800    AllianceBank,
12801    Ambank,
12802    BankIslam,
12803    BankMuamalat,
12804    BankOfChina,
12805    BankRakyat,
12806    Bsn,
12807    Cimb,
12808    DeutscheBank,
12809    HongLeongBank,
12810    Hsbc,
12811    Kfh,
12812    Maybank2e,
12813    Maybank2u,
12814    Ocbc,
12815    PbEnterprise,
12816    PublicBank,
12817    Rhb,
12818    StandardChartered,
12819    Uob,
12820    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12821    Unknown(String),
12822}
12823impl UpdatePaymentIntentPaymentMethodDataFpxBank {
12824    pub fn as_str(&self) -> &str {
12825        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
12826        match self {
12827            AffinBank => "affin_bank",
12828            Agrobank => "agrobank",
12829            AllianceBank => "alliance_bank",
12830            Ambank => "ambank",
12831            BankIslam => "bank_islam",
12832            BankMuamalat => "bank_muamalat",
12833            BankOfChina => "bank_of_china",
12834            BankRakyat => "bank_rakyat",
12835            Bsn => "bsn",
12836            Cimb => "cimb",
12837            DeutscheBank => "deutsche_bank",
12838            HongLeongBank => "hong_leong_bank",
12839            Hsbc => "hsbc",
12840            Kfh => "kfh",
12841            Maybank2e => "maybank2e",
12842            Maybank2u => "maybank2u",
12843            Ocbc => "ocbc",
12844            PbEnterprise => "pb_enterprise",
12845            PublicBank => "public_bank",
12846            Rhb => "rhb",
12847            StandardChartered => "standard_chartered",
12848            Uob => "uob",
12849            Unknown(v) => v,
12850        }
12851    }
12852}
12853
12854impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxBank {
12855    type Err = std::convert::Infallible;
12856    fn from_str(s: &str) -> Result<Self, Self::Err> {
12857        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
12858        match s {
12859            "affin_bank" => Ok(AffinBank),
12860            "agrobank" => Ok(Agrobank),
12861            "alliance_bank" => Ok(AllianceBank),
12862            "ambank" => Ok(Ambank),
12863            "bank_islam" => Ok(BankIslam),
12864            "bank_muamalat" => Ok(BankMuamalat),
12865            "bank_of_china" => Ok(BankOfChina),
12866            "bank_rakyat" => Ok(BankRakyat),
12867            "bsn" => Ok(Bsn),
12868            "cimb" => Ok(Cimb),
12869            "deutsche_bank" => Ok(DeutscheBank),
12870            "hong_leong_bank" => Ok(HongLeongBank),
12871            "hsbc" => Ok(Hsbc),
12872            "kfh" => Ok(Kfh),
12873            "maybank2e" => Ok(Maybank2e),
12874            "maybank2u" => Ok(Maybank2u),
12875            "ocbc" => Ok(Ocbc),
12876            "pb_enterprise" => Ok(PbEnterprise),
12877            "public_bank" => Ok(PublicBank),
12878            "rhb" => Ok(Rhb),
12879            "standard_chartered" => Ok(StandardChartered),
12880            "uob" => Ok(Uob),
12881            v => Ok(Unknown(v.to_owned())),
12882        }
12883    }
12884}
12885impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank {
12886    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12887        f.write_str(self.as_str())
12888    }
12889}
12890
12891impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxBank {
12892    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12893        f.write_str(self.as_str())
12894    }
12895}
12896impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxBank {
12897    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12898    where
12899        S: serde::Serializer,
12900    {
12901        serializer.serialize_str(self.as_str())
12902    }
12903}
12904#[cfg(feature = "deserialize")]
12905impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxBank {
12906    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12907        use std::str::FromStr;
12908        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12909        Ok(Self::from_str(&s).unwrap())
12910    }
12911}
12912/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
12913#[derive(Clone, Debug, serde::Serialize)]
12914pub struct UpdatePaymentIntentPaymentMethodDataIdeal {
12915    /// The customer's bank.
12916    /// Only use this parameter for existing customers.
12917    /// Don't use it for new customers.
12918    #[serde(skip_serializing_if = "Option::is_none")]
12919    pub bank: Option<UpdatePaymentIntentPaymentMethodDataIdealBank>,
12920}
12921impl UpdatePaymentIntentPaymentMethodDataIdeal {
12922    pub fn new() -> Self {
12923        Self { bank: None }
12924    }
12925}
12926impl Default for UpdatePaymentIntentPaymentMethodDataIdeal {
12927    fn default() -> Self {
12928        Self::new()
12929    }
12930}
12931/// The customer's bank.
12932/// Only use this parameter for existing customers.
12933/// Don't use it for new customers.
12934#[derive(Clone, Eq, PartialEq)]
12935#[non_exhaustive]
12936pub enum UpdatePaymentIntentPaymentMethodDataIdealBank {
12937    AbnAmro,
12938    AsnBank,
12939    Bunq,
12940    Buut,
12941    Finom,
12942    Handelsbanken,
12943    Ing,
12944    Knab,
12945    Moneyou,
12946    N26,
12947    Nn,
12948    Rabobank,
12949    Regiobank,
12950    Revolut,
12951    SnsBank,
12952    TriodosBank,
12953    VanLanschot,
12954    Yoursafe,
12955    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12956    Unknown(String),
12957}
12958impl UpdatePaymentIntentPaymentMethodDataIdealBank {
12959    pub fn as_str(&self) -> &str {
12960        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
12961        match self {
12962            AbnAmro => "abn_amro",
12963            AsnBank => "asn_bank",
12964            Bunq => "bunq",
12965            Buut => "buut",
12966            Finom => "finom",
12967            Handelsbanken => "handelsbanken",
12968            Ing => "ing",
12969            Knab => "knab",
12970            Moneyou => "moneyou",
12971            N26 => "n26",
12972            Nn => "nn",
12973            Rabobank => "rabobank",
12974            Regiobank => "regiobank",
12975            Revolut => "revolut",
12976            SnsBank => "sns_bank",
12977            TriodosBank => "triodos_bank",
12978            VanLanschot => "van_lanschot",
12979            Yoursafe => "yoursafe",
12980            Unknown(v) => v,
12981        }
12982    }
12983}
12984
12985impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataIdealBank {
12986    type Err = std::convert::Infallible;
12987    fn from_str(s: &str) -> Result<Self, Self::Err> {
12988        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
12989        match s {
12990            "abn_amro" => Ok(AbnAmro),
12991            "asn_bank" => Ok(AsnBank),
12992            "bunq" => Ok(Bunq),
12993            "buut" => Ok(Buut),
12994            "finom" => Ok(Finom),
12995            "handelsbanken" => Ok(Handelsbanken),
12996            "ing" => Ok(Ing),
12997            "knab" => Ok(Knab),
12998            "moneyou" => Ok(Moneyou),
12999            "n26" => Ok(N26),
13000            "nn" => Ok(Nn),
13001            "rabobank" => Ok(Rabobank),
13002            "regiobank" => Ok(Regiobank),
13003            "revolut" => Ok(Revolut),
13004            "sns_bank" => Ok(SnsBank),
13005            "triodos_bank" => Ok(TriodosBank),
13006            "van_lanschot" => Ok(VanLanschot),
13007            "yoursafe" => Ok(Yoursafe),
13008            v => Ok(Unknown(v.to_owned())),
13009        }
13010    }
13011}
13012impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank {
13013    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13014        f.write_str(self.as_str())
13015    }
13016}
13017
13018impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataIdealBank {
13019    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13020        f.write_str(self.as_str())
13021    }
13022}
13023impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataIdealBank {
13024    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13025    where
13026        S: serde::Serializer,
13027    {
13028        serializer.serialize_str(self.as_str())
13029    }
13030}
13031#[cfg(feature = "deserialize")]
13032impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataIdealBank {
13033    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13034        use std::str::FromStr;
13035        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13036        Ok(Self::from_str(&s).unwrap())
13037    }
13038}
13039/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
13040#[derive(Copy, Clone, Debug, serde::Serialize)]
13041pub struct UpdatePaymentIntentPaymentMethodDataKlarna {
13042    /// Customer's date of birth
13043    #[serde(skip_serializing_if = "Option::is_none")]
13044    pub dob: Option<DateOfBirth>,
13045}
13046impl UpdatePaymentIntentPaymentMethodDataKlarna {
13047    pub fn new() -> Self {
13048        Self { dob: None }
13049    }
13050}
13051impl Default for UpdatePaymentIntentPaymentMethodDataKlarna {
13052    fn default() -> Self {
13053        Self::new()
13054    }
13055}
13056/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
13057#[derive(Copy, Clone, Debug, serde::Serialize)]
13058pub struct UpdatePaymentIntentPaymentMethodDataNaverPay {
13059    /// Whether to use Naver Pay points or a card to fund this transaction.
13060    /// If not provided, this defaults to `card`.
13061    #[serde(skip_serializing_if = "Option::is_none")]
13062    pub funding: Option<UpdatePaymentIntentPaymentMethodDataNaverPayFunding>,
13063}
13064impl UpdatePaymentIntentPaymentMethodDataNaverPay {
13065    pub fn new() -> Self {
13066        Self { funding: None }
13067    }
13068}
13069impl Default for UpdatePaymentIntentPaymentMethodDataNaverPay {
13070    fn default() -> Self {
13071        Self::new()
13072    }
13073}
13074/// Whether to use Naver Pay points or a card to fund this transaction.
13075/// If not provided, this defaults to `card`.
13076#[derive(Copy, Clone, Eq, PartialEq)]
13077pub enum UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13078    Card,
13079    Points,
13080}
13081impl UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13082    pub fn as_str(self) -> &'static str {
13083        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
13084        match self {
13085            Card => "card",
13086            Points => "points",
13087        }
13088    }
13089}
13090
13091impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13092    type Err = stripe_types::StripeParseError;
13093    fn from_str(s: &str) -> Result<Self, Self::Err> {
13094        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
13095        match s {
13096            "card" => Ok(Card),
13097            "points" => Ok(Points),
13098            _ => Err(stripe_types::StripeParseError),
13099        }
13100    }
13101}
13102impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13104        f.write_str(self.as_str())
13105    }
13106}
13107
13108impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13109    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13110        f.write_str(self.as_str())
13111    }
13112}
13113impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13114    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13115    where
13116        S: serde::Serializer,
13117    {
13118        serializer.serialize_str(self.as_str())
13119    }
13120}
13121#[cfg(feature = "deserialize")]
13122impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13123    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13124        use std::str::FromStr;
13125        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13126        Self::from_str(&s).map_err(|_| {
13127            serde::de::Error::custom(
13128                "Unknown value for UpdatePaymentIntentPaymentMethodDataNaverPayFunding",
13129            )
13130        })
13131    }
13132}
13133/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
13134#[derive(Clone, Debug, serde::Serialize)]
13135pub struct UpdatePaymentIntentPaymentMethodDataNzBankAccount {
13136    /// The name on the bank account.
13137    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
13138    #[serde(skip_serializing_if = "Option::is_none")]
13139    pub account_holder_name: Option<String>,
13140    /// The account number for the bank account.
13141    pub account_number: String,
13142    /// The numeric code for the bank account's bank.
13143    pub bank_code: String,
13144    /// The numeric code for the bank account's bank branch.
13145    pub branch_code: String,
13146    #[serde(skip_serializing_if = "Option::is_none")]
13147    pub reference: Option<String>,
13148    /// The suffix of the bank account number.
13149    pub suffix: String,
13150}
13151impl UpdatePaymentIntentPaymentMethodDataNzBankAccount {
13152    pub fn new(
13153        account_number: impl Into<String>,
13154        bank_code: impl Into<String>,
13155        branch_code: impl Into<String>,
13156        suffix: impl Into<String>,
13157    ) -> Self {
13158        Self {
13159            account_holder_name: None,
13160            account_number: account_number.into(),
13161            bank_code: bank_code.into(),
13162            branch_code: branch_code.into(),
13163            reference: None,
13164            suffix: suffix.into(),
13165        }
13166    }
13167}
13168/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
13169#[derive(Clone, Debug, serde::Serialize)]
13170pub struct UpdatePaymentIntentPaymentMethodDataP24 {
13171    /// The customer's bank.
13172    #[serde(skip_serializing_if = "Option::is_none")]
13173    pub bank: Option<UpdatePaymentIntentPaymentMethodDataP24Bank>,
13174}
13175impl UpdatePaymentIntentPaymentMethodDataP24 {
13176    pub fn new() -> Self {
13177        Self { bank: None }
13178    }
13179}
13180impl Default for UpdatePaymentIntentPaymentMethodDataP24 {
13181    fn default() -> Self {
13182        Self::new()
13183    }
13184}
13185/// The customer's bank.
13186#[derive(Clone, Eq, PartialEq)]
13187#[non_exhaustive]
13188pub enum UpdatePaymentIntentPaymentMethodDataP24Bank {
13189    AliorBank,
13190    BankMillennium,
13191    BankNowyBfgSa,
13192    BankPekaoSa,
13193    BankiSpbdzielcze,
13194    Blik,
13195    BnpParibas,
13196    Boz,
13197    CitiHandlowy,
13198    CreditAgricole,
13199    Envelobank,
13200    EtransferPocztowy24,
13201    GetinBank,
13202    Ideabank,
13203    Ing,
13204    Inteligo,
13205    MbankMtransfer,
13206    NestPrzelew,
13207    NoblePay,
13208    PbacZIpko,
13209    PlusBank,
13210    SantanderPrzelew24,
13211    TmobileUsbugiBankowe,
13212    ToyotaBank,
13213    Velobank,
13214    VolkswagenBank,
13215    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13216    Unknown(String),
13217}
13218impl UpdatePaymentIntentPaymentMethodDataP24Bank {
13219    pub fn as_str(&self) -> &str {
13220        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
13221        match self {
13222            AliorBank => "alior_bank",
13223            BankMillennium => "bank_millennium",
13224            BankNowyBfgSa => "bank_nowy_bfg_sa",
13225            BankPekaoSa => "bank_pekao_sa",
13226            BankiSpbdzielcze => "banki_spbdzielcze",
13227            Blik => "blik",
13228            BnpParibas => "bnp_paribas",
13229            Boz => "boz",
13230            CitiHandlowy => "citi_handlowy",
13231            CreditAgricole => "credit_agricole",
13232            Envelobank => "envelobank",
13233            EtransferPocztowy24 => "etransfer_pocztowy24",
13234            GetinBank => "getin_bank",
13235            Ideabank => "ideabank",
13236            Ing => "ing",
13237            Inteligo => "inteligo",
13238            MbankMtransfer => "mbank_mtransfer",
13239            NestPrzelew => "nest_przelew",
13240            NoblePay => "noble_pay",
13241            PbacZIpko => "pbac_z_ipko",
13242            PlusBank => "plus_bank",
13243            SantanderPrzelew24 => "santander_przelew24",
13244            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
13245            ToyotaBank => "toyota_bank",
13246            Velobank => "velobank",
13247            VolkswagenBank => "volkswagen_bank",
13248            Unknown(v) => v,
13249        }
13250    }
13251}
13252
13253impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataP24Bank {
13254    type Err = std::convert::Infallible;
13255    fn from_str(s: &str) -> Result<Self, Self::Err> {
13256        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
13257        match s {
13258            "alior_bank" => Ok(AliorBank),
13259            "bank_millennium" => Ok(BankMillennium),
13260            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
13261            "bank_pekao_sa" => Ok(BankPekaoSa),
13262            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
13263            "blik" => Ok(Blik),
13264            "bnp_paribas" => Ok(BnpParibas),
13265            "boz" => Ok(Boz),
13266            "citi_handlowy" => Ok(CitiHandlowy),
13267            "credit_agricole" => Ok(CreditAgricole),
13268            "envelobank" => Ok(Envelobank),
13269            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
13270            "getin_bank" => Ok(GetinBank),
13271            "ideabank" => Ok(Ideabank),
13272            "ing" => Ok(Ing),
13273            "inteligo" => Ok(Inteligo),
13274            "mbank_mtransfer" => Ok(MbankMtransfer),
13275            "nest_przelew" => Ok(NestPrzelew),
13276            "noble_pay" => Ok(NoblePay),
13277            "pbac_z_ipko" => Ok(PbacZIpko),
13278            "plus_bank" => Ok(PlusBank),
13279            "santander_przelew24" => Ok(SantanderPrzelew24),
13280            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
13281            "toyota_bank" => Ok(ToyotaBank),
13282            "velobank" => Ok(Velobank),
13283            "volkswagen_bank" => Ok(VolkswagenBank),
13284            v => Ok(Unknown(v.to_owned())),
13285        }
13286    }
13287}
13288impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank {
13289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13290        f.write_str(self.as_str())
13291    }
13292}
13293
13294impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataP24Bank {
13295    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13296        f.write_str(self.as_str())
13297    }
13298}
13299impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataP24Bank {
13300    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13301    where
13302        S: serde::Serializer,
13303    {
13304        serializer.serialize_str(self.as_str())
13305    }
13306}
13307#[cfg(feature = "deserialize")]
13308impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataP24Bank {
13309    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13310        use std::str::FromStr;
13311        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13312        Ok(Self::from_str(&s).unwrap())
13313    }
13314}
13315/// Options to configure Radar.
13316/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
13317#[derive(Clone, Debug, serde::Serialize)]
13318pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions {
13319    /// 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.
13320    #[serde(skip_serializing_if = "Option::is_none")]
13321    pub session: Option<String>,
13322}
13323impl UpdatePaymentIntentPaymentMethodDataRadarOptions {
13324    pub fn new() -> Self {
13325        Self { session: None }
13326    }
13327}
13328impl Default for UpdatePaymentIntentPaymentMethodDataRadarOptions {
13329    fn default() -> Self {
13330        Self::new()
13331    }
13332}
13333/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
13334#[derive(Clone, Debug, serde::Serialize)]
13335pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit {
13336    /// IBAN of the bank account.
13337    pub iban: String,
13338}
13339impl UpdatePaymentIntentPaymentMethodDataSepaDebit {
13340    pub fn new(iban: impl Into<String>) -> Self {
13341        Self { iban: iban.into() }
13342    }
13343}
13344/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
13345#[derive(Copy, Clone, Debug, serde::Serialize)]
13346pub struct UpdatePaymentIntentPaymentMethodDataSofort {
13347    /// Two-letter ISO code representing the country the bank account is located in.
13348    pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry,
13349}
13350impl UpdatePaymentIntentPaymentMethodDataSofort {
13351    pub fn new(country: impl Into<UpdatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
13352        Self { country: country.into() }
13353    }
13354}
13355/// Two-letter ISO code representing the country the bank account is located in.
13356#[derive(Copy, Clone, Eq, PartialEq)]
13357pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry {
13358    At,
13359    Be,
13360    De,
13361    Es,
13362    It,
13363    Nl,
13364}
13365impl UpdatePaymentIntentPaymentMethodDataSofortCountry {
13366    pub fn as_str(self) -> &'static str {
13367        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
13368        match self {
13369            At => "AT",
13370            Be => "BE",
13371            De => "DE",
13372            Es => "ES",
13373            It => "IT",
13374            Nl => "NL",
13375        }
13376    }
13377}
13378
13379impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13380    type Err = stripe_types::StripeParseError;
13381    fn from_str(s: &str) -> Result<Self, Self::Err> {
13382        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
13383        match s {
13384            "AT" => Ok(At),
13385            "BE" => Ok(Be),
13386            "DE" => Ok(De),
13387            "ES" => Ok(Es),
13388            "IT" => Ok(It),
13389            "NL" => Ok(Nl),
13390            _ => Err(stripe_types::StripeParseError),
13391        }
13392    }
13393}
13394impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13395    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13396        f.write_str(self.as_str())
13397    }
13398}
13399
13400impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13401    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13402        f.write_str(self.as_str())
13403    }
13404}
13405impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13406    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13407    where
13408        S: serde::Serializer,
13409    {
13410        serializer.serialize_str(self.as_str())
13411    }
13412}
13413#[cfg(feature = "deserialize")]
13414impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13415    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13416        use std::str::FromStr;
13417        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13418        Self::from_str(&s).map_err(|_| {
13419            serde::de::Error::custom(
13420                "Unknown value for UpdatePaymentIntentPaymentMethodDataSofortCountry",
13421            )
13422        })
13423    }
13424}
13425/// The type of the PaymentMethod.
13426/// An additional hash is included on the PaymentMethod with a name matching this value.
13427/// It contains additional information specific to the PaymentMethod type.
13428#[derive(Clone, Eq, PartialEq)]
13429#[non_exhaustive]
13430pub enum UpdatePaymentIntentPaymentMethodDataType {
13431    AcssDebit,
13432    Affirm,
13433    AfterpayClearpay,
13434    Alipay,
13435    Alma,
13436    AmazonPay,
13437    AuBecsDebit,
13438    BacsDebit,
13439    Bancontact,
13440    Billie,
13441    Blik,
13442    Boleto,
13443    Cashapp,
13444    Crypto,
13445    CustomerBalance,
13446    Eps,
13447    Fpx,
13448    Giropay,
13449    Grabpay,
13450    Ideal,
13451    KakaoPay,
13452    Klarna,
13453    Konbini,
13454    KrCard,
13455    Link,
13456    MbWay,
13457    Mobilepay,
13458    Multibanco,
13459    NaverPay,
13460    NzBankAccount,
13461    Oxxo,
13462    P24,
13463    PayByBank,
13464    Payco,
13465    Paynow,
13466    Paypal,
13467    Pix,
13468    Promptpay,
13469    RevolutPay,
13470    SamsungPay,
13471    Satispay,
13472    SepaDebit,
13473    Sofort,
13474    Swish,
13475    Twint,
13476    UsBankAccount,
13477    WechatPay,
13478    Zip,
13479    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13480    Unknown(String),
13481}
13482impl UpdatePaymentIntentPaymentMethodDataType {
13483    pub fn as_str(&self) -> &str {
13484        use UpdatePaymentIntentPaymentMethodDataType::*;
13485        match self {
13486            AcssDebit => "acss_debit",
13487            Affirm => "affirm",
13488            AfterpayClearpay => "afterpay_clearpay",
13489            Alipay => "alipay",
13490            Alma => "alma",
13491            AmazonPay => "amazon_pay",
13492            AuBecsDebit => "au_becs_debit",
13493            BacsDebit => "bacs_debit",
13494            Bancontact => "bancontact",
13495            Billie => "billie",
13496            Blik => "blik",
13497            Boleto => "boleto",
13498            Cashapp => "cashapp",
13499            Crypto => "crypto",
13500            CustomerBalance => "customer_balance",
13501            Eps => "eps",
13502            Fpx => "fpx",
13503            Giropay => "giropay",
13504            Grabpay => "grabpay",
13505            Ideal => "ideal",
13506            KakaoPay => "kakao_pay",
13507            Klarna => "klarna",
13508            Konbini => "konbini",
13509            KrCard => "kr_card",
13510            Link => "link",
13511            MbWay => "mb_way",
13512            Mobilepay => "mobilepay",
13513            Multibanco => "multibanco",
13514            NaverPay => "naver_pay",
13515            NzBankAccount => "nz_bank_account",
13516            Oxxo => "oxxo",
13517            P24 => "p24",
13518            PayByBank => "pay_by_bank",
13519            Payco => "payco",
13520            Paynow => "paynow",
13521            Paypal => "paypal",
13522            Pix => "pix",
13523            Promptpay => "promptpay",
13524            RevolutPay => "revolut_pay",
13525            SamsungPay => "samsung_pay",
13526            Satispay => "satispay",
13527            SepaDebit => "sepa_debit",
13528            Sofort => "sofort",
13529            Swish => "swish",
13530            Twint => "twint",
13531            UsBankAccount => "us_bank_account",
13532            WechatPay => "wechat_pay",
13533            Zip => "zip",
13534            Unknown(v) => v,
13535        }
13536    }
13537}
13538
13539impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataType {
13540    type Err = std::convert::Infallible;
13541    fn from_str(s: &str) -> Result<Self, Self::Err> {
13542        use UpdatePaymentIntentPaymentMethodDataType::*;
13543        match s {
13544            "acss_debit" => Ok(AcssDebit),
13545            "affirm" => Ok(Affirm),
13546            "afterpay_clearpay" => Ok(AfterpayClearpay),
13547            "alipay" => Ok(Alipay),
13548            "alma" => Ok(Alma),
13549            "amazon_pay" => Ok(AmazonPay),
13550            "au_becs_debit" => Ok(AuBecsDebit),
13551            "bacs_debit" => Ok(BacsDebit),
13552            "bancontact" => Ok(Bancontact),
13553            "billie" => Ok(Billie),
13554            "blik" => Ok(Blik),
13555            "boleto" => Ok(Boleto),
13556            "cashapp" => Ok(Cashapp),
13557            "crypto" => Ok(Crypto),
13558            "customer_balance" => Ok(CustomerBalance),
13559            "eps" => Ok(Eps),
13560            "fpx" => Ok(Fpx),
13561            "giropay" => Ok(Giropay),
13562            "grabpay" => Ok(Grabpay),
13563            "ideal" => Ok(Ideal),
13564            "kakao_pay" => Ok(KakaoPay),
13565            "klarna" => Ok(Klarna),
13566            "konbini" => Ok(Konbini),
13567            "kr_card" => Ok(KrCard),
13568            "link" => Ok(Link),
13569            "mb_way" => Ok(MbWay),
13570            "mobilepay" => Ok(Mobilepay),
13571            "multibanco" => Ok(Multibanco),
13572            "naver_pay" => Ok(NaverPay),
13573            "nz_bank_account" => Ok(NzBankAccount),
13574            "oxxo" => Ok(Oxxo),
13575            "p24" => Ok(P24),
13576            "pay_by_bank" => Ok(PayByBank),
13577            "payco" => Ok(Payco),
13578            "paynow" => Ok(Paynow),
13579            "paypal" => Ok(Paypal),
13580            "pix" => Ok(Pix),
13581            "promptpay" => Ok(Promptpay),
13582            "revolut_pay" => Ok(RevolutPay),
13583            "samsung_pay" => Ok(SamsungPay),
13584            "satispay" => Ok(Satispay),
13585            "sepa_debit" => Ok(SepaDebit),
13586            "sofort" => Ok(Sofort),
13587            "swish" => Ok(Swish),
13588            "twint" => Ok(Twint),
13589            "us_bank_account" => Ok(UsBankAccount),
13590            "wechat_pay" => Ok(WechatPay),
13591            "zip" => Ok(Zip),
13592            v => Ok(Unknown(v.to_owned())),
13593        }
13594    }
13595}
13596impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType {
13597    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13598        f.write_str(self.as_str())
13599    }
13600}
13601
13602impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataType {
13603    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13604        f.write_str(self.as_str())
13605    }
13606}
13607impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataType {
13608    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13609    where
13610        S: serde::Serializer,
13611    {
13612        serializer.serialize_str(self.as_str())
13613    }
13614}
13615#[cfg(feature = "deserialize")]
13616impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataType {
13617    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13618        use std::str::FromStr;
13619        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13620        Ok(Self::from_str(&s).unwrap())
13621    }
13622}
13623/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
13624#[derive(Clone, Debug, serde::Serialize)]
13625pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount {
13626    /// Account holder type: individual or company.
13627    #[serde(skip_serializing_if = "Option::is_none")]
13628    pub account_holder_type:
13629        Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
13630    /// Account number of the bank account.
13631    #[serde(skip_serializing_if = "Option::is_none")]
13632    pub account_number: Option<String>,
13633    /// Account type: checkings or savings. Defaults to checking if omitted.
13634    #[serde(skip_serializing_if = "Option::is_none")]
13635    pub account_type: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
13636    /// The ID of a Financial Connections Account to use as a payment method.
13637    #[serde(skip_serializing_if = "Option::is_none")]
13638    pub financial_connections_account: Option<String>,
13639    /// Routing number of the bank account.
13640    #[serde(skip_serializing_if = "Option::is_none")]
13641    pub routing_number: Option<String>,
13642}
13643impl UpdatePaymentIntentPaymentMethodDataUsBankAccount {
13644    pub fn new() -> Self {
13645        Self {
13646            account_holder_type: None,
13647            account_number: None,
13648            account_type: None,
13649            financial_connections_account: None,
13650            routing_number: None,
13651        }
13652    }
13653}
13654impl Default for UpdatePaymentIntentPaymentMethodDataUsBankAccount {
13655    fn default() -> Self {
13656        Self::new()
13657    }
13658}
13659/// Account holder type: individual or company.
13660#[derive(Copy, Clone, Eq, PartialEq)]
13661pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13662    Company,
13663    Individual,
13664}
13665impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13666    pub fn as_str(self) -> &'static str {
13667        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
13668        match self {
13669            Company => "company",
13670            Individual => "individual",
13671        }
13672    }
13673}
13674
13675impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13676    type Err = stripe_types::StripeParseError;
13677    fn from_str(s: &str) -> Result<Self, Self::Err> {
13678        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
13679        match s {
13680            "company" => Ok(Company),
13681            "individual" => Ok(Individual),
13682            _ => Err(stripe_types::StripeParseError),
13683        }
13684    }
13685}
13686impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13687    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13688        f.write_str(self.as_str())
13689    }
13690}
13691
13692impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13693    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13694        f.write_str(self.as_str())
13695    }
13696}
13697impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13698    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13699    where
13700        S: serde::Serializer,
13701    {
13702        serializer.serialize_str(self.as_str())
13703    }
13704}
13705#[cfg(feature = "deserialize")]
13706impl<'de> serde::Deserialize<'de>
13707    for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
13708{
13709    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13710        use std::str::FromStr;
13711        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13712        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
13713    }
13714}
13715/// Account type: checkings or savings. Defaults to checking if omitted.
13716#[derive(Copy, Clone, Eq, PartialEq)]
13717pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13718    Checking,
13719    Savings,
13720}
13721impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13722    pub fn as_str(self) -> &'static str {
13723        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
13724        match self {
13725            Checking => "checking",
13726            Savings => "savings",
13727        }
13728    }
13729}
13730
13731impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13732    type Err = stripe_types::StripeParseError;
13733    fn from_str(s: &str) -> Result<Self, Self::Err> {
13734        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
13735        match s {
13736            "checking" => Ok(Checking),
13737            "savings" => Ok(Savings),
13738            _ => Err(stripe_types::StripeParseError),
13739        }
13740    }
13741}
13742impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13743    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13744        f.write_str(self.as_str())
13745    }
13746}
13747
13748impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13750        f.write_str(self.as_str())
13751    }
13752}
13753impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13754    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13755    where
13756        S: serde::Serializer,
13757    {
13758        serializer.serialize_str(self.as_str())
13759    }
13760}
13761#[cfg(feature = "deserialize")]
13762impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13763    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13764        use std::str::FromStr;
13765        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13766        Self::from_str(&s).map_err(|_| {
13767            serde::de::Error::custom(
13768                "Unknown value for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType",
13769            )
13770        })
13771    }
13772}
13773/// Payment-method-specific configuration for this PaymentIntent.
13774#[derive(Clone, Debug, serde::Serialize)]
13775pub struct UpdatePaymentIntentPaymentMethodOptions {
13776    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
13777    #[serde(skip_serializing_if = "Option::is_none")]
13778    pub acss_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebit>,
13779    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
13780    #[serde(skip_serializing_if = "Option::is_none")]
13781    pub affirm: Option<UpdatePaymentIntentPaymentMethodOptionsAffirm>,
13782    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
13783    #[serde(skip_serializing_if = "Option::is_none")]
13784    pub afterpay_clearpay: Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
13785    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
13786    #[serde(skip_serializing_if = "Option::is_none")]
13787    pub alipay: Option<UpdatePaymentIntentPaymentMethodOptionsAlipay>,
13788    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
13789    #[serde(skip_serializing_if = "Option::is_none")]
13790    pub alma: Option<UpdatePaymentIntentPaymentMethodOptionsAlma>,
13791    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
13792    #[serde(skip_serializing_if = "Option::is_none")]
13793    pub amazon_pay: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPay>,
13794    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
13795    #[serde(skip_serializing_if = "Option::is_none")]
13796    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
13797    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
13798    #[serde(skip_serializing_if = "Option::is_none")]
13799    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebit>,
13800    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
13801    #[serde(skip_serializing_if = "Option::is_none")]
13802    pub bancontact: Option<UpdatePaymentIntentPaymentMethodOptionsBancontact>,
13803    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
13804    #[serde(skip_serializing_if = "Option::is_none")]
13805    pub billie: Option<UpdatePaymentIntentPaymentMethodOptionsBillie>,
13806    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
13807    #[serde(skip_serializing_if = "Option::is_none")]
13808    pub blik: Option<UpdatePaymentIntentPaymentMethodOptionsBlik>,
13809    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
13810    #[serde(skip_serializing_if = "Option::is_none")]
13811    pub boleto: Option<UpdatePaymentIntentPaymentMethodOptionsBoleto>,
13812    /// Configuration for any card payments attempted on this PaymentIntent.
13813    #[serde(skip_serializing_if = "Option::is_none")]
13814    pub card: Option<UpdatePaymentIntentPaymentMethodOptionsCard>,
13815    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
13816    #[serde(skip_serializing_if = "Option::is_none")]
13817    pub card_present: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresent>,
13818    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
13819    #[serde(skip_serializing_if = "Option::is_none")]
13820    pub cashapp: Option<UpdatePaymentIntentPaymentMethodOptionsCashapp>,
13821    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
13822    #[serde(skip_serializing_if = "Option::is_none")]
13823    pub crypto: Option<UpdatePaymentIntentPaymentMethodOptionsCrypto>,
13824    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
13825    #[serde(skip_serializing_if = "Option::is_none")]
13826    pub customer_balance: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalance>,
13827    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
13828    #[serde(skip_serializing_if = "Option::is_none")]
13829    pub eps: Option<UpdatePaymentIntentPaymentMethodOptionsEps>,
13830    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
13831    #[serde(skip_serializing_if = "Option::is_none")]
13832    pub fpx: Option<UpdatePaymentIntentPaymentMethodOptionsFpx>,
13833    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
13834    #[serde(skip_serializing_if = "Option::is_none")]
13835    pub giropay: Option<UpdatePaymentIntentPaymentMethodOptionsGiropay>,
13836    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
13837    #[serde(skip_serializing_if = "Option::is_none")]
13838    pub grabpay: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpay>,
13839    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
13840    #[serde(skip_serializing_if = "Option::is_none")]
13841    pub ideal: Option<UpdatePaymentIntentPaymentMethodOptionsIdeal>,
13842    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
13843    #[serde(skip_serializing_if = "Option::is_none")]
13844    #[serde(with = "stripe_types::with_serde_json_opt")]
13845    pub interac_present: Option<miniserde::json::Value>,
13846    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
13847    #[serde(skip_serializing_if = "Option::is_none")]
13848    pub kakao_pay: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPay>,
13849    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
13850    #[serde(skip_serializing_if = "Option::is_none")]
13851    pub klarna: Option<UpdatePaymentIntentPaymentMethodOptionsKlarna>,
13852    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
13853    #[serde(skip_serializing_if = "Option::is_none")]
13854    pub konbini: Option<UpdatePaymentIntentPaymentMethodOptionsKonbini>,
13855    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
13856    #[serde(skip_serializing_if = "Option::is_none")]
13857    pub kr_card: Option<UpdatePaymentIntentPaymentMethodOptionsKrCard>,
13858    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
13859    #[serde(skip_serializing_if = "Option::is_none")]
13860    pub link: Option<UpdatePaymentIntentPaymentMethodOptionsLink>,
13861    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
13862    #[serde(skip_serializing_if = "Option::is_none")]
13863    pub mb_way: Option<UpdatePaymentIntentPaymentMethodOptionsMbWay>,
13864    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
13865    #[serde(skip_serializing_if = "Option::is_none")]
13866    pub mobilepay: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepay>,
13867    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
13868    #[serde(skip_serializing_if = "Option::is_none")]
13869    pub multibanco: Option<UpdatePaymentIntentPaymentMethodOptionsMultibanco>,
13870    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
13871    #[serde(skip_serializing_if = "Option::is_none")]
13872    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPay>,
13873    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
13874    #[serde(skip_serializing_if = "Option::is_none")]
13875    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccount>,
13876    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
13877    #[serde(skip_serializing_if = "Option::is_none")]
13878    pub oxxo: Option<UpdatePaymentIntentPaymentMethodOptionsOxxo>,
13879    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
13880    #[serde(skip_serializing_if = "Option::is_none")]
13881    pub p24: Option<UpdatePaymentIntentPaymentMethodOptionsP24>,
13882    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
13883    #[serde(skip_serializing_if = "Option::is_none")]
13884    #[serde(with = "stripe_types::with_serde_json_opt")]
13885    pub pay_by_bank: Option<miniserde::json::Value>,
13886    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
13887    #[serde(skip_serializing_if = "Option::is_none")]
13888    pub payco: Option<UpdatePaymentIntentPaymentMethodOptionsPayco>,
13889    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
13890    #[serde(skip_serializing_if = "Option::is_none")]
13891    pub paynow: Option<UpdatePaymentIntentPaymentMethodOptionsPaynow>,
13892    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
13893    #[serde(skip_serializing_if = "Option::is_none")]
13894    pub paypal: Option<UpdatePaymentIntentPaymentMethodOptionsPaypal>,
13895    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
13896    #[serde(skip_serializing_if = "Option::is_none")]
13897    pub pix: Option<UpdatePaymentIntentPaymentMethodOptionsPix>,
13898    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
13899    #[serde(skip_serializing_if = "Option::is_none")]
13900    pub promptpay: Option<UpdatePaymentIntentPaymentMethodOptionsPromptpay>,
13901    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
13902    #[serde(skip_serializing_if = "Option::is_none")]
13903    pub revolut_pay: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPay>,
13904    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
13905    #[serde(skip_serializing_if = "Option::is_none")]
13906    pub samsung_pay: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPay>,
13907    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
13908    #[serde(skip_serializing_if = "Option::is_none")]
13909    pub satispay: Option<UpdatePaymentIntentPaymentMethodOptionsSatispay>,
13910    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
13911    #[serde(skip_serializing_if = "Option::is_none")]
13912    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebit>,
13913    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
13914    #[serde(skip_serializing_if = "Option::is_none")]
13915    pub sofort: Option<UpdatePaymentIntentPaymentMethodOptionsSofort>,
13916    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
13917    #[serde(skip_serializing_if = "Option::is_none")]
13918    pub swish: Option<UpdatePaymentIntentPaymentMethodOptionsSwish>,
13919    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
13920    #[serde(skip_serializing_if = "Option::is_none")]
13921    pub twint: Option<UpdatePaymentIntentPaymentMethodOptionsTwint>,
13922    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
13923    #[serde(skip_serializing_if = "Option::is_none")]
13924    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccount>,
13925    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
13926    #[serde(skip_serializing_if = "Option::is_none")]
13927    pub wechat_pay: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPay>,
13928    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
13929    #[serde(skip_serializing_if = "Option::is_none")]
13930    pub zip: Option<UpdatePaymentIntentPaymentMethodOptionsZip>,
13931}
13932impl UpdatePaymentIntentPaymentMethodOptions {
13933    pub fn new() -> Self {
13934        Self {
13935            acss_debit: None,
13936            affirm: None,
13937            afterpay_clearpay: None,
13938            alipay: None,
13939            alma: None,
13940            amazon_pay: None,
13941            au_becs_debit: None,
13942            bacs_debit: None,
13943            bancontact: None,
13944            billie: None,
13945            blik: None,
13946            boleto: None,
13947            card: None,
13948            card_present: None,
13949            cashapp: None,
13950            crypto: None,
13951            customer_balance: None,
13952            eps: None,
13953            fpx: None,
13954            giropay: None,
13955            grabpay: None,
13956            ideal: None,
13957            interac_present: None,
13958            kakao_pay: None,
13959            klarna: None,
13960            konbini: None,
13961            kr_card: None,
13962            link: None,
13963            mb_way: None,
13964            mobilepay: None,
13965            multibanco: None,
13966            naver_pay: None,
13967            nz_bank_account: None,
13968            oxxo: None,
13969            p24: None,
13970            pay_by_bank: None,
13971            payco: None,
13972            paynow: None,
13973            paypal: None,
13974            pix: None,
13975            promptpay: None,
13976            revolut_pay: None,
13977            samsung_pay: None,
13978            satispay: None,
13979            sepa_debit: None,
13980            sofort: None,
13981            swish: None,
13982            twint: None,
13983            us_bank_account: None,
13984            wechat_pay: None,
13985            zip: None,
13986        }
13987    }
13988}
13989impl Default for UpdatePaymentIntentPaymentMethodOptions {
13990    fn default() -> Self {
13991        Self::new()
13992    }
13993}
13994/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
13995#[derive(Clone, Debug, serde::Serialize)]
13996pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13997    /// Additional fields for Mandate creation
13998    #[serde(skip_serializing_if = "Option::is_none")]
13999    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
14000    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14001    ///
14002    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14003    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14004    ///
14005    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14006    ///
14007    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14008    ///
14009    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14010    #[serde(skip_serializing_if = "Option::is_none")]
14011    pub setup_future_usage:
14012        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
14013    /// Controls when Stripe will attempt to debit the funds from the customer's account.
14014    /// The date must be a string in YYYY-MM-DD format.
14015    /// The date must be in the future and between 3 and 15 calendar days from now.
14016    #[serde(skip_serializing_if = "Option::is_none")]
14017    pub target_date: Option<String>,
14018    /// Bank account verification method.
14019    #[serde(skip_serializing_if = "Option::is_none")]
14020    pub verification_method:
14021        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
14022}
14023impl UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
14024    pub fn new() -> Self {
14025        Self {
14026            mandate_options: None,
14027            setup_future_usage: None,
14028            target_date: None,
14029            verification_method: None,
14030        }
14031    }
14032}
14033impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
14034    fn default() -> Self {
14035        Self::new()
14036    }
14037}
14038/// Additional fields for Mandate creation
14039#[derive(Clone, Debug, serde::Serialize)]
14040pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
14041    /// A URL for custom mandate text to render during confirmation step.
14042    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
14043    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
14044    #[serde(skip_serializing_if = "Option::is_none")]
14045    pub custom_mandate_url: Option<String>,
14046    /// Description of the mandate interval.
14047    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
14048    #[serde(skip_serializing_if = "Option::is_none")]
14049    pub interval_description: Option<String>,
14050    /// Payment schedule for the mandate.
14051    #[serde(skip_serializing_if = "Option::is_none")]
14052    pub payment_schedule:
14053        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
14054    /// Transaction type of the mandate.
14055    #[serde(skip_serializing_if = "Option::is_none")]
14056    pub transaction_type:
14057        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
14058}
14059impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
14060    pub fn new() -> Self {
14061        Self {
14062            custom_mandate_url: None,
14063            interval_description: None,
14064            payment_schedule: None,
14065            transaction_type: None,
14066        }
14067    }
14068}
14069impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
14070    fn default() -> Self {
14071        Self::new()
14072    }
14073}
14074/// Payment schedule for the mandate.
14075#[derive(Copy, Clone, Eq, PartialEq)]
14076pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
14077    Combined,
14078    Interval,
14079    Sporadic,
14080}
14081impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
14082    pub fn as_str(self) -> &'static str {
14083        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
14084        match self {
14085            Combined => "combined",
14086            Interval => "interval",
14087            Sporadic => "sporadic",
14088        }
14089    }
14090}
14091
14092impl std::str::FromStr
14093    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14094{
14095    type Err = stripe_types::StripeParseError;
14096    fn from_str(s: &str) -> Result<Self, Self::Err> {
14097        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
14098        match s {
14099            "combined" => Ok(Combined),
14100            "interval" => Ok(Interval),
14101            "sporadic" => Ok(Sporadic),
14102            _ => Err(stripe_types::StripeParseError),
14103        }
14104    }
14105}
14106impl std::fmt::Display
14107    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14108{
14109    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14110        f.write_str(self.as_str())
14111    }
14112}
14113
14114impl std::fmt::Debug
14115    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14116{
14117    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14118        f.write_str(self.as_str())
14119    }
14120}
14121impl serde::Serialize
14122    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14123{
14124    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14125    where
14126        S: serde::Serializer,
14127    {
14128        serializer.serialize_str(self.as_str())
14129    }
14130}
14131#[cfg(feature = "deserialize")]
14132impl<'de> serde::Deserialize<'de>
14133    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14134{
14135    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14136        use std::str::FromStr;
14137        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14138        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
14139    }
14140}
14141/// Transaction type of the mandate.
14142#[derive(Copy, Clone, Eq, PartialEq)]
14143pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
14144    Business,
14145    Personal,
14146}
14147impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
14148    pub fn as_str(self) -> &'static str {
14149        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
14150        match self {
14151            Business => "business",
14152            Personal => "personal",
14153        }
14154    }
14155}
14156
14157impl std::str::FromStr
14158    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14159{
14160    type Err = stripe_types::StripeParseError;
14161    fn from_str(s: &str) -> Result<Self, Self::Err> {
14162        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
14163        match s {
14164            "business" => Ok(Business),
14165            "personal" => Ok(Personal),
14166            _ => Err(stripe_types::StripeParseError),
14167        }
14168    }
14169}
14170impl std::fmt::Display
14171    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14172{
14173    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14174        f.write_str(self.as_str())
14175    }
14176}
14177
14178impl std::fmt::Debug
14179    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14180{
14181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14182        f.write_str(self.as_str())
14183    }
14184}
14185impl serde::Serialize
14186    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14187{
14188    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14189    where
14190        S: serde::Serializer,
14191    {
14192        serializer.serialize_str(self.as_str())
14193    }
14194}
14195#[cfg(feature = "deserialize")]
14196impl<'de> serde::Deserialize<'de>
14197    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14198{
14199    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14200        use std::str::FromStr;
14201        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14202        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
14203    }
14204}
14205/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14206///
14207/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14208/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14209///
14210/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14211///
14212/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14213///
14214/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14215#[derive(Copy, Clone, Eq, PartialEq)]
14216pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14217    None,
14218    OffSession,
14219    OnSession,
14220}
14221impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14222    pub fn as_str(self) -> &'static str {
14223        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
14224        match self {
14225            None => "none",
14226            OffSession => "off_session",
14227            OnSession => "on_session",
14228        }
14229    }
14230}
14231
14232impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14233    type Err = stripe_types::StripeParseError;
14234    fn from_str(s: &str) -> Result<Self, Self::Err> {
14235        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
14236        match s {
14237            "none" => Ok(None),
14238            "off_session" => Ok(OffSession),
14239            "on_session" => Ok(OnSession),
14240            _ => Err(stripe_types::StripeParseError),
14241        }
14242    }
14243}
14244impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14245    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14246        f.write_str(self.as_str())
14247    }
14248}
14249
14250impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14252        f.write_str(self.as_str())
14253    }
14254}
14255impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14256    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14257    where
14258        S: serde::Serializer,
14259    {
14260        serializer.serialize_str(self.as_str())
14261    }
14262}
14263#[cfg(feature = "deserialize")]
14264impl<'de> serde::Deserialize<'de>
14265    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
14266{
14267    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14268        use std::str::FromStr;
14269        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14270        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
14271    }
14272}
14273/// Bank account verification method.
14274#[derive(Copy, Clone, Eq, PartialEq)]
14275pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14276    Automatic,
14277    Instant,
14278    Microdeposits,
14279}
14280impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14281    pub fn as_str(self) -> &'static str {
14282        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
14283        match self {
14284            Automatic => "automatic",
14285            Instant => "instant",
14286            Microdeposits => "microdeposits",
14287        }
14288    }
14289}
14290
14291impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14292    type Err = stripe_types::StripeParseError;
14293    fn from_str(s: &str) -> Result<Self, Self::Err> {
14294        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
14295        match s {
14296            "automatic" => Ok(Automatic),
14297            "instant" => Ok(Instant),
14298            "microdeposits" => Ok(Microdeposits),
14299            _ => Err(stripe_types::StripeParseError),
14300        }
14301    }
14302}
14303impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14304    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14305        f.write_str(self.as_str())
14306    }
14307}
14308
14309impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14310    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14311        f.write_str(self.as_str())
14312    }
14313}
14314impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14315    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14316    where
14317        S: serde::Serializer,
14318    {
14319        serializer.serialize_str(self.as_str())
14320    }
14321}
14322#[cfg(feature = "deserialize")]
14323impl<'de> serde::Deserialize<'de>
14324    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
14325{
14326    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14327        use std::str::FromStr;
14328        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14329        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
14330    }
14331}
14332/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
14333#[derive(Clone, Debug, serde::Serialize)]
14334pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm {
14335    /// Controls when the funds are captured from the customer's account.
14336    ///
14337    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14338    ///
14339    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14340    #[serde(skip_serializing_if = "Option::is_none")]
14341    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
14342    /// Preferred language of the Affirm authorization page that the customer is redirected to.
14343    #[serde(skip_serializing_if = "Option::is_none")]
14344    pub preferred_locale: Option<String>,
14345    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14346    ///
14347    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14348    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14349    ///
14350    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14351    ///
14352    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14353    ///
14354    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14355    #[serde(skip_serializing_if = "Option::is_none")]
14356    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
14357}
14358impl UpdatePaymentIntentPaymentMethodOptionsAffirm {
14359    pub fn new() -> Self {
14360        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
14361    }
14362}
14363impl Default for UpdatePaymentIntentPaymentMethodOptionsAffirm {
14364    fn default() -> Self {
14365        Self::new()
14366    }
14367}
14368/// Controls when the funds are captured from the customer's account.
14369///
14370/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14371///
14372/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14373#[derive(Copy, Clone, Eq, PartialEq)]
14374pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14375    Manual,
14376}
14377impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14378    pub fn as_str(self) -> &'static str {
14379        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
14380        match self {
14381            Manual => "manual",
14382        }
14383    }
14384}
14385
14386impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14387    type Err = stripe_types::StripeParseError;
14388    fn from_str(s: &str) -> Result<Self, Self::Err> {
14389        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
14390        match s {
14391            "manual" => Ok(Manual),
14392            _ => Err(stripe_types::StripeParseError),
14393        }
14394    }
14395}
14396impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14397    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14398        f.write_str(self.as_str())
14399    }
14400}
14401
14402impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14403    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14404        f.write_str(self.as_str())
14405    }
14406}
14407impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14408    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14409    where
14410        S: serde::Serializer,
14411    {
14412        serializer.serialize_str(self.as_str())
14413    }
14414}
14415#[cfg(feature = "deserialize")]
14416impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14417    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14418        use std::str::FromStr;
14419        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14420        Self::from_str(&s).map_err(|_| {
14421            serde::de::Error::custom(
14422                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
14423            )
14424        })
14425    }
14426}
14427/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14428///
14429/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14430/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14431///
14432/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14433///
14434/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14435///
14436/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14437#[derive(Copy, Clone, Eq, PartialEq)]
14438pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14439    None,
14440}
14441impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14442    pub fn as_str(self) -> &'static str {
14443        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
14444        match self {
14445            None => "none",
14446        }
14447    }
14448}
14449
14450impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14451    type Err = stripe_types::StripeParseError;
14452    fn from_str(s: &str) -> Result<Self, Self::Err> {
14453        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
14454        match s {
14455            "none" => Ok(None),
14456            _ => Err(stripe_types::StripeParseError),
14457        }
14458    }
14459}
14460impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14461    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14462        f.write_str(self.as_str())
14463    }
14464}
14465
14466impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14467    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14468        f.write_str(self.as_str())
14469    }
14470}
14471impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14472    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14473    where
14474        S: serde::Serializer,
14475    {
14476        serializer.serialize_str(self.as_str())
14477    }
14478}
14479#[cfg(feature = "deserialize")]
14480impl<'de> serde::Deserialize<'de>
14481    for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
14482{
14483    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14484        use std::str::FromStr;
14485        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14486        Self::from_str(&s).map_err(|_| {
14487            serde::de::Error::custom(
14488                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
14489            )
14490        })
14491    }
14492}
14493/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
14494#[derive(Clone, Debug, serde::Serialize)]
14495pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
14496    /// Controls when the funds are captured from the customer's account.
14497    ///
14498    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14499    ///
14500    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14501    #[serde(skip_serializing_if = "Option::is_none")]
14502    pub capture_method:
14503        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
14504    /// An internal identifier or reference that this payment corresponds to.
14505    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
14506    /// This field differs from the statement descriptor and item name.
14507    #[serde(skip_serializing_if = "Option::is_none")]
14508    pub reference: Option<String>,
14509    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14510    ///
14511    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14512    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14513    ///
14514    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14515    ///
14516    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14517    ///
14518    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14519    #[serde(skip_serializing_if = "Option::is_none")]
14520    pub setup_future_usage:
14521        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
14522}
14523impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
14524    pub fn new() -> Self {
14525        Self { capture_method: None, reference: None, setup_future_usage: None }
14526    }
14527}
14528impl Default for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
14529    fn default() -> Self {
14530        Self::new()
14531    }
14532}
14533/// Controls when the funds are captured from the customer's account.
14534///
14535/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14536///
14537/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14538#[derive(Copy, Clone, Eq, PartialEq)]
14539pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14540    Manual,
14541}
14542impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14543    pub fn as_str(self) -> &'static str {
14544        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
14545        match self {
14546            Manual => "manual",
14547        }
14548    }
14549}
14550
14551impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14552    type Err = stripe_types::StripeParseError;
14553    fn from_str(s: &str) -> Result<Self, Self::Err> {
14554        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
14555        match s {
14556            "manual" => Ok(Manual),
14557            _ => Err(stripe_types::StripeParseError),
14558        }
14559    }
14560}
14561impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14563        f.write_str(self.as_str())
14564    }
14565}
14566
14567impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14568    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14569        f.write_str(self.as_str())
14570    }
14571}
14572impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14573    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14574    where
14575        S: serde::Serializer,
14576    {
14577        serializer.serialize_str(self.as_str())
14578    }
14579}
14580#[cfg(feature = "deserialize")]
14581impl<'de> serde::Deserialize<'de>
14582    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
14583{
14584    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14585        use std::str::FromStr;
14586        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14587        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
14588    }
14589}
14590/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14591///
14592/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14593/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14594///
14595/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14596///
14597/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14598///
14599/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14600#[derive(Copy, Clone, Eq, PartialEq)]
14601pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14602    None,
14603}
14604impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14605    pub fn as_str(self) -> &'static str {
14606        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
14607        match self {
14608            None => "none",
14609        }
14610    }
14611}
14612
14613impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14614    type Err = stripe_types::StripeParseError;
14615    fn from_str(s: &str) -> Result<Self, Self::Err> {
14616        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
14617        match s {
14618            "none" => Ok(None),
14619            _ => Err(stripe_types::StripeParseError),
14620        }
14621    }
14622}
14623impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14624    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14625        f.write_str(self.as_str())
14626    }
14627}
14628
14629impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14630    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14631        f.write_str(self.as_str())
14632    }
14633}
14634impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14635    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14636    where
14637        S: serde::Serializer,
14638    {
14639        serializer.serialize_str(self.as_str())
14640    }
14641}
14642#[cfg(feature = "deserialize")]
14643impl<'de> serde::Deserialize<'de>
14644    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
14645{
14646    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14647        use std::str::FromStr;
14648        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14649        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
14650    }
14651}
14652/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
14653#[derive(Copy, Clone, Debug, serde::Serialize)]
14654pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay {
14655    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14656    ///
14657    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14658    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14659    ///
14660    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14661    ///
14662    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14663    ///
14664    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14665    #[serde(skip_serializing_if = "Option::is_none")]
14666    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
14667}
14668impl UpdatePaymentIntentPaymentMethodOptionsAlipay {
14669    pub fn new() -> Self {
14670        Self { setup_future_usage: None }
14671    }
14672}
14673impl Default for UpdatePaymentIntentPaymentMethodOptionsAlipay {
14674    fn default() -> Self {
14675        Self::new()
14676    }
14677}
14678/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14679///
14680/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14681/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14682///
14683/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14684///
14685/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14686///
14687/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14688#[derive(Copy, Clone, Eq, PartialEq)]
14689pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14690    None,
14691    OffSession,
14692}
14693impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14694    pub fn as_str(self) -> &'static str {
14695        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
14696        match self {
14697            None => "none",
14698            OffSession => "off_session",
14699        }
14700    }
14701}
14702
14703impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14704    type Err = stripe_types::StripeParseError;
14705    fn from_str(s: &str) -> Result<Self, Self::Err> {
14706        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
14707        match s {
14708            "none" => Ok(None),
14709            "off_session" => Ok(OffSession),
14710            _ => Err(stripe_types::StripeParseError),
14711        }
14712    }
14713}
14714impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14715    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14716        f.write_str(self.as_str())
14717    }
14718}
14719
14720impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14721    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14722        f.write_str(self.as_str())
14723    }
14724}
14725impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14726    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14727    where
14728        S: serde::Serializer,
14729    {
14730        serializer.serialize_str(self.as_str())
14731    }
14732}
14733#[cfg(feature = "deserialize")]
14734impl<'de> serde::Deserialize<'de>
14735    for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
14736{
14737    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14738        use std::str::FromStr;
14739        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14740        Self::from_str(&s).map_err(|_| {
14741            serde::de::Error::custom(
14742                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
14743            )
14744        })
14745    }
14746}
14747/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
14748#[derive(Copy, Clone, Debug, serde::Serialize)]
14749pub struct UpdatePaymentIntentPaymentMethodOptionsAlma {
14750    /// Controls when the funds are captured from the customer's account.
14751    ///
14752    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14753    ///
14754    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14755    #[serde(skip_serializing_if = "Option::is_none")]
14756    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
14757}
14758impl UpdatePaymentIntentPaymentMethodOptionsAlma {
14759    pub fn new() -> Self {
14760        Self { capture_method: None }
14761    }
14762}
14763impl Default for UpdatePaymentIntentPaymentMethodOptionsAlma {
14764    fn default() -> Self {
14765        Self::new()
14766    }
14767}
14768/// Controls when the funds are captured from the customer's account.
14769///
14770/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14771///
14772/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14773#[derive(Copy, Clone, Eq, PartialEq)]
14774pub enum UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14775    Manual,
14776}
14777impl UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14778    pub fn as_str(self) -> &'static str {
14779        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
14780        match self {
14781            Manual => "manual",
14782        }
14783    }
14784}
14785
14786impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14787    type Err = stripe_types::StripeParseError;
14788    fn from_str(s: &str) -> Result<Self, Self::Err> {
14789        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
14790        match s {
14791            "manual" => Ok(Manual),
14792            _ => Err(stripe_types::StripeParseError),
14793        }
14794    }
14795}
14796impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14797    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14798        f.write_str(self.as_str())
14799    }
14800}
14801
14802impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14804        f.write_str(self.as_str())
14805    }
14806}
14807impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14808    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14809    where
14810        S: serde::Serializer,
14811    {
14812        serializer.serialize_str(self.as_str())
14813    }
14814}
14815#[cfg(feature = "deserialize")]
14816impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14817    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14818        use std::str::FromStr;
14819        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14820        Self::from_str(&s).map_err(|_| {
14821            serde::de::Error::custom(
14822                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
14823            )
14824        })
14825    }
14826}
14827/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
14828#[derive(Copy, Clone, Debug, serde::Serialize)]
14829pub struct UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14830    /// Controls when the funds are captured from the customer's account.
14831    ///
14832    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14833    ///
14834    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14835    #[serde(skip_serializing_if = "Option::is_none")]
14836    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
14837    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14838    ///
14839    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14840    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14841    ///
14842    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14843    ///
14844    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14845    #[serde(skip_serializing_if = "Option::is_none")]
14846    pub setup_future_usage:
14847        Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
14848}
14849impl UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14850    pub fn new() -> Self {
14851        Self { capture_method: None, setup_future_usage: None }
14852    }
14853}
14854impl Default for UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14855    fn default() -> Self {
14856        Self::new()
14857    }
14858}
14859/// Controls when the funds are captured from the customer's account.
14860///
14861/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
14862///
14863/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
14864#[derive(Copy, Clone, Eq, PartialEq)]
14865pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14866    Manual,
14867}
14868impl UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14869    pub fn as_str(self) -> &'static str {
14870        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
14871        match self {
14872            Manual => "manual",
14873        }
14874    }
14875}
14876
14877impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14878    type Err = stripe_types::StripeParseError;
14879    fn from_str(s: &str) -> Result<Self, Self::Err> {
14880        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
14881        match s {
14882            "manual" => Ok(Manual),
14883            _ => Err(stripe_types::StripeParseError),
14884        }
14885    }
14886}
14887impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14888    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14889        f.write_str(self.as_str())
14890    }
14891}
14892
14893impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14895        f.write_str(self.as_str())
14896    }
14897}
14898impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14899    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14900    where
14901        S: serde::Serializer,
14902    {
14903        serializer.serialize_str(self.as_str())
14904    }
14905}
14906#[cfg(feature = "deserialize")]
14907impl<'de> serde::Deserialize<'de>
14908    for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
14909{
14910    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14911        use std::str::FromStr;
14912        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14913        Self::from_str(&s).map_err(|_| {
14914            serde::de::Error::custom(
14915                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
14916            )
14917        })
14918    }
14919}
14920/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14921///
14922/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14923/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14924///
14925/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14926///
14927/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14928#[derive(Copy, Clone, Eq, PartialEq)]
14929pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14930    None,
14931    OffSession,
14932}
14933impl UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14934    pub fn as_str(self) -> &'static str {
14935        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
14936        match self {
14937            None => "none",
14938            OffSession => "off_session",
14939        }
14940    }
14941}
14942
14943impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14944    type Err = stripe_types::StripeParseError;
14945    fn from_str(s: &str) -> Result<Self, Self::Err> {
14946        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
14947        match s {
14948            "none" => Ok(None),
14949            "off_session" => Ok(OffSession),
14950            _ => Err(stripe_types::StripeParseError),
14951        }
14952    }
14953}
14954impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14956        f.write_str(self.as_str())
14957    }
14958}
14959
14960impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14961    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14962        f.write_str(self.as_str())
14963    }
14964}
14965impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14966    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14967    where
14968        S: serde::Serializer,
14969    {
14970        serializer.serialize_str(self.as_str())
14971    }
14972}
14973#[cfg(feature = "deserialize")]
14974impl<'de> serde::Deserialize<'de>
14975    for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
14976{
14977    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14978        use std::str::FromStr;
14979        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14980        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
14981    }
14982}
14983/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
14984#[derive(Clone, Debug, serde::Serialize)]
14985pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14986    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14987    ///
14988    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14989    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14990    ///
14991    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14992    ///
14993    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14994    ///
14995    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14996    #[serde(skip_serializing_if = "Option::is_none")]
14997    pub setup_future_usage:
14998        Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
14999    /// Controls when Stripe will attempt to debit the funds from the customer's account.
15000    /// The date must be a string in YYYY-MM-DD format.
15001    /// The date must be in the future and between 3 and 15 calendar days from now.
15002    #[serde(skip_serializing_if = "Option::is_none")]
15003    pub target_date: Option<String>,
15004}
15005impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
15006    pub fn new() -> Self {
15007        Self { setup_future_usage: None, target_date: None }
15008    }
15009}
15010impl Default for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
15011    fn default() -> Self {
15012        Self::new()
15013    }
15014}
15015/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15016///
15017/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15018/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15019///
15020/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15021///
15022/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15023///
15024/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15025#[derive(Copy, Clone, Eq, PartialEq)]
15026pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
15027    None,
15028    OffSession,
15029    OnSession,
15030}
15031impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
15032    pub fn as_str(self) -> &'static str {
15033        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
15034        match self {
15035            None => "none",
15036            OffSession => "off_session",
15037            OnSession => "on_session",
15038        }
15039    }
15040}
15041
15042impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
15043    type Err = stripe_types::StripeParseError;
15044    fn from_str(s: &str) -> Result<Self, Self::Err> {
15045        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
15046        match s {
15047            "none" => Ok(None),
15048            "off_session" => Ok(OffSession),
15049            "on_session" => Ok(OnSession),
15050            _ => Err(stripe_types::StripeParseError),
15051        }
15052    }
15053}
15054impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
15055    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15056        f.write_str(self.as_str())
15057    }
15058}
15059
15060impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
15061    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15062        f.write_str(self.as_str())
15063    }
15064}
15065impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
15066    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15067    where
15068        S: serde::Serializer,
15069    {
15070        serializer.serialize_str(self.as_str())
15071    }
15072}
15073#[cfg(feature = "deserialize")]
15074impl<'de> serde::Deserialize<'de>
15075    for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
15076{
15077    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15078        use std::str::FromStr;
15079        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15080        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
15081    }
15082}
15083/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
15084#[derive(Clone, Debug, serde::Serialize)]
15085pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
15086    /// Additional fields for Mandate creation
15087    #[serde(skip_serializing_if = "Option::is_none")]
15088    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
15089    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15090    ///
15091    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15092    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15093    ///
15094    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15095    ///
15096    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15097    ///
15098    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15099    #[serde(skip_serializing_if = "Option::is_none")]
15100    pub setup_future_usage:
15101        Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
15102    /// Controls when Stripe will attempt to debit the funds from the customer's account.
15103    /// The date must be a string in YYYY-MM-DD format.
15104    /// The date must be in the future and between 3 and 15 calendar days from now.
15105    #[serde(skip_serializing_if = "Option::is_none")]
15106    pub target_date: Option<String>,
15107}
15108impl UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
15109    pub fn new() -> Self {
15110        Self { mandate_options: None, setup_future_usage: None, target_date: None }
15111    }
15112}
15113impl Default for UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
15114    fn default() -> Self {
15115        Self::new()
15116    }
15117}
15118/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15119///
15120/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15121/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15122///
15123/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15124///
15125/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15126///
15127/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15128#[derive(Copy, Clone, Eq, PartialEq)]
15129pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15130    None,
15131    OffSession,
15132    OnSession,
15133}
15134impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15135    pub fn as_str(self) -> &'static str {
15136        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
15137        match self {
15138            None => "none",
15139            OffSession => "off_session",
15140            OnSession => "on_session",
15141        }
15142    }
15143}
15144
15145impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15146    type Err = stripe_types::StripeParseError;
15147    fn from_str(s: &str) -> Result<Self, Self::Err> {
15148        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
15149        match s {
15150            "none" => Ok(None),
15151            "off_session" => Ok(OffSession),
15152            "on_session" => Ok(OnSession),
15153            _ => Err(stripe_types::StripeParseError),
15154        }
15155    }
15156}
15157impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15158    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15159        f.write_str(self.as_str())
15160    }
15161}
15162
15163impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15165        f.write_str(self.as_str())
15166    }
15167}
15168impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15169    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15170    where
15171        S: serde::Serializer,
15172    {
15173        serializer.serialize_str(self.as_str())
15174    }
15175}
15176#[cfg(feature = "deserialize")]
15177impl<'de> serde::Deserialize<'de>
15178    for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
15179{
15180    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15181        use std::str::FromStr;
15182        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15183        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
15184    }
15185}
15186/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
15187#[derive(Copy, Clone, Debug, serde::Serialize)]
15188pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact {
15189    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
15190    #[serde(skip_serializing_if = "Option::is_none")]
15191    pub preferred_language:
15192        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
15193    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15194    ///
15195    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15196    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15197    ///
15198    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15199    ///
15200    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15201    ///
15202    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15203    #[serde(skip_serializing_if = "Option::is_none")]
15204    pub setup_future_usage:
15205        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
15206}
15207impl UpdatePaymentIntentPaymentMethodOptionsBancontact {
15208    pub fn new() -> Self {
15209        Self { preferred_language: None, setup_future_usage: None }
15210    }
15211}
15212impl Default for UpdatePaymentIntentPaymentMethodOptionsBancontact {
15213    fn default() -> Self {
15214        Self::new()
15215    }
15216}
15217/// Preferred language of the Bancontact authorization page that the customer is redirected to.
15218#[derive(Copy, Clone, Eq, PartialEq)]
15219pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15220    De,
15221    En,
15222    Fr,
15223    Nl,
15224}
15225impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15226    pub fn as_str(self) -> &'static str {
15227        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
15228        match self {
15229            De => "de",
15230            En => "en",
15231            Fr => "fr",
15232            Nl => "nl",
15233        }
15234    }
15235}
15236
15237impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15238    type Err = stripe_types::StripeParseError;
15239    fn from_str(s: &str) -> Result<Self, Self::Err> {
15240        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
15241        match s {
15242            "de" => Ok(De),
15243            "en" => Ok(En),
15244            "fr" => Ok(Fr),
15245            "nl" => Ok(Nl),
15246            _ => Err(stripe_types::StripeParseError),
15247        }
15248    }
15249}
15250impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15252        f.write_str(self.as_str())
15253    }
15254}
15255
15256impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15257    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15258        f.write_str(self.as_str())
15259    }
15260}
15261impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15262    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15263    where
15264        S: serde::Serializer,
15265    {
15266        serializer.serialize_str(self.as_str())
15267    }
15268}
15269#[cfg(feature = "deserialize")]
15270impl<'de> serde::Deserialize<'de>
15271    for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
15272{
15273    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15274        use std::str::FromStr;
15275        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15276        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
15277    }
15278}
15279/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15280///
15281/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15282/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15283///
15284/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15285///
15286/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15287///
15288/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15289#[derive(Copy, Clone, Eq, PartialEq)]
15290pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15291    None,
15292    OffSession,
15293}
15294impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15295    pub fn as_str(self) -> &'static str {
15296        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
15297        match self {
15298            None => "none",
15299            OffSession => "off_session",
15300        }
15301    }
15302}
15303
15304impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15305    type Err = stripe_types::StripeParseError;
15306    fn from_str(s: &str) -> Result<Self, Self::Err> {
15307        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
15308        match s {
15309            "none" => Ok(None),
15310            "off_session" => Ok(OffSession),
15311            _ => Err(stripe_types::StripeParseError),
15312        }
15313    }
15314}
15315impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15316    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15317        f.write_str(self.as_str())
15318    }
15319}
15320
15321impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15323        f.write_str(self.as_str())
15324    }
15325}
15326impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15327    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15328    where
15329        S: serde::Serializer,
15330    {
15331        serializer.serialize_str(self.as_str())
15332    }
15333}
15334#[cfg(feature = "deserialize")]
15335impl<'de> serde::Deserialize<'de>
15336    for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
15337{
15338    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15339        use std::str::FromStr;
15340        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15341        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
15342    }
15343}
15344/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
15345#[derive(Copy, Clone, Debug, serde::Serialize)]
15346pub struct UpdatePaymentIntentPaymentMethodOptionsBillie {
15347    /// Controls when the funds are captured from the customer's account.
15348    ///
15349    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
15350    ///
15351    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
15352    #[serde(skip_serializing_if = "Option::is_none")]
15353    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
15354}
15355impl UpdatePaymentIntentPaymentMethodOptionsBillie {
15356    pub fn new() -> Self {
15357        Self { capture_method: None }
15358    }
15359}
15360impl Default for UpdatePaymentIntentPaymentMethodOptionsBillie {
15361    fn default() -> Self {
15362        Self::new()
15363    }
15364}
15365/// Controls when the funds are captured from the customer's account.
15366///
15367/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
15368///
15369/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
15370#[derive(Copy, Clone, Eq, PartialEq)]
15371pub enum UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15372    Manual,
15373}
15374impl UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15375    pub fn as_str(self) -> &'static str {
15376        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
15377        match self {
15378            Manual => "manual",
15379        }
15380    }
15381}
15382
15383impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15384    type Err = stripe_types::StripeParseError;
15385    fn from_str(s: &str) -> Result<Self, Self::Err> {
15386        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
15387        match s {
15388            "manual" => Ok(Manual),
15389            _ => Err(stripe_types::StripeParseError),
15390        }
15391    }
15392}
15393impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15394    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15395        f.write_str(self.as_str())
15396    }
15397}
15398
15399impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15400    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15401        f.write_str(self.as_str())
15402    }
15403}
15404impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15405    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15406    where
15407        S: serde::Serializer,
15408    {
15409        serializer.serialize_str(self.as_str())
15410    }
15411}
15412#[cfg(feature = "deserialize")]
15413impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15414    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15415        use std::str::FromStr;
15416        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15417        Self::from_str(&s).map_err(|_| {
15418            serde::de::Error::custom(
15419                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod",
15420            )
15421        })
15422    }
15423}
15424/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
15425#[derive(Clone, Debug, serde::Serialize)]
15426pub struct UpdatePaymentIntentPaymentMethodOptionsBlik {
15427    /// The 6-digit BLIK code that a customer has generated using their banking application.
15428    /// Can only be set on confirmation.
15429    #[serde(skip_serializing_if = "Option::is_none")]
15430    pub code: Option<String>,
15431    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15432    ///
15433    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15434    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15435    ///
15436    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15437    ///
15438    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15439    ///
15440    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15441    #[serde(skip_serializing_if = "Option::is_none")]
15442    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
15443}
15444impl UpdatePaymentIntentPaymentMethodOptionsBlik {
15445    pub fn new() -> Self {
15446        Self { code: None, setup_future_usage: None }
15447    }
15448}
15449impl Default for UpdatePaymentIntentPaymentMethodOptionsBlik {
15450    fn default() -> Self {
15451        Self::new()
15452    }
15453}
15454/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15455///
15456/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15457/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15458///
15459/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15460///
15461/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15462///
15463/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15464#[derive(Copy, Clone, Eq, PartialEq)]
15465pub enum UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15466    None,
15467}
15468impl UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15469    pub fn as_str(self) -> &'static str {
15470        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
15471        match self {
15472            None => "none",
15473        }
15474    }
15475}
15476
15477impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15478    type Err = stripe_types::StripeParseError;
15479    fn from_str(s: &str) -> Result<Self, Self::Err> {
15480        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
15481        match s {
15482            "none" => Ok(None),
15483            _ => Err(stripe_types::StripeParseError),
15484        }
15485    }
15486}
15487impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15489        f.write_str(self.as_str())
15490    }
15491}
15492
15493impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15494    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15495        f.write_str(self.as_str())
15496    }
15497}
15498impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15499    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15500    where
15501        S: serde::Serializer,
15502    {
15503        serializer.serialize_str(self.as_str())
15504    }
15505}
15506#[cfg(feature = "deserialize")]
15507impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15508    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15509        use std::str::FromStr;
15510        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15511        Self::from_str(&s).map_err(|_| {
15512            serde::de::Error::custom(
15513                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
15514            )
15515        })
15516    }
15517}
15518/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
15519#[derive(Copy, Clone, Debug, serde::Serialize)]
15520pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto {
15521    /// The number of calendar days before a Boleto voucher expires.
15522    /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
15523    #[serde(skip_serializing_if = "Option::is_none")]
15524    pub expires_after_days: Option<u32>,
15525    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15526    ///
15527    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15528    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15529    ///
15530    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15531    ///
15532    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15533    ///
15534    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15535    #[serde(skip_serializing_if = "Option::is_none")]
15536    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
15537}
15538impl UpdatePaymentIntentPaymentMethodOptionsBoleto {
15539    pub fn new() -> Self {
15540        Self { expires_after_days: None, setup_future_usage: None }
15541    }
15542}
15543impl Default for UpdatePaymentIntentPaymentMethodOptionsBoleto {
15544    fn default() -> Self {
15545        Self::new()
15546    }
15547}
15548/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15549///
15550/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15551/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15552///
15553/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15554///
15555/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15556///
15557/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15558#[derive(Copy, Clone, Eq, PartialEq)]
15559pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15560    None,
15561    OffSession,
15562    OnSession,
15563}
15564impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15565    pub fn as_str(self) -> &'static str {
15566        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
15567        match self {
15568            None => "none",
15569            OffSession => "off_session",
15570            OnSession => "on_session",
15571        }
15572    }
15573}
15574
15575impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15576    type Err = stripe_types::StripeParseError;
15577    fn from_str(s: &str) -> Result<Self, Self::Err> {
15578        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
15579        match s {
15580            "none" => Ok(None),
15581            "off_session" => Ok(OffSession),
15582            "on_session" => Ok(OnSession),
15583            _ => Err(stripe_types::StripeParseError),
15584        }
15585    }
15586}
15587impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15589        f.write_str(self.as_str())
15590    }
15591}
15592
15593impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15595        f.write_str(self.as_str())
15596    }
15597}
15598impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15599    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15600    where
15601        S: serde::Serializer,
15602    {
15603        serializer.serialize_str(self.as_str())
15604    }
15605}
15606#[cfg(feature = "deserialize")]
15607impl<'de> serde::Deserialize<'de>
15608    for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
15609{
15610    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15611        use std::str::FromStr;
15612        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15613        Self::from_str(&s).map_err(|_| {
15614            serde::de::Error::custom(
15615                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
15616            )
15617        })
15618    }
15619}
15620/// Configuration for any card payments attempted on this PaymentIntent.
15621#[derive(Clone, Debug, serde::Serialize)]
15622pub struct UpdatePaymentIntentPaymentMethodOptionsCard {
15623    /// Controls when the funds are captured from the customer's account.
15624    ///
15625    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
15626    ///
15627    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
15628    #[serde(skip_serializing_if = "Option::is_none")]
15629    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
15630    /// A single-use `cvc_update` Token that represents a card CVC value.
15631    /// When provided, the CVC value will be verified during the card payment attempt.
15632    /// This parameter can only be provided during confirmation.
15633    #[serde(skip_serializing_if = "Option::is_none")]
15634    pub cvc_token: Option<String>,
15635    /// Installment configuration for payments attempted on this PaymentIntent.
15636    ///
15637    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
15638    #[serde(skip_serializing_if = "Option::is_none")]
15639    pub installments: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallments>,
15640    /// Configuration options for setting up an eMandate for cards issued in India.
15641    #[serde(skip_serializing_if = "Option::is_none")]
15642    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
15643    /// When specified, this parameter indicates that a transaction will be marked
15644    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
15645    /// parameter can only be provided during confirmation.
15646    #[serde(skip_serializing_if = "Option::is_none")]
15647    pub moto: Option<bool>,
15648    /// Selected network to process this PaymentIntent on.
15649    /// Depends on the available networks of the card attached to the PaymentIntent.
15650    /// Can be only set confirm-time.
15651    #[serde(skip_serializing_if = "Option::is_none")]
15652    pub network: Option<UpdatePaymentIntentPaymentMethodOptionsCardNetwork>,
15653    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
15654    #[serde(skip_serializing_if = "Option::is_none")]
15655    pub request_extended_authorization:
15656        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
15657    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
15658    #[serde(skip_serializing_if = "Option::is_none")]
15659    pub request_incremental_authorization:
15660        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
15661    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
15662    #[serde(skip_serializing_if = "Option::is_none")]
15663    pub request_multicapture:
15664        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
15665    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
15666    #[serde(skip_serializing_if = "Option::is_none")]
15667    pub request_overcapture: Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
15668    /// 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).
15669    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
15670    /// If not provided, this value defaults to `automatic`.
15671    /// 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.
15672    #[serde(skip_serializing_if = "Option::is_none")]
15673    pub request_three_d_secure:
15674        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
15675    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
15676    /// using the cvc_token parameter).
15677    #[serde(skip_serializing_if = "Option::is_none")]
15678    pub require_cvc_recollection: Option<bool>,
15679    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15680    ///
15681    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15682    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15683    ///
15684    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15685    ///
15686    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15687    ///
15688    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15689    #[serde(skip_serializing_if = "Option::is_none")]
15690    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
15691    /// Provides information about a card payment that customers see on their statements.
15692    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
15693    /// Maximum 22 characters.
15694    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
15695    #[serde(skip_serializing_if = "Option::is_none")]
15696    pub statement_descriptor_suffix_kana: Option<String>,
15697    /// Provides information about a card payment that customers see on their statements.
15698    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
15699    /// Maximum 17 characters.
15700    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
15701    #[serde(skip_serializing_if = "Option::is_none")]
15702    pub statement_descriptor_suffix_kanji: Option<String>,
15703    /// If 3D Secure authentication was performed with a third-party provider,
15704    /// the authentication details to use for this payment.
15705    #[serde(skip_serializing_if = "Option::is_none")]
15706    pub three_d_secure: Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
15707}
15708impl UpdatePaymentIntentPaymentMethodOptionsCard {
15709    pub fn new() -> Self {
15710        Self {
15711            capture_method: None,
15712            cvc_token: None,
15713            installments: None,
15714            mandate_options: None,
15715            moto: None,
15716            network: None,
15717            request_extended_authorization: None,
15718            request_incremental_authorization: None,
15719            request_multicapture: None,
15720            request_overcapture: None,
15721            request_three_d_secure: None,
15722            require_cvc_recollection: None,
15723            setup_future_usage: None,
15724            statement_descriptor_suffix_kana: None,
15725            statement_descriptor_suffix_kanji: None,
15726            three_d_secure: None,
15727        }
15728    }
15729}
15730impl Default for UpdatePaymentIntentPaymentMethodOptionsCard {
15731    fn default() -> Self {
15732        Self::new()
15733    }
15734}
15735/// Controls when the funds are captured from the customer's account.
15736///
15737/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
15738///
15739/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
15740#[derive(Copy, Clone, Eq, PartialEq)]
15741pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15742    Manual,
15743}
15744impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15745    pub fn as_str(self) -> &'static str {
15746        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
15747        match self {
15748            Manual => "manual",
15749        }
15750    }
15751}
15752
15753impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15754    type Err = stripe_types::StripeParseError;
15755    fn from_str(s: &str) -> Result<Self, Self::Err> {
15756        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
15757        match s {
15758            "manual" => Ok(Manual),
15759            _ => Err(stripe_types::StripeParseError),
15760        }
15761    }
15762}
15763impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15765        f.write_str(self.as_str())
15766    }
15767}
15768
15769impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15771        f.write_str(self.as_str())
15772    }
15773}
15774impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15775    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15776    where
15777        S: serde::Serializer,
15778    {
15779        serializer.serialize_str(self.as_str())
15780    }
15781}
15782#[cfg(feature = "deserialize")]
15783impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15785        use std::str::FromStr;
15786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15787        Self::from_str(&s).map_err(|_| {
15788            serde::de::Error::custom(
15789                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod",
15790            )
15791        })
15792    }
15793}
15794/// Installment configuration for payments attempted on this PaymentIntent.
15795///
15796/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
15797#[derive(Copy, Clone, Debug, serde::Serialize)]
15798pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15799    /// Setting to true enables installments for this PaymentIntent.
15800    /// This will cause the response to contain a list of available installment plans.
15801    /// Setting to false will prevent any selected plan from applying to a charge.
15802    #[serde(skip_serializing_if = "Option::is_none")]
15803    pub enabled: Option<bool>,
15804    /// The selected installment plan to use for this payment attempt.
15805    /// This parameter can only be provided during confirmation.
15806    #[serde(skip_serializing_if = "Option::is_none")]
15807    pub plan: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
15808}
15809impl UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15810    pub fn new() -> Self {
15811        Self { enabled: None, plan: None }
15812    }
15813}
15814impl Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15815    fn default() -> Self {
15816        Self::new()
15817    }
15818}
15819/// The selected installment plan to use for this payment attempt.
15820/// This parameter can only be provided during confirmation.
15821#[derive(Copy, Clone, Debug, serde::Serialize)]
15822pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
15823    /// For `fixed_count` installment plans, this is required.
15824    /// It represents the number of installment payments your customer will make to their credit card.
15825    #[serde(skip_serializing_if = "Option::is_none")]
15826    pub count: Option<u64>,
15827    /// For `fixed_count` installment plans, this is required.
15828    /// It represents the interval between installment payments your customer will make to their credit card.
15829    /// One of `month`.
15830    #[serde(skip_serializing_if = "Option::is_none")]
15831    pub interval: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
15832    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
15833    #[serde(rename = "type")]
15834    pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
15835}
15836impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
15837    pub fn new(
15838        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
15839    ) -> Self {
15840        Self { count: None, interval: None, type_: type_.into() }
15841    }
15842}
15843/// For `fixed_count` installment plans, this is required.
15844/// It represents the interval between installment payments your customer will make to their credit card.
15845/// One of `month`.
15846#[derive(Copy, Clone, Eq, PartialEq)]
15847pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15848    Month,
15849}
15850impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15851    pub fn as_str(self) -> &'static str {
15852        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
15853        match self {
15854            Month => "month",
15855        }
15856    }
15857}
15858
15859impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15860    type Err = stripe_types::StripeParseError;
15861    fn from_str(s: &str) -> Result<Self, Self::Err> {
15862        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
15863        match s {
15864            "month" => Ok(Month),
15865            _ => Err(stripe_types::StripeParseError),
15866        }
15867    }
15868}
15869impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15871        f.write_str(self.as_str())
15872    }
15873}
15874
15875impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15877        f.write_str(self.as_str())
15878    }
15879}
15880impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15881    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15882    where
15883        S: serde::Serializer,
15884    {
15885        serializer.serialize_str(self.as_str())
15886    }
15887}
15888#[cfg(feature = "deserialize")]
15889impl<'de> serde::Deserialize<'de>
15890    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
15891{
15892    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15893        use std::str::FromStr;
15894        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15895        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
15896    }
15897}
15898/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
15899#[derive(Copy, Clone, Eq, PartialEq)]
15900pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15901    Bonus,
15902    FixedCount,
15903    Revolving,
15904}
15905impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15906    pub fn as_str(self) -> &'static str {
15907        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
15908        match self {
15909            Bonus => "bonus",
15910            FixedCount => "fixed_count",
15911            Revolving => "revolving",
15912        }
15913    }
15914}
15915
15916impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15917    type Err = stripe_types::StripeParseError;
15918    fn from_str(s: &str) -> Result<Self, Self::Err> {
15919        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
15920        match s {
15921            "bonus" => Ok(Bonus),
15922            "fixed_count" => Ok(FixedCount),
15923            "revolving" => Ok(Revolving),
15924            _ => Err(stripe_types::StripeParseError),
15925        }
15926    }
15927}
15928impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15930        f.write_str(self.as_str())
15931    }
15932}
15933
15934impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15936        f.write_str(self.as_str())
15937    }
15938}
15939impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15940    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15941    where
15942        S: serde::Serializer,
15943    {
15944        serializer.serialize_str(self.as_str())
15945    }
15946}
15947#[cfg(feature = "deserialize")]
15948impl<'de> serde::Deserialize<'de>
15949    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
15950{
15951    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15952        use std::str::FromStr;
15953        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15954        Self::from_str(&s).map_err(|_| {
15955            serde::de::Error::custom(
15956                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType",
15957            )
15958        })
15959    }
15960}
15961/// Configuration options for setting up an eMandate for cards issued in India.
15962#[derive(Clone, Debug, serde::Serialize)]
15963pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
15964    /// Amount to be charged for future payments.
15965    pub amount: i64,
15966    /// One of `fixed` or `maximum`.
15967    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
15968    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
15969    pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
15970    /// A description of the mandate or subscription that is meant to be displayed to the customer.
15971    #[serde(skip_serializing_if = "Option::is_none")]
15972    pub description: Option<String>,
15973    /// End date of the mandate or subscription.
15974    /// If not provided, the mandate will be active until canceled.
15975    /// If provided, end date should be after start date.
15976    #[serde(skip_serializing_if = "Option::is_none")]
15977    pub end_date: Option<stripe_types::Timestamp>,
15978    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
15979    pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
15980    /// The number of intervals between payments.
15981    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
15982    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
15983    /// This parameter is optional when `interval=sporadic`.
15984    #[serde(skip_serializing_if = "Option::is_none")]
15985    pub interval_count: Option<u64>,
15986    /// Unique identifier for the mandate or subscription.
15987    pub reference: String,
15988    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
15989    pub start_date: stripe_types::Timestamp,
15990    /// Specifies the type of mandates supported. Possible values are `india`.
15991    #[serde(skip_serializing_if = "Option::is_none")]
15992    pub supported_types:
15993        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
15994}
15995impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
15996    pub fn new(
15997        amount: impl Into<i64>,
15998        amount_type: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
15999        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
16000        reference: impl Into<String>,
16001        start_date: impl Into<stripe_types::Timestamp>,
16002    ) -> Self {
16003        Self {
16004            amount: amount.into(),
16005            amount_type: amount_type.into(),
16006            description: None,
16007            end_date: None,
16008            interval: interval.into(),
16009            interval_count: None,
16010            reference: reference.into(),
16011            start_date: start_date.into(),
16012            supported_types: None,
16013        }
16014    }
16015}
16016/// One of `fixed` or `maximum`.
16017/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
16018/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
16019#[derive(Copy, Clone, Eq, PartialEq)]
16020pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
16021    Fixed,
16022    Maximum,
16023}
16024impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
16025    pub fn as_str(self) -> &'static str {
16026        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
16027        match self {
16028            Fixed => "fixed",
16029            Maximum => "maximum",
16030        }
16031    }
16032}
16033
16034impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
16035    type Err = stripe_types::StripeParseError;
16036    fn from_str(s: &str) -> Result<Self, Self::Err> {
16037        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
16038        match s {
16039            "fixed" => Ok(Fixed),
16040            "maximum" => Ok(Maximum),
16041            _ => Err(stripe_types::StripeParseError),
16042        }
16043    }
16044}
16045impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
16046    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16047        f.write_str(self.as_str())
16048    }
16049}
16050
16051impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
16052    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16053        f.write_str(self.as_str())
16054    }
16055}
16056impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
16057    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16058    where
16059        S: serde::Serializer,
16060    {
16061        serializer.serialize_str(self.as_str())
16062    }
16063}
16064#[cfg(feature = "deserialize")]
16065impl<'de> serde::Deserialize<'de>
16066    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
16067{
16068    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16069        use std::str::FromStr;
16070        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16071        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
16072    }
16073}
16074/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
16075#[derive(Copy, Clone, Eq, PartialEq)]
16076pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16077    Day,
16078    Month,
16079    Sporadic,
16080    Week,
16081    Year,
16082}
16083impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16084    pub fn as_str(self) -> &'static str {
16085        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
16086        match self {
16087            Day => "day",
16088            Month => "month",
16089            Sporadic => "sporadic",
16090            Week => "week",
16091            Year => "year",
16092        }
16093    }
16094}
16095
16096impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16097    type Err = stripe_types::StripeParseError;
16098    fn from_str(s: &str) -> Result<Self, Self::Err> {
16099        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
16100        match s {
16101            "day" => Ok(Day),
16102            "month" => Ok(Month),
16103            "sporadic" => Ok(Sporadic),
16104            "week" => Ok(Week),
16105            "year" => Ok(Year),
16106            _ => Err(stripe_types::StripeParseError),
16107        }
16108    }
16109}
16110impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16112        f.write_str(self.as_str())
16113    }
16114}
16115
16116impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16117    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16118        f.write_str(self.as_str())
16119    }
16120}
16121impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16122    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16123    where
16124        S: serde::Serializer,
16125    {
16126        serializer.serialize_str(self.as_str())
16127    }
16128}
16129#[cfg(feature = "deserialize")]
16130impl<'de> serde::Deserialize<'de>
16131    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
16132{
16133    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16134        use std::str::FromStr;
16135        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16136        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
16137    }
16138}
16139/// Specifies the type of mandates supported. Possible values are `india`.
16140#[derive(Copy, Clone, Eq, PartialEq)]
16141pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16142    India,
16143}
16144impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16145    pub fn as_str(self) -> &'static str {
16146        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
16147        match self {
16148            India => "india",
16149        }
16150    }
16151}
16152
16153impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16154    type Err = stripe_types::StripeParseError;
16155    fn from_str(s: &str) -> Result<Self, Self::Err> {
16156        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
16157        match s {
16158            "india" => Ok(India),
16159            _ => Err(stripe_types::StripeParseError),
16160        }
16161    }
16162}
16163impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16165        f.write_str(self.as_str())
16166    }
16167}
16168
16169impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16171        f.write_str(self.as_str())
16172    }
16173}
16174impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16175    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16176    where
16177        S: serde::Serializer,
16178    {
16179        serializer.serialize_str(self.as_str())
16180    }
16181}
16182#[cfg(feature = "deserialize")]
16183impl<'de> serde::Deserialize<'de>
16184    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
16185{
16186    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16187        use std::str::FromStr;
16188        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16189        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
16190    }
16191}
16192/// Selected network to process this PaymentIntent on.
16193/// Depends on the available networks of the card attached to the PaymentIntent.
16194/// Can be only set confirm-time.
16195#[derive(Copy, Clone, Eq, PartialEq)]
16196pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16197    Amex,
16198    CartesBancaires,
16199    Diners,
16200    Discover,
16201    EftposAu,
16202    Girocard,
16203    Interac,
16204    Jcb,
16205    Link,
16206    Mastercard,
16207    Unionpay,
16208    Unknown,
16209    Visa,
16210}
16211impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16212    pub fn as_str(self) -> &'static str {
16213        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
16214        match self {
16215            Amex => "amex",
16216            CartesBancaires => "cartes_bancaires",
16217            Diners => "diners",
16218            Discover => "discover",
16219            EftposAu => "eftpos_au",
16220            Girocard => "girocard",
16221            Interac => "interac",
16222            Jcb => "jcb",
16223            Link => "link",
16224            Mastercard => "mastercard",
16225            Unionpay => "unionpay",
16226            Unknown => "unknown",
16227            Visa => "visa",
16228        }
16229    }
16230}
16231
16232impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16233    type Err = stripe_types::StripeParseError;
16234    fn from_str(s: &str) -> Result<Self, Self::Err> {
16235        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
16236        match s {
16237            "amex" => Ok(Amex),
16238            "cartes_bancaires" => Ok(CartesBancaires),
16239            "diners" => Ok(Diners),
16240            "discover" => Ok(Discover),
16241            "eftpos_au" => Ok(EftposAu),
16242            "girocard" => Ok(Girocard),
16243            "interac" => Ok(Interac),
16244            "jcb" => Ok(Jcb),
16245            "link" => Ok(Link),
16246            "mastercard" => Ok(Mastercard),
16247            "unionpay" => Ok(Unionpay),
16248            "unknown" => Ok(Unknown),
16249            "visa" => Ok(Visa),
16250            _ => Err(stripe_types::StripeParseError),
16251        }
16252    }
16253}
16254impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16255    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16256        f.write_str(self.as_str())
16257    }
16258}
16259
16260impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16262        f.write_str(self.as_str())
16263    }
16264}
16265impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16266    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16267    where
16268        S: serde::Serializer,
16269    {
16270        serializer.serialize_str(self.as_str())
16271    }
16272}
16273#[cfg(feature = "deserialize")]
16274impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16275    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16276        use std::str::FromStr;
16277        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16278        Self::from_str(&s).map_err(|_| {
16279            serde::de::Error::custom(
16280                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardNetwork",
16281            )
16282        })
16283    }
16284}
16285/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
16286#[derive(Copy, Clone, Eq, PartialEq)]
16287pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16288    IfAvailable,
16289    Never,
16290}
16291impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16292    pub fn as_str(self) -> &'static str {
16293        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
16294        match self {
16295            IfAvailable => "if_available",
16296            Never => "never",
16297        }
16298    }
16299}
16300
16301impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16302    type Err = stripe_types::StripeParseError;
16303    fn from_str(s: &str) -> Result<Self, Self::Err> {
16304        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
16305        match s {
16306            "if_available" => Ok(IfAvailable),
16307            "never" => Ok(Never),
16308            _ => Err(stripe_types::StripeParseError),
16309        }
16310    }
16311}
16312impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16313    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16314        f.write_str(self.as_str())
16315    }
16316}
16317
16318impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16319    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16320        f.write_str(self.as_str())
16321    }
16322}
16323impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16324    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16325    where
16326        S: serde::Serializer,
16327    {
16328        serializer.serialize_str(self.as_str())
16329    }
16330}
16331#[cfg(feature = "deserialize")]
16332impl<'de> serde::Deserialize<'de>
16333    for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
16334{
16335    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16336        use std::str::FromStr;
16337        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16338        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
16339    }
16340}
16341/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
16342#[derive(Copy, Clone, Eq, PartialEq)]
16343pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
16344    IfAvailable,
16345    Never,
16346}
16347impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
16348    pub fn as_str(self) -> &'static str {
16349        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
16350        match self {
16351            IfAvailable => "if_available",
16352            Never => "never",
16353        }
16354    }
16355}
16356
16357impl std::str::FromStr
16358    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16359{
16360    type Err = stripe_types::StripeParseError;
16361    fn from_str(s: &str) -> Result<Self, Self::Err> {
16362        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
16363        match s {
16364            "if_available" => Ok(IfAvailable),
16365            "never" => Ok(Never),
16366            _ => Err(stripe_types::StripeParseError),
16367        }
16368    }
16369}
16370impl std::fmt::Display
16371    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16372{
16373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16374        f.write_str(self.as_str())
16375    }
16376}
16377
16378impl std::fmt::Debug
16379    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16380{
16381    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16382        f.write_str(self.as_str())
16383    }
16384}
16385impl serde::Serialize
16386    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16387{
16388    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16389    where
16390        S: serde::Serializer,
16391    {
16392        serializer.serialize_str(self.as_str())
16393    }
16394}
16395#[cfg(feature = "deserialize")]
16396impl<'de> serde::Deserialize<'de>
16397    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16398{
16399    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16400        use std::str::FromStr;
16401        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16402        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
16403    }
16404}
16405/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
16406#[derive(Copy, Clone, Eq, PartialEq)]
16407pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16408    IfAvailable,
16409    Never,
16410}
16411impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16412    pub fn as_str(self) -> &'static str {
16413        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
16414        match self {
16415            IfAvailable => "if_available",
16416            Never => "never",
16417        }
16418    }
16419}
16420
16421impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16422    type Err = stripe_types::StripeParseError;
16423    fn from_str(s: &str) -> Result<Self, Self::Err> {
16424        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
16425        match s {
16426            "if_available" => Ok(IfAvailable),
16427            "never" => Ok(Never),
16428            _ => Err(stripe_types::StripeParseError),
16429        }
16430    }
16431}
16432impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16433    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16434        f.write_str(self.as_str())
16435    }
16436}
16437
16438impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16439    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16440        f.write_str(self.as_str())
16441    }
16442}
16443impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16444    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16445    where
16446        S: serde::Serializer,
16447    {
16448        serializer.serialize_str(self.as_str())
16449    }
16450}
16451#[cfg(feature = "deserialize")]
16452impl<'de> serde::Deserialize<'de>
16453    for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
16454{
16455    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16456        use std::str::FromStr;
16457        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16458        Self::from_str(&s).map_err(|_| {
16459            serde::de::Error::custom(
16460                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture",
16461            )
16462        })
16463    }
16464}
16465/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
16466#[derive(Copy, Clone, Eq, PartialEq)]
16467pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16468    IfAvailable,
16469    Never,
16470}
16471impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16472    pub fn as_str(self) -> &'static str {
16473        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
16474        match self {
16475            IfAvailable => "if_available",
16476            Never => "never",
16477        }
16478    }
16479}
16480
16481impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16482    type Err = stripe_types::StripeParseError;
16483    fn from_str(s: &str) -> Result<Self, Self::Err> {
16484        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
16485        match s {
16486            "if_available" => Ok(IfAvailable),
16487            "never" => Ok(Never),
16488            _ => Err(stripe_types::StripeParseError),
16489        }
16490    }
16491}
16492impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16494        f.write_str(self.as_str())
16495    }
16496}
16497
16498impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16499    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16500        f.write_str(self.as_str())
16501    }
16502}
16503impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16504    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16505    where
16506        S: serde::Serializer,
16507    {
16508        serializer.serialize_str(self.as_str())
16509    }
16510}
16511#[cfg(feature = "deserialize")]
16512impl<'de> serde::Deserialize<'de>
16513    for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
16514{
16515    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16516        use std::str::FromStr;
16517        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16518        Self::from_str(&s).map_err(|_| {
16519            serde::de::Error::custom(
16520                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture",
16521            )
16522        })
16523    }
16524}
16525/// 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).
16526/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
16527/// If not provided, this value defaults to `automatic`.
16528/// 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.
16529#[derive(Copy, Clone, Eq, PartialEq)]
16530pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16531    Any,
16532    Automatic,
16533    Challenge,
16534}
16535impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16536    pub fn as_str(self) -> &'static str {
16537        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
16538        match self {
16539            Any => "any",
16540            Automatic => "automatic",
16541            Challenge => "challenge",
16542        }
16543    }
16544}
16545
16546impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16547    type Err = stripe_types::StripeParseError;
16548    fn from_str(s: &str) -> Result<Self, Self::Err> {
16549        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
16550        match s {
16551            "any" => Ok(Any),
16552            "automatic" => Ok(Automatic),
16553            "challenge" => Ok(Challenge),
16554            _ => Err(stripe_types::StripeParseError),
16555        }
16556    }
16557}
16558impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16559    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16560        f.write_str(self.as_str())
16561    }
16562}
16563
16564impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16565    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16566        f.write_str(self.as_str())
16567    }
16568}
16569impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16570    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16571    where
16572        S: serde::Serializer,
16573    {
16574        serializer.serialize_str(self.as_str())
16575    }
16576}
16577#[cfg(feature = "deserialize")]
16578impl<'de> serde::Deserialize<'de>
16579    for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
16580{
16581    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16582        use std::str::FromStr;
16583        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16584        Self::from_str(&s).map_err(|_| {
16585            serde::de::Error::custom(
16586                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
16587            )
16588        })
16589    }
16590}
16591/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16592///
16593/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16594/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16595///
16596/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16597///
16598/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16599///
16600/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16601#[derive(Copy, Clone, Eq, PartialEq)]
16602pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16603    None,
16604    OffSession,
16605    OnSession,
16606}
16607impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16608    pub fn as_str(self) -> &'static str {
16609        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
16610        match self {
16611            None => "none",
16612            OffSession => "off_session",
16613            OnSession => "on_session",
16614        }
16615    }
16616}
16617
16618impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16619    type Err = stripe_types::StripeParseError;
16620    fn from_str(s: &str) -> Result<Self, Self::Err> {
16621        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
16622        match s {
16623            "none" => Ok(None),
16624            "off_session" => Ok(OffSession),
16625            "on_session" => Ok(OnSession),
16626            _ => Err(stripe_types::StripeParseError),
16627        }
16628    }
16629}
16630impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16631    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16632        f.write_str(self.as_str())
16633    }
16634}
16635
16636impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16638        f.write_str(self.as_str())
16639    }
16640}
16641impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16642    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16643    where
16644        S: serde::Serializer,
16645    {
16646        serializer.serialize_str(self.as_str())
16647    }
16648}
16649#[cfg(feature = "deserialize")]
16650impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16651    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16652        use std::str::FromStr;
16653        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16654        Self::from_str(&s).map_err(|_| {
16655            serde::de::Error::custom(
16656                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
16657            )
16658        })
16659    }
16660}
16661/// If 3D Secure authentication was performed with a third-party provider,
16662/// the authentication details to use for this payment.
16663#[derive(Clone, Debug, serde::Serialize)]
16664pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
16665    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
16666    #[serde(skip_serializing_if = "Option::is_none")]
16667    pub ares_trans_status:
16668        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
16669    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
16670    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
16671    /// (Most 3D Secure providers will return the base64-encoded version, which
16672    /// is what you should specify here.)
16673    pub cryptogram: String,
16674    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
16675    /// provider and indicates what degree of authentication was performed.
16676    #[serde(skip_serializing_if = "Option::is_none")]
16677    pub electronic_commerce_indicator:
16678        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
16679    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
16680    #[serde(skip_serializing_if = "Option::is_none")]
16681    pub exemption_indicator:
16682        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
16683    /// Network specific 3DS fields. Network specific arguments require an
16684    /// explicit card brand choice. The parameter `payment_method_options.card.network``
16685    /// must be populated accordingly
16686    #[serde(skip_serializing_if = "Option::is_none")]
16687    pub network_options:
16688        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
16689    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
16690    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
16691    #[serde(skip_serializing_if = "Option::is_none")]
16692    pub requestor_challenge_indicator: Option<String>,
16693    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
16694    /// Transaction ID (dsTransID).
16695    pub transaction_id: String,
16696    /// The version of 3D Secure that was performed.
16697    pub version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
16698}
16699impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
16700    pub fn new(
16701        cryptogram: impl Into<String>,
16702        transaction_id: impl Into<String>,
16703        version: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
16704    ) -> Self {
16705        Self {
16706            ares_trans_status: None,
16707            cryptogram: cryptogram.into(),
16708            electronic_commerce_indicator: None,
16709            exemption_indicator: None,
16710            network_options: None,
16711            requestor_challenge_indicator: None,
16712            transaction_id: transaction_id.into(),
16713            version: version.into(),
16714        }
16715    }
16716}
16717/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
16718#[derive(Copy, Clone, Eq, PartialEq)]
16719pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16720    A,
16721    C,
16722    I,
16723    N,
16724    R,
16725    U,
16726    Y,
16727}
16728impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16729    pub fn as_str(self) -> &'static str {
16730        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16731        match self {
16732            A => "A",
16733            C => "C",
16734            I => "I",
16735            N => "N",
16736            R => "R",
16737            U => "U",
16738            Y => "Y",
16739        }
16740    }
16741}
16742
16743impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16744    type Err = stripe_types::StripeParseError;
16745    fn from_str(s: &str) -> Result<Self, Self::Err> {
16746        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16747        match s {
16748            "A" => Ok(A),
16749            "C" => Ok(C),
16750            "I" => Ok(I),
16751            "N" => Ok(N),
16752            "R" => Ok(R),
16753            "U" => Ok(U),
16754            "Y" => Ok(Y),
16755            _ => Err(stripe_types::StripeParseError),
16756        }
16757    }
16758}
16759impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16760    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16761        f.write_str(self.as_str())
16762    }
16763}
16764
16765impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16767        f.write_str(self.as_str())
16768    }
16769}
16770impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16771    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16772    where
16773        S: serde::Serializer,
16774    {
16775        serializer.serialize_str(self.as_str())
16776    }
16777}
16778#[cfg(feature = "deserialize")]
16779impl<'de> serde::Deserialize<'de>
16780    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
16781{
16782    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16783        use std::str::FromStr;
16784        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16785        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
16786    }
16787}
16788/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
16789/// provider and indicates what degree of authentication was performed.
16790#[derive(Copy, Clone, Eq, PartialEq)]
16791pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16792    V01,
16793    V02,
16794    V05,
16795    V06,
16796    V07,
16797}
16798impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16799    pub fn as_str(self) -> &'static str {
16800        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16801        match self {
16802            V01 => "01",
16803            V02 => "02",
16804            V05 => "05",
16805            V06 => "06",
16806            V07 => "07",
16807        }
16808    }
16809}
16810
16811impl std::str::FromStr
16812    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16813{
16814    type Err = stripe_types::StripeParseError;
16815    fn from_str(s: &str) -> Result<Self, Self::Err> {
16816        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16817        match s {
16818            "01" => Ok(V01),
16819            "02" => Ok(V02),
16820            "05" => Ok(V05),
16821            "06" => Ok(V06),
16822            "07" => Ok(V07),
16823            _ => Err(stripe_types::StripeParseError),
16824        }
16825    }
16826}
16827impl std::fmt::Display
16828    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16829{
16830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16831        f.write_str(self.as_str())
16832    }
16833}
16834
16835impl std::fmt::Debug
16836    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16837{
16838    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16839        f.write_str(self.as_str())
16840    }
16841}
16842impl serde::Serialize
16843    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16844{
16845    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16846    where
16847        S: serde::Serializer,
16848    {
16849        serializer.serialize_str(self.as_str())
16850    }
16851}
16852#[cfg(feature = "deserialize")]
16853impl<'de> serde::Deserialize<'de>
16854    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16855{
16856    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16857        use std::str::FromStr;
16858        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16859        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
16860    }
16861}
16862/// The exemption requested via 3DS and accepted by the issuer at authentication time.
16863#[derive(Copy, Clone, Eq, PartialEq)]
16864pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16865    LowRisk,
16866    None,
16867}
16868impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16869    pub fn as_str(self) -> &'static str {
16870        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
16871        match self {
16872            LowRisk => "low_risk",
16873            None => "none",
16874        }
16875    }
16876}
16877
16878impl std::str::FromStr
16879    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16880{
16881    type Err = stripe_types::StripeParseError;
16882    fn from_str(s: &str) -> Result<Self, Self::Err> {
16883        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
16884        match s {
16885            "low_risk" => Ok(LowRisk),
16886            "none" => Ok(None),
16887            _ => Err(stripe_types::StripeParseError),
16888        }
16889    }
16890}
16891impl std::fmt::Display
16892    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16893{
16894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16895        f.write_str(self.as_str())
16896    }
16897}
16898
16899impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16900    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16901        f.write_str(self.as_str())
16902    }
16903}
16904impl serde::Serialize
16905    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16906{
16907    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16908    where
16909        S: serde::Serializer,
16910    {
16911        serializer.serialize_str(self.as_str())
16912    }
16913}
16914#[cfg(feature = "deserialize")]
16915impl<'de> serde::Deserialize<'de>
16916    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16917{
16918    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16919        use std::str::FromStr;
16920        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16921        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
16922    }
16923}
16924/// Network specific 3DS fields. Network specific arguments require an
16925/// explicit card brand choice. The parameter `payment_method_options.card.network``
16926/// must be populated accordingly
16927#[derive(Clone, Debug, serde::Serialize)]
16928pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16929    /// Cartes Bancaires-specific 3DS fields.
16930    #[serde(skip_serializing_if = "Option::is_none")]
16931    pub cartes_bancaires: Option<
16932        UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
16933    >,
16934}
16935impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16936    pub fn new() -> Self {
16937        Self { cartes_bancaires: None }
16938    }
16939}
16940impl Default for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16941    fn default() -> Self {
16942        Self::new()
16943    }
16944}
16945/// Cartes Bancaires-specific 3DS fields.
16946#[derive(Clone, Debug, serde::Serialize)]
16947pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16948    /// The cryptogram calculation algorithm used by the card Issuer's ACS
16949    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
16950    /// messageExtension: CB-AVALGO
16951pub cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
16952    /// The exemption indicator returned from Cartes Bancaires in the ARes.
16953    /// message extension: CB-EXEMPTION; string (4 characters)
16954    /// This is a 3 byte bitmap (low significant byte first and most significant
16955    /// bit first) that has been Base64 encoded
16956#[serde(skip_serializing_if = "Option::is_none")]
16957pub cb_exemption: Option<String>,
16958    /// The risk score returned from Cartes Bancaires in the ARes.
16959    /// message extension: CB-SCORE; numeric value 0-99
16960#[serde(skip_serializing_if = "Option::is_none")]
16961pub cb_score: Option<i64>,
16962
16963}
16964impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16965    pub fn new(
16966        cb_avalgo: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
16967    ) -> Self {
16968        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
16969    }
16970}
16971/// The cryptogram calculation algorithm used by the card Issuer's ACS
16972/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
16973/// messageExtension: CB-AVALGO
16974#[derive(Copy, Clone, Eq, PartialEq)]
16975pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16976{
16977    V0,
16978    V1,
16979    V2,
16980    V3,
16981    V4,
16982    A,
16983}
16984impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
16985    pub fn as_str(self) -> &'static str {
16986        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16987        match self {
16988            V0 => "0",
16989            V1 => "1",
16990            V2 => "2",
16991            V3 => "3",
16992            V4 => "4",
16993            A => "A",
16994        }
16995    }
16996}
16997
16998impl std::str::FromStr
16999    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
17000{
17001    type Err = stripe_types::StripeParseError;
17002    fn from_str(s: &str) -> Result<Self, Self::Err> {
17003        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
17004        match s {
17005            "0" => Ok(V0),
17006            "1" => Ok(V1),
17007            "2" => Ok(V2),
17008            "3" => Ok(V3),
17009            "4" => Ok(V4),
17010            "A" => Ok(A),
17011            _ => Err(stripe_types::StripeParseError),
17012        }
17013    }
17014}
17015impl std::fmt::Display
17016    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
17017{
17018    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17019        f.write_str(self.as_str())
17020    }
17021}
17022
17023impl std::fmt::Debug
17024    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
17025{
17026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17027        f.write_str(self.as_str())
17028    }
17029}
17030impl serde::Serialize
17031    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
17032{
17033    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17034    where
17035        S: serde::Serializer,
17036    {
17037        serializer.serialize_str(self.as_str())
17038    }
17039}
17040#[cfg(feature = "deserialize")]
17041impl<'de> serde::Deserialize<'de>
17042    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
17043{
17044    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17045        use std::str::FromStr;
17046        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17047        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
17048    }
17049}
17050/// The version of 3D Secure that was performed.
17051#[derive(Copy, Clone, Eq, PartialEq)]
17052pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17053    V1_0_2,
17054    V2_1_0,
17055    V2_2_0,
17056}
17057impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17058    pub fn as_str(self) -> &'static str {
17059        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
17060        match self {
17061            V1_0_2 => "1.0.2",
17062            V2_1_0 => "2.1.0",
17063            V2_2_0 => "2.2.0",
17064        }
17065    }
17066}
17067
17068impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17069    type Err = stripe_types::StripeParseError;
17070    fn from_str(s: &str) -> Result<Self, Self::Err> {
17071        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
17072        match s {
17073            "1.0.2" => Ok(V1_0_2),
17074            "2.1.0" => Ok(V2_1_0),
17075            "2.2.0" => Ok(V2_2_0),
17076            _ => Err(stripe_types::StripeParseError),
17077        }
17078    }
17079}
17080impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17081    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17082        f.write_str(self.as_str())
17083    }
17084}
17085
17086impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17087    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17088        f.write_str(self.as_str())
17089    }
17090}
17091impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17092    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17093    where
17094        S: serde::Serializer,
17095    {
17096        serializer.serialize_str(self.as_str())
17097    }
17098}
17099#[cfg(feature = "deserialize")]
17100impl<'de> serde::Deserialize<'de>
17101    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
17102{
17103    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17104        use std::str::FromStr;
17105        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17106        Self::from_str(&s).map_err(|_| {
17107            serde::de::Error::custom(
17108                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
17109            )
17110        })
17111    }
17112}
17113/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
17114#[derive(Copy, Clone, Debug, serde::Serialize)]
17115pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent {
17116    /// Controls when the funds are captured from the customer's account.
17117    ///
17118    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17119    ///
17120    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17121    #[serde(skip_serializing_if = "Option::is_none")]
17122    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod>,
17123    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
17124    #[serde(skip_serializing_if = "Option::is_none")]
17125    pub request_extended_authorization: Option<bool>,
17126    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
17127    /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
17128    #[serde(skip_serializing_if = "Option::is_none")]
17129    pub request_incremental_authorization_support: Option<bool>,
17130    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
17131    #[serde(skip_serializing_if = "Option::is_none")]
17132    pub routing: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
17133}
17134impl UpdatePaymentIntentPaymentMethodOptionsCardPresent {
17135    pub fn new() -> Self {
17136        Self {
17137            capture_method: None,
17138            request_extended_authorization: None,
17139            request_incremental_authorization_support: None,
17140            routing: None,
17141        }
17142    }
17143}
17144impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresent {
17145    fn default() -> Self {
17146        Self::new()
17147    }
17148}
17149/// Controls when the funds are captured from the customer's account.
17150///
17151/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17152///
17153/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17154#[derive(Copy, Clone, Eq, PartialEq)]
17155pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
17156    Manual,
17157    ManualPreferred,
17158}
17159impl UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
17160    pub fn as_str(self) -> &'static str {
17161        use UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
17162        match self {
17163            Manual => "manual",
17164            ManualPreferred => "manual_preferred",
17165        }
17166    }
17167}
17168
17169impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
17170    type Err = stripe_types::StripeParseError;
17171    fn from_str(s: &str) -> Result<Self, Self::Err> {
17172        use UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
17173        match s {
17174            "manual" => Ok(Manual),
17175            "manual_preferred" => Ok(ManualPreferred),
17176            _ => Err(stripe_types::StripeParseError),
17177        }
17178    }
17179}
17180impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
17181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17182        f.write_str(self.as_str())
17183    }
17184}
17185
17186impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
17187    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17188        f.write_str(self.as_str())
17189    }
17190}
17191impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
17192    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17193    where
17194        S: serde::Serializer,
17195    {
17196        serializer.serialize_str(self.as_str())
17197    }
17198}
17199#[cfg(feature = "deserialize")]
17200impl<'de> serde::Deserialize<'de>
17201    for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod
17202{
17203    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17204        use std::str::FromStr;
17205        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17206        Self::from_str(&s).map_err(|_| {
17207            serde::de::Error::custom(
17208                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod",
17209            )
17210        })
17211    }
17212}
17213/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
17214#[derive(Copy, Clone, Debug, serde::Serialize)]
17215pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
17216    /// Routing requested priority
17217    #[serde(skip_serializing_if = "Option::is_none")]
17218    pub requested_priority:
17219        Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
17220}
17221impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
17222    pub fn new() -> Self {
17223        Self { requested_priority: None }
17224    }
17225}
17226impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
17227    fn default() -> Self {
17228        Self::new()
17229    }
17230}
17231/// Routing requested priority
17232#[derive(Copy, Clone, Eq, PartialEq)]
17233pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
17234    Domestic,
17235    International,
17236}
17237impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
17238    pub fn as_str(self) -> &'static str {
17239        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
17240        match self {
17241            Domestic => "domestic",
17242            International => "international",
17243        }
17244    }
17245}
17246
17247impl std::str::FromStr
17248    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17249{
17250    type Err = stripe_types::StripeParseError;
17251    fn from_str(s: &str) -> Result<Self, Self::Err> {
17252        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
17253        match s {
17254            "domestic" => Ok(Domestic),
17255            "international" => Ok(International),
17256            _ => Err(stripe_types::StripeParseError),
17257        }
17258    }
17259}
17260impl std::fmt::Display
17261    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17262{
17263    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17264        f.write_str(self.as_str())
17265    }
17266}
17267
17268impl std::fmt::Debug
17269    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17270{
17271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17272        f.write_str(self.as_str())
17273    }
17274}
17275impl serde::Serialize
17276    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17277{
17278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17279    where
17280        S: serde::Serializer,
17281    {
17282        serializer.serialize_str(self.as_str())
17283    }
17284}
17285#[cfg(feature = "deserialize")]
17286impl<'de> serde::Deserialize<'de>
17287    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17288{
17289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17290        use std::str::FromStr;
17291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17292        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
17293    }
17294}
17295/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
17296#[derive(Copy, Clone, Debug, serde::Serialize)]
17297pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp {
17298    /// Controls when the funds are captured from the customer's account.
17299    ///
17300    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17301    ///
17302    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17303    #[serde(skip_serializing_if = "Option::is_none")]
17304    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
17305    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17306    ///
17307    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17308    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17309    ///
17310    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17311    ///
17312    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17313    ///
17314    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17315    #[serde(skip_serializing_if = "Option::is_none")]
17316    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
17317}
17318impl UpdatePaymentIntentPaymentMethodOptionsCashapp {
17319    pub fn new() -> Self {
17320        Self { capture_method: None, setup_future_usage: None }
17321    }
17322}
17323impl Default for UpdatePaymentIntentPaymentMethodOptionsCashapp {
17324    fn default() -> Self {
17325        Self::new()
17326    }
17327}
17328/// Controls when the funds are captured from the customer's account.
17329///
17330/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
17331///
17332/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
17333#[derive(Copy, Clone, Eq, PartialEq)]
17334pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17335    Manual,
17336}
17337impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17338    pub fn as_str(self) -> &'static str {
17339        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
17340        match self {
17341            Manual => "manual",
17342        }
17343    }
17344}
17345
17346impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17347    type Err = stripe_types::StripeParseError;
17348    fn from_str(s: &str) -> Result<Self, Self::Err> {
17349        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
17350        match s {
17351            "manual" => Ok(Manual),
17352            _ => Err(stripe_types::StripeParseError),
17353        }
17354    }
17355}
17356impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17357    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17358        f.write_str(self.as_str())
17359    }
17360}
17361
17362impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17364        f.write_str(self.as_str())
17365    }
17366}
17367impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17368    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17369    where
17370        S: serde::Serializer,
17371    {
17372        serializer.serialize_str(self.as_str())
17373    }
17374}
17375#[cfg(feature = "deserialize")]
17376impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17377    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17378        use std::str::FromStr;
17379        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17380        Self::from_str(&s).map_err(|_| {
17381            serde::de::Error::custom(
17382                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod",
17383            )
17384        })
17385    }
17386}
17387/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17388///
17389/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17390/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17391///
17392/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17393///
17394/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17395///
17396/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17397#[derive(Copy, Clone, Eq, PartialEq)]
17398pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17399    None,
17400    OffSession,
17401    OnSession,
17402}
17403impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17404    pub fn as_str(self) -> &'static str {
17405        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
17406        match self {
17407            None => "none",
17408            OffSession => "off_session",
17409            OnSession => "on_session",
17410        }
17411    }
17412}
17413
17414impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17415    type Err = stripe_types::StripeParseError;
17416    fn from_str(s: &str) -> Result<Self, Self::Err> {
17417        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
17418        match s {
17419            "none" => Ok(None),
17420            "off_session" => Ok(OffSession),
17421            "on_session" => Ok(OnSession),
17422            _ => Err(stripe_types::StripeParseError),
17423        }
17424    }
17425}
17426impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17427    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17428        f.write_str(self.as_str())
17429    }
17430}
17431
17432impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17433    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17434        f.write_str(self.as_str())
17435    }
17436}
17437impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17438    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17439    where
17440        S: serde::Serializer,
17441    {
17442        serializer.serialize_str(self.as_str())
17443    }
17444}
17445#[cfg(feature = "deserialize")]
17446impl<'de> serde::Deserialize<'de>
17447    for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
17448{
17449    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17450        use std::str::FromStr;
17451        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17452        Self::from_str(&s).map_err(|_| {
17453            serde::de::Error::custom(
17454                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
17455            )
17456        })
17457    }
17458}
17459/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
17460#[derive(Copy, Clone, Debug, serde::Serialize)]
17461pub struct UpdatePaymentIntentPaymentMethodOptionsCrypto {
17462    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17463    ///
17464    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17465    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17466    ///
17467    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17468    ///
17469    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17470    ///
17471    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17472    #[serde(skip_serializing_if = "Option::is_none")]
17473    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
17474}
17475impl UpdatePaymentIntentPaymentMethodOptionsCrypto {
17476    pub fn new() -> Self {
17477        Self { setup_future_usage: None }
17478    }
17479}
17480impl Default for UpdatePaymentIntentPaymentMethodOptionsCrypto {
17481    fn default() -> Self {
17482        Self::new()
17483    }
17484}
17485/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17486///
17487/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17488/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17489///
17490/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17491///
17492/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17493///
17494/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17495#[derive(Copy, Clone, Eq, PartialEq)]
17496pub enum UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17497    None,
17498}
17499impl UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17500    pub fn as_str(self) -> &'static str {
17501        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
17502        match self {
17503            None => "none",
17504        }
17505    }
17506}
17507
17508impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17509    type Err = stripe_types::StripeParseError;
17510    fn from_str(s: &str) -> Result<Self, Self::Err> {
17511        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
17512        match s {
17513            "none" => Ok(None),
17514            _ => Err(stripe_types::StripeParseError),
17515        }
17516    }
17517}
17518impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17519    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17520        f.write_str(self.as_str())
17521    }
17522}
17523
17524impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17525    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17526        f.write_str(self.as_str())
17527    }
17528}
17529impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17530    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17531    where
17532        S: serde::Serializer,
17533    {
17534        serializer.serialize_str(self.as_str())
17535    }
17536}
17537#[cfg(feature = "deserialize")]
17538impl<'de> serde::Deserialize<'de>
17539    for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
17540{
17541    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17542        use std::str::FromStr;
17543        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17544        Self::from_str(&s).map_err(|_| {
17545            serde::de::Error::custom(
17546                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
17547            )
17548        })
17549    }
17550}
17551/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
17552#[derive(Clone, Debug, serde::Serialize)]
17553pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
17554    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
17555    #[serde(skip_serializing_if = "Option::is_none")]
17556    pub bank_transfer: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
17557    /// The funding method type to be used when there are not enough funds in the customer balance.
17558    /// Permitted values include: `bank_transfer`.
17559    #[serde(skip_serializing_if = "Option::is_none")]
17560    pub funding_type: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
17561    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17562    ///
17563    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17564    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17565    ///
17566    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17567    ///
17568    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17569    ///
17570    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17571    #[serde(skip_serializing_if = "Option::is_none")]
17572    pub setup_future_usage:
17573        Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
17574}
17575impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
17576    pub fn new() -> Self {
17577        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
17578    }
17579}
17580impl Default for UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
17581    fn default() -> Self {
17582        Self::new()
17583    }
17584}
17585/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
17586#[derive(Clone, Debug, serde::Serialize)]
17587pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
17588    /// Configuration for the eu_bank_transfer funding type.
17589    #[serde(skip_serializing_if = "Option::is_none")]
17590    pub eu_bank_transfer: Option<EuBankTransferParams>,
17591    /// List of address types that should be returned in the financial_addresses response.
17592    /// If not specified, all valid types will be returned.
17593    ///
17594    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
17595    #[serde(skip_serializing_if = "Option::is_none")]
17596    pub requested_address_types: Option<
17597        Vec<
17598            UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
17599        >,
17600    >,
17601    /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
17602    #[serde(rename = "type")]
17603    pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
17604}
17605impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
17606    pub fn new(
17607        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
17608    ) -> Self {
17609        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
17610    }
17611}
17612/// List of address types that should be returned in the financial_addresses response.
17613/// If not specified, all valid types will be returned.
17614///
17615/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
17616#[derive(Copy, Clone, Eq, PartialEq)]
17617pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
17618    Aba,
17619    Iban,
17620    Sepa,
17621    SortCode,
17622    Spei,
17623    Swift,
17624    Zengin,
17625}
17626impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
17627    pub fn as_str(self) -> &'static str {
17628        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
17629        match self {
17630            Aba => "aba",
17631            Iban => "iban",
17632            Sepa => "sepa",
17633            SortCode => "sort_code",
17634            Spei => "spei",
17635            Swift => "swift",
17636            Zengin => "zengin",
17637        }
17638    }
17639}
17640
17641impl std::str::FromStr
17642    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17643{
17644    type Err = stripe_types::StripeParseError;
17645    fn from_str(s: &str) -> Result<Self, Self::Err> {
17646        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
17647        match s {
17648            "aba" => Ok(Aba),
17649            "iban" => Ok(Iban),
17650            "sepa" => Ok(Sepa),
17651            "sort_code" => Ok(SortCode),
17652            "spei" => Ok(Spei),
17653            "swift" => Ok(Swift),
17654            "zengin" => Ok(Zengin),
17655            _ => Err(stripe_types::StripeParseError),
17656        }
17657    }
17658}
17659impl std::fmt::Display
17660    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17661{
17662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17663        f.write_str(self.as_str())
17664    }
17665}
17666
17667impl std::fmt::Debug
17668    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17669{
17670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17671        f.write_str(self.as_str())
17672    }
17673}
17674impl serde::Serialize
17675    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17676{
17677    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17678    where
17679        S: serde::Serializer,
17680    {
17681        serializer.serialize_str(self.as_str())
17682    }
17683}
17684#[cfg(feature = "deserialize")]
17685impl<'de> serde::Deserialize<'de>
17686    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17687{
17688    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17689        use std::str::FromStr;
17690        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17691        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
17692    }
17693}
17694/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
17695#[derive(Copy, Clone, Eq, PartialEq)]
17696pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17697    EuBankTransfer,
17698    GbBankTransfer,
17699    JpBankTransfer,
17700    MxBankTransfer,
17701    UsBankTransfer,
17702}
17703impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17704    pub fn as_str(self) -> &'static str {
17705        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
17706        match self {
17707            EuBankTransfer => "eu_bank_transfer",
17708            GbBankTransfer => "gb_bank_transfer",
17709            JpBankTransfer => "jp_bank_transfer",
17710            MxBankTransfer => "mx_bank_transfer",
17711            UsBankTransfer => "us_bank_transfer",
17712        }
17713    }
17714}
17715
17716impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17717    type Err = stripe_types::StripeParseError;
17718    fn from_str(s: &str) -> Result<Self, Self::Err> {
17719        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
17720        match s {
17721            "eu_bank_transfer" => Ok(EuBankTransfer),
17722            "gb_bank_transfer" => Ok(GbBankTransfer),
17723            "jp_bank_transfer" => Ok(JpBankTransfer),
17724            "mx_bank_transfer" => Ok(MxBankTransfer),
17725            "us_bank_transfer" => Ok(UsBankTransfer),
17726            _ => Err(stripe_types::StripeParseError),
17727        }
17728    }
17729}
17730impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17731    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17732        f.write_str(self.as_str())
17733    }
17734}
17735
17736impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17737    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17738        f.write_str(self.as_str())
17739    }
17740}
17741impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17742    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17743    where
17744        S: serde::Serializer,
17745    {
17746        serializer.serialize_str(self.as_str())
17747    }
17748}
17749#[cfg(feature = "deserialize")]
17750impl<'de> serde::Deserialize<'de>
17751    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
17752{
17753    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17754        use std::str::FromStr;
17755        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17756        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
17757    }
17758}
17759/// The funding method type to be used when there are not enough funds in the customer balance.
17760/// Permitted values include: `bank_transfer`.
17761#[derive(Copy, Clone, Eq, PartialEq)]
17762pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17763    BankTransfer,
17764}
17765impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17766    pub fn as_str(self) -> &'static str {
17767        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
17768        match self {
17769            BankTransfer => "bank_transfer",
17770        }
17771    }
17772}
17773
17774impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17775    type Err = stripe_types::StripeParseError;
17776    fn from_str(s: &str) -> Result<Self, Self::Err> {
17777        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
17778        match s {
17779            "bank_transfer" => Ok(BankTransfer),
17780            _ => Err(stripe_types::StripeParseError),
17781        }
17782    }
17783}
17784impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17785    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17786        f.write_str(self.as_str())
17787    }
17788}
17789
17790impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17791    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17792        f.write_str(self.as_str())
17793    }
17794}
17795impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17796    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17797    where
17798        S: serde::Serializer,
17799    {
17800        serializer.serialize_str(self.as_str())
17801    }
17802}
17803#[cfg(feature = "deserialize")]
17804impl<'de> serde::Deserialize<'de>
17805    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
17806{
17807    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17808        use std::str::FromStr;
17809        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17810        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
17811    }
17812}
17813/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17814///
17815/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17816/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17817///
17818/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17819///
17820/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17821///
17822/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17823#[derive(Copy, Clone, Eq, PartialEq)]
17824pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17825    None,
17826}
17827impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17828    pub fn as_str(self) -> &'static str {
17829        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
17830        match self {
17831            None => "none",
17832        }
17833    }
17834}
17835
17836impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17837    type Err = stripe_types::StripeParseError;
17838    fn from_str(s: &str) -> Result<Self, Self::Err> {
17839        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
17840        match s {
17841            "none" => Ok(None),
17842            _ => Err(stripe_types::StripeParseError),
17843        }
17844    }
17845}
17846impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17847    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17848        f.write_str(self.as_str())
17849    }
17850}
17851
17852impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17853    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17854        f.write_str(self.as_str())
17855    }
17856}
17857impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17858    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17859    where
17860        S: serde::Serializer,
17861    {
17862        serializer.serialize_str(self.as_str())
17863    }
17864}
17865#[cfg(feature = "deserialize")]
17866impl<'de> serde::Deserialize<'de>
17867    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
17868{
17869    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17870        use std::str::FromStr;
17871        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17872        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
17873    }
17874}
17875/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
17876#[derive(Copy, Clone, Debug, serde::Serialize)]
17877pub struct UpdatePaymentIntentPaymentMethodOptionsEps {
17878    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17879    ///
17880    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17881    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17882    ///
17883    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17884    ///
17885    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17886    ///
17887    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17888    #[serde(skip_serializing_if = "Option::is_none")]
17889    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
17890}
17891impl UpdatePaymentIntentPaymentMethodOptionsEps {
17892    pub fn new() -> Self {
17893        Self { setup_future_usage: None }
17894    }
17895}
17896impl Default for UpdatePaymentIntentPaymentMethodOptionsEps {
17897    fn default() -> Self {
17898        Self::new()
17899    }
17900}
17901/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17902///
17903/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17904/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17905///
17906/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17907///
17908/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17909///
17910/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17911#[derive(Copy, Clone, Eq, PartialEq)]
17912pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17913    None,
17914}
17915impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17916    pub fn as_str(self) -> &'static str {
17917        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
17918        match self {
17919            None => "none",
17920        }
17921    }
17922}
17923
17924impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17925    type Err = stripe_types::StripeParseError;
17926    fn from_str(s: &str) -> Result<Self, Self::Err> {
17927        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
17928        match s {
17929            "none" => Ok(None),
17930            _ => Err(stripe_types::StripeParseError),
17931        }
17932    }
17933}
17934impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17936        f.write_str(self.as_str())
17937    }
17938}
17939
17940impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17941    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17942        f.write_str(self.as_str())
17943    }
17944}
17945impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17946    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17947    where
17948        S: serde::Serializer,
17949    {
17950        serializer.serialize_str(self.as_str())
17951    }
17952}
17953#[cfg(feature = "deserialize")]
17954impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17955    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17956        use std::str::FromStr;
17957        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17958        Self::from_str(&s).map_err(|_| {
17959            serde::de::Error::custom(
17960                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
17961            )
17962        })
17963    }
17964}
17965/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
17966#[derive(Copy, Clone, Debug, serde::Serialize)]
17967pub struct UpdatePaymentIntentPaymentMethodOptionsFpx {
17968    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17969    ///
17970    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17971    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17972    ///
17973    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17974    ///
17975    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17976    ///
17977    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17978    #[serde(skip_serializing_if = "Option::is_none")]
17979    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
17980}
17981impl UpdatePaymentIntentPaymentMethodOptionsFpx {
17982    pub fn new() -> Self {
17983        Self { setup_future_usage: None }
17984    }
17985}
17986impl Default for UpdatePaymentIntentPaymentMethodOptionsFpx {
17987    fn default() -> Self {
17988        Self::new()
17989    }
17990}
17991/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17992///
17993/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17994/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17995///
17996/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17997///
17998/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17999///
18000/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18001#[derive(Copy, Clone, Eq, PartialEq)]
18002pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18003    None,
18004}
18005impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18006    pub fn as_str(self) -> &'static str {
18007        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
18008        match self {
18009            None => "none",
18010        }
18011    }
18012}
18013
18014impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18015    type Err = stripe_types::StripeParseError;
18016    fn from_str(s: &str) -> Result<Self, Self::Err> {
18017        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
18018        match s {
18019            "none" => Ok(None),
18020            _ => Err(stripe_types::StripeParseError),
18021        }
18022    }
18023}
18024impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18025    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18026        f.write_str(self.as_str())
18027    }
18028}
18029
18030impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18031    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18032        f.write_str(self.as_str())
18033    }
18034}
18035impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18036    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18037    where
18038        S: serde::Serializer,
18039    {
18040        serializer.serialize_str(self.as_str())
18041    }
18042}
18043#[cfg(feature = "deserialize")]
18044impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
18045    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18046        use std::str::FromStr;
18047        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18048        Self::from_str(&s).map_err(|_| {
18049            serde::de::Error::custom(
18050                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
18051            )
18052        })
18053    }
18054}
18055/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
18056#[derive(Copy, Clone, Debug, serde::Serialize)]
18057pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay {
18058    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18059    ///
18060    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18061    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18062    ///
18063    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18064    ///
18065    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18066    ///
18067    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18068    #[serde(skip_serializing_if = "Option::is_none")]
18069    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
18070}
18071impl UpdatePaymentIntentPaymentMethodOptionsGiropay {
18072    pub fn new() -> Self {
18073        Self { setup_future_usage: None }
18074    }
18075}
18076impl Default for UpdatePaymentIntentPaymentMethodOptionsGiropay {
18077    fn default() -> Self {
18078        Self::new()
18079    }
18080}
18081/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18082///
18083/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18084/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18085///
18086/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18087///
18088/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18089///
18090/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18091#[derive(Copy, Clone, Eq, PartialEq)]
18092pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
18093    None,
18094}
18095impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
18096    pub fn as_str(self) -> &'static str {
18097        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
18098        match self {
18099            None => "none",
18100        }
18101    }
18102}
18103
18104impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
18105    type Err = stripe_types::StripeParseError;
18106    fn from_str(s: &str) -> Result<Self, Self::Err> {
18107        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
18108        match s {
18109            "none" => Ok(None),
18110            _ => Err(stripe_types::StripeParseError),
18111        }
18112    }
18113}
18114impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
18115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18116        f.write_str(self.as_str())
18117    }
18118}
18119
18120impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
18121    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18122        f.write_str(self.as_str())
18123    }
18124}
18125impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
18126    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18127    where
18128        S: serde::Serializer,
18129    {
18130        serializer.serialize_str(self.as_str())
18131    }
18132}
18133#[cfg(feature = "deserialize")]
18134impl<'de> serde::Deserialize<'de>
18135    for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
18136{
18137    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18138        use std::str::FromStr;
18139        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18140        Self::from_str(&s).map_err(|_| {
18141            serde::de::Error::custom(
18142                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
18143            )
18144        })
18145    }
18146}
18147/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
18148#[derive(Copy, Clone, Debug, serde::Serialize)]
18149pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay {
18150    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18151    ///
18152    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18153    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18154    ///
18155    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18156    ///
18157    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18158    ///
18159    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18160    #[serde(skip_serializing_if = "Option::is_none")]
18161    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
18162}
18163impl UpdatePaymentIntentPaymentMethodOptionsGrabpay {
18164    pub fn new() -> Self {
18165        Self { setup_future_usage: None }
18166    }
18167}
18168impl Default for UpdatePaymentIntentPaymentMethodOptionsGrabpay {
18169    fn default() -> Self {
18170        Self::new()
18171    }
18172}
18173/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18174///
18175/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18176/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18177///
18178/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18179///
18180/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18181///
18182/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18183#[derive(Copy, Clone, Eq, PartialEq)]
18184pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18185    None,
18186}
18187impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18188    pub fn as_str(self) -> &'static str {
18189        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
18190        match self {
18191            None => "none",
18192        }
18193    }
18194}
18195
18196impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18197    type Err = stripe_types::StripeParseError;
18198    fn from_str(s: &str) -> Result<Self, Self::Err> {
18199        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
18200        match s {
18201            "none" => Ok(None),
18202            _ => Err(stripe_types::StripeParseError),
18203        }
18204    }
18205}
18206impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18207    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18208        f.write_str(self.as_str())
18209    }
18210}
18211
18212impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18213    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18214        f.write_str(self.as_str())
18215    }
18216}
18217impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18218    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18219    where
18220        S: serde::Serializer,
18221    {
18222        serializer.serialize_str(self.as_str())
18223    }
18224}
18225#[cfg(feature = "deserialize")]
18226impl<'de> serde::Deserialize<'de>
18227    for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
18228{
18229    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18230        use std::str::FromStr;
18231        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18232        Self::from_str(&s).map_err(|_| {
18233            serde::de::Error::custom(
18234                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
18235            )
18236        })
18237    }
18238}
18239/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
18240#[derive(Copy, Clone, Debug, serde::Serialize)]
18241pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal {
18242    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18243    ///
18244    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18245    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18246    ///
18247    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18248    ///
18249    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18250    ///
18251    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18252    #[serde(skip_serializing_if = "Option::is_none")]
18253    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
18254}
18255impl UpdatePaymentIntentPaymentMethodOptionsIdeal {
18256    pub fn new() -> Self {
18257        Self { setup_future_usage: None }
18258    }
18259}
18260impl Default for UpdatePaymentIntentPaymentMethodOptionsIdeal {
18261    fn default() -> Self {
18262        Self::new()
18263    }
18264}
18265/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18266///
18267/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18268/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18269///
18270/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18271///
18272/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18273///
18274/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18275#[derive(Copy, Clone, Eq, PartialEq)]
18276pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18277    None,
18278    OffSession,
18279}
18280impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18281    pub fn as_str(self) -> &'static str {
18282        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
18283        match self {
18284            None => "none",
18285            OffSession => "off_session",
18286        }
18287    }
18288}
18289
18290impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18291    type Err = stripe_types::StripeParseError;
18292    fn from_str(s: &str) -> Result<Self, Self::Err> {
18293        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
18294        match s {
18295            "none" => Ok(None),
18296            "off_session" => Ok(OffSession),
18297            _ => Err(stripe_types::StripeParseError),
18298        }
18299    }
18300}
18301impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18303        f.write_str(self.as_str())
18304    }
18305}
18306
18307impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18308    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18309        f.write_str(self.as_str())
18310    }
18311}
18312impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18313    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18314    where
18315        S: serde::Serializer,
18316    {
18317        serializer.serialize_str(self.as_str())
18318    }
18319}
18320#[cfg(feature = "deserialize")]
18321impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18323        use std::str::FromStr;
18324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18325        Self::from_str(&s).map_err(|_| {
18326            serde::de::Error::custom(
18327                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
18328            )
18329        })
18330    }
18331}
18332/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
18333#[derive(Copy, Clone, Debug, serde::Serialize)]
18334pub struct UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
18335    /// Controls when the funds are captured from the customer's account.
18336    ///
18337    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18338    ///
18339    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18340    #[serde(skip_serializing_if = "Option::is_none")]
18341    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
18342    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18343    ///
18344    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18345    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18346    ///
18347    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18348    ///
18349    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18350    #[serde(skip_serializing_if = "Option::is_none")]
18351    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
18352}
18353impl UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
18354    pub fn new() -> Self {
18355        Self { capture_method: None, setup_future_usage: None }
18356    }
18357}
18358impl Default for UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
18359    fn default() -> Self {
18360        Self::new()
18361    }
18362}
18363/// Controls when the funds are captured from the customer's account.
18364///
18365/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18366///
18367/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18368#[derive(Copy, Clone, Eq, PartialEq)]
18369pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18370    Manual,
18371}
18372impl UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18373    pub fn as_str(self) -> &'static str {
18374        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
18375        match self {
18376            Manual => "manual",
18377        }
18378    }
18379}
18380
18381impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18382    type Err = stripe_types::StripeParseError;
18383    fn from_str(s: &str) -> Result<Self, Self::Err> {
18384        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
18385        match s {
18386            "manual" => Ok(Manual),
18387            _ => Err(stripe_types::StripeParseError),
18388        }
18389    }
18390}
18391impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18392    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18393        f.write_str(self.as_str())
18394    }
18395}
18396
18397impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18398    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18399        f.write_str(self.as_str())
18400    }
18401}
18402impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18403    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18404    where
18405        S: serde::Serializer,
18406    {
18407        serializer.serialize_str(self.as_str())
18408    }
18409}
18410#[cfg(feature = "deserialize")]
18411impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18412    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18413        use std::str::FromStr;
18414        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18415        Self::from_str(&s).map_err(|_| {
18416            serde::de::Error::custom(
18417                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
18418            )
18419        })
18420    }
18421}
18422/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18423///
18424/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18425/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18426///
18427/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18428///
18429/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18430#[derive(Copy, Clone, Eq, PartialEq)]
18431pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18432    None,
18433    OffSession,
18434}
18435impl UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18436    pub fn as_str(self) -> &'static str {
18437        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
18438        match self {
18439            None => "none",
18440            OffSession => "off_session",
18441        }
18442    }
18443}
18444
18445impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18446    type Err = stripe_types::StripeParseError;
18447    fn from_str(s: &str) -> Result<Self, Self::Err> {
18448        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
18449        match s {
18450            "none" => Ok(None),
18451            "off_session" => Ok(OffSession),
18452            _ => Err(stripe_types::StripeParseError),
18453        }
18454    }
18455}
18456impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18457    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18458        f.write_str(self.as_str())
18459    }
18460}
18461
18462impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18464        f.write_str(self.as_str())
18465    }
18466}
18467impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18468    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18469    where
18470        S: serde::Serializer,
18471    {
18472        serializer.serialize_str(self.as_str())
18473    }
18474}
18475#[cfg(feature = "deserialize")]
18476impl<'de> serde::Deserialize<'de>
18477    for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
18478{
18479    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18480        use std::str::FromStr;
18481        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18482        Self::from_str(&s).map_err(|_| {
18483            serde::de::Error::custom(
18484                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage",
18485            )
18486        })
18487    }
18488}
18489/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
18490#[derive(Clone, Debug, serde::Serialize)]
18491pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna {
18492    /// Controls when the funds are captured from the customer's account.
18493    ///
18494    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18495    ///
18496    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18497    #[serde(skip_serializing_if = "Option::is_none")]
18498    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
18499    /// On-demand details if setting up or charging an on-demand payment.
18500    #[serde(skip_serializing_if = "Option::is_none")]
18501    pub on_demand: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
18502    /// Preferred language of the Klarna authorization page that the customer is redirected to
18503    #[serde(skip_serializing_if = "Option::is_none")]
18504    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
18505    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18506    ///
18507    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18508    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18509    ///
18510    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18511    ///
18512    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18513    ///
18514    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18515    #[serde(skip_serializing_if = "Option::is_none")]
18516    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
18517    /// Subscription details if setting up or charging a subscription.
18518    #[serde(skip_serializing_if = "Option::is_none")]
18519    pub subscriptions: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
18520}
18521impl UpdatePaymentIntentPaymentMethodOptionsKlarna {
18522    pub fn new() -> Self {
18523        Self {
18524            capture_method: None,
18525            on_demand: None,
18526            preferred_locale: None,
18527            setup_future_usage: None,
18528            subscriptions: None,
18529        }
18530    }
18531}
18532impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarna {
18533    fn default() -> Self {
18534        Self::new()
18535    }
18536}
18537/// Controls when the funds are captured from the customer's account.
18538///
18539/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
18540///
18541/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
18542#[derive(Copy, Clone, Eq, PartialEq)]
18543pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18544    Manual,
18545}
18546impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18547    pub fn as_str(self) -> &'static str {
18548        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
18549        match self {
18550            Manual => "manual",
18551        }
18552    }
18553}
18554
18555impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18556    type Err = stripe_types::StripeParseError;
18557    fn from_str(s: &str) -> Result<Self, Self::Err> {
18558        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
18559        match s {
18560            "manual" => Ok(Manual),
18561            _ => Err(stripe_types::StripeParseError),
18562        }
18563    }
18564}
18565impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18566    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18567        f.write_str(self.as_str())
18568    }
18569}
18570
18571impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18573        f.write_str(self.as_str())
18574    }
18575}
18576impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18577    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18578    where
18579        S: serde::Serializer,
18580    {
18581        serializer.serialize_str(self.as_str())
18582    }
18583}
18584#[cfg(feature = "deserialize")]
18585impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18586    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18587        use std::str::FromStr;
18588        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18589        Self::from_str(&s).map_err(|_| {
18590            serde::de::Error::custom(
18591                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
18592            )
18593        })
18594    }
18595}
18596/// On-demand details if setting up or charging an on-demand payment.
18597#[derive(Copy, Clone, Debug, serde::Serialize)]
18598pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
18599    /// Your average amount value.
18600    /// You can use a value across your customer base, or segment based on customer type, country, etc.
18601    #[serde(skip_serializing_if = "Option::is_none")]
18602    pub average_amount: Option<i64>,
18603    /// The maximum value you may charge a customer per purchase.
18604    /// You can use a value across your customer base, or segment based on customer type, country, etc.
18605    #[serde(skip_serializing_if = "Option::is_none")]
18606    pub maximum_amount: Option<i64>,
18607    /// The lowest or minimum value you may charge a customer per purchase.
18608    /// You can use a value across your customer base, or segment based on customer type, country, etc.
18609    #[serde(skip_serializing_if = "Option::is_none")]
18610    pub minimum_amount: Option<i64>,
18611    /// Interval at which the customer is making purchases
18612    #[serde(skip_serializing_if = "Option::is_none")]
18613    pub purchase_interval:
18614        Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
18615    /// The number of `purchase_interval` between charges
18616    #[serde(skip_serializing_if = "Option::is_none")]
18617    pub purchase_interval_count: Option<u64>,
18618}
18619impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
18620    pub fn new() -> Self {
18621        Self {
18622            average_amount: None,
18623            maximum_amount: None,
18624            minimum_amount: None,
18625            purchase_interval: None,
18626            purchase_interval_count: None,
18627        }
18628    }
18629}
18630impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
18631    fn default() -> Self {
18632        Self::new()
18633    }
18634}
18635/// Interval at which the customer is making purchases
18636#[derive(Copy, Clone, Eq, PartialEq)]
18637pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18638    Day,
18639    Month,
18640    Week,
18641    Year,
18642}
18643impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18644    pub fn as_str(self) -> &'static str {
18645        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
18646        match self {
18647            Day => "day",
18648            Month => "month",
18649            Week => "week",
18650            Year => "year",
18651        }
18652    }
18653}
18654
18655impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18656    type Err = stripe_types::StripeParseError;
18657    fn from_str(s: &str) -> Result<Self, Self::Err> {
18658        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
18659        match s {
18660            "day" => Ok(Day),
18661            "month" => Ok(Month),
18662            "week" => Ok(Week),
18663            "year" => Ok(Year),
18664            _ => Err(stripe_types::StripeParseError),
18665        }
18666    }
18667}
18668impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18669    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18670        f.write_str(self.as_str())
18671    }
18672}
18673
18674impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18675    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18676        f.write_str(self.as_str())
18677    }
18678}
18679impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18680    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18681    where
18682        S: serde::Serializer,
18683    {
18684        serializer.serialize_str(self.as_str())
18685    }
18686}
18687#[cfg(feature = "deserialize")]
18688impl<'de> serde::Deserialize<'de>
18689    for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
18690{
18691    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18692        use std::str::FromStr;
18693        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18694        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
18695    }
18696}
18697/// Preferred language of the Klarna authorization page that the customer is redirected to
18698#[derive(Clone, Eq, PartialEq)]
18699#[non_exhaustive]
18700pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18701    CsMinusCz,
18702    DaMinusDk,
18703    DeMinusAt,
18704    DeMinusCh,
18705    DeMinusDe,
18706    ElMinusGr,
18707    EnMinusAt,
18708    EnMinusAu,
18709    EnMinusBe,
18710    EnMinusCa,
18711    EnMinusCh,
18712    EnMinusCz,
18713    EnMinusDe,
18714    EnMinusDk,
18715    EnMinusEs,
18716    EnMinusFi,
18717    EnMinusFr,
18718    EnMinusGb,
18719    EnMinusGr,
18720    EnMinusIe,
18721    EnMinusIt,
18722    EnMinusNl,
18723    EnMinusNo,
18724    EnMinusNz,
18725    EnMinusPl,
18726    EnMinusPt,
18727    EnMinusRo,
18728    EnMinusSe,
18729    EnMinusUs,
18730    EsMinusEs,
18731    EsMinusUs,
18732    FiMinusFi,
18733    FrMinusBe,
18734    FrMinusCa,
18735    FrMinusCh,
18736    FrMinusFr,
18737    ItMinusCh,
18738    ItMinusIt,
18739    NbMinusNo,
18740    NlMinusBe,
18741    NlMinusNl,
18742    PlMinusPl,
18743    PtMinusPt,
18744    RoMinusRo,
18745    SvMinusFi,
18746    SvMinusSe,
18747    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18748    Unknown(String),
18749}
18750impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18751    pub fn as_str(&self) -> &str {
18752        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
18753        match self {
18754            CsMinusCz => "cs-CZ",
18755            DaMinusDk => "da-DK",
18756            DeMinusAt => "de-AT",
18757            DeMinusCh => "de-CH",
18758            DeMinusDe => "de-DE",
18759            ElMinusGr => "el-GR",
18760            EnMinusAt => "en-AT",
18761            EnMinusAu => "en-AU",
18762            EnMinusBe => "en-BE",
18763            EnMinusCa => "en-CA",
18764            EnMinusCh => "en-CH",
18765            EnMinusCz => "en-CZ",
18766            EnMinusDe => "en-DE",
18767            EnMinusDk => "en-DK",
18768            EnMinusEs => "en-ES",
18769            EnMinusFi => "en-FI",
18770            EnMinusFr => "en-FR",
18771            EnMinusGb => "en-GB",
18772            EnMinusGr => "en-GR",
18773            EnMinusIe => "en-IE",
18774            EnMinusIt => "en-IT",
18775            EnMinusNl => "en-NL",
18776            EnMinusNo => "en-NO",
18777            EnMinusNz => "en-NZ",
18778            EnMinusPl => "en-PL",
18779            EnMinusPt => "en-PT",
18780            EnMinusRo => "en-RO",
18781            EnMinusSe => "en-SE",
18782            EnMinusUs => "en-US",
18783            EsMinusEs => "es-ES",
18784            EsMinusUs => "es-US",
18785            FiMinusFi => "fi-FI",
18786            FrMinusBe => "fr-BE",
18787            FrMinusCa => "fr-CA",
18788            FrMinusCh => "fr-CH",
18789            FrMinusFr => "fr-FR",
18790            ItMinusCh => "it-CH",
18791            ItMinusIt => "it-IT",
18792            NbMinusNo => "nb-NO",
18793            NlMinusBe => "nl-BE",
18794            NlMinusNl => "nl-NL",
18795            PlMinusPl => "pl-PL",
18796            PtMinusPt => "pt-PT",
18797            RoMinusRo => "ro-RO",
18798            SvMinusFi => "sv-FI",
18799            SvMinusSe => "sv-SE",
18800            Unknown(v) => v,
18801        }
18802    }
18803}
18804
18805impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18806    type Err = std::convert::Infallible;
18807    fn from_str(s: &str) -> Result<Self, Self::Err> {
18808        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
18809        match s {
18810            "cs-CZ" => Ok(CsMinusCz),
18811            "da-DK" => Ok(DaMinusDk),
18812            "de-AT" => Ok(DeMinusAt),
18813            "de-CH" => Ok(DeMinusCh),
18814            "de-DE" => Ok(DeMinusDe),
18815            "el-GR" => Ok(ElMinusGr),
18816            "en-AT" => Ok(EnMinusAt),
18817            "en-AU" => Ok(EnMinusAu),
18818            "en-BE" => Ok(EnMinusBe),
18819            "en-CA" => Ok(EnMinusCa),
18820            "en-CH" => Ok(EnMinusCh),
18821            "en-CZ" => Ok(EnMinusCz),
18822            "en-DE" => Ok(EnMinusDe),
18823            "en-DK" => Ok(EnMinusDk),
18824            "en-ES" => Ok(EnMinusEs),
18825            "en-FI" => Ok(EnMinusFi),
18826            "en-FR" => Ok(EnMinusFr),
18827            "en-GB" => Ok(EnMinusGb),
18828            "en-GR" => Ok(EnMinusGr),
18829            "en-IE" => Ok(EnMinusIe),
18830            "en-IT" => Ok(EnMinusIt),
18831            "en-NL" => Ok(EnMinusNl),
18832            "en-NO" => Ok(EnMinusNo),
18833            "en-NZ" => Ok(EnMinusNz),
18834            "en-PL" => Ok(EnMinusPl),
18835            "en-PT" => Ok(EnMinusPt),
18836            "en-RO" => Ok(EnMinusRo),
18837            "en-SE" => Ok(EnMinusSe),
18838            "en-US" => Ok(EnMinusUs),
18839            "es-ES" => Ok(EsMinusEs),
18840            "es-US" => Ok(EsMinusUs),
18841            "fi-FI" => Ok(FiMinusFi),
18842            "fr-BE" => Ok(FrMinusBe),
18843            "fr-CA" => Ok(FrMinusCa),
18844            "fr-CH" => Ok(FrMinusCh),
18845            "fr-FR" => Ok(FrMinusFr),
18846            "it-CH" => Ok(ItMinusCh),
18847            "it-IT" => Ok(ItMinusIt),
18848            "nb-NO" => Ok(NbMinusNo),
18849            "nl-BE" => Ok(NlMinusBe),
18850            "nl-NL" => Ok(NlMinusNl),
18851            "pl-PL" => Ok(PlMinusPl),
18852            "pt-PT" => Ok(PtMinusPt),
18853            "ro-RO" => Ok(RoMinusRo),
18854            "sv-FI" => Ok(SvMinusFi),
18855            "sv-SE" => Ok(SvMinusSe),
18856            v => Ok(Unknown(v.to_owned())),
18857        }
18858    }
18859}
18860impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18861    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18862        f.write_str(self.as_str())
18863    }
18864}
18865
18866impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18867    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18868        f.write_str(self.as_str())
18869    }
18870}
18871impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18872    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18873    where
18874        S: serde::Serializer,
18875    {
18876        serializer.serialize_str(self.as_str())
18877    }
18878}
18879#[cfg(feature = "deserialize")]
18880impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18881    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18882        use std::str::FromStr;
18883        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18884        Ok(Self::from_str(&s).unwrap())
18885    }
18886}
18887/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18888///
18889/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18890/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18891///
18892/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18893///
18894/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18895///
18896/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18897#[derive(Copy, Clone, Eq, PartialEq)]
18898pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18899    None,
18900    OffSession,
18901    OnSession,
18902}
18903impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18904    pub fn as_str(self) -> &'static str {
18905        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
18906        match self {
18907            None => "none",
18908            OffSession => "off_session",
18909            OnSession => "on_session",
18910        }
18911    }
18912}
18913
18914impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18915    type Err = stripe_types::StripeParseError;
18916    fn from_str(s: &str) -> Result<Self, Self::Err> {
18917        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
18918        match s {
18919            "none" => Ok(None),
18920            "off_session" => Ok(OffSession),
18921            "on_session" => Ok(OnSession),
18922            _ => Err(stripe_types::StripeParseError),
18923        }
18924    }
18925}
18926impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18927    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18928        f.write_str(self.as_str())
18929    }
18930}
18931
18932impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18933    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18934        f.write_str(self.as_str())
18935    }
18936}
18937impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18938    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18939    where
18940        S: serde::Serializer,
18941    {
18942        serializer.serialize_str(self.as_str())
18943    }
18944}
18945#[cfg(feature = "deserialize")]
18946impl<'de> serde::Deserialize<'de>
18947    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
18948{
18949    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18950        use std::str::FromStr;
18951        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18952        Self::from_str(&s).map_err(|_| {
18953            serde::de::Error::custom(
18954                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
18955            )
18956        })
18957    }
18958}
18959/// Subscription details if setting up or charging a subscription.
18960#[derive(Clone, Debug, serde::Serialize)]
18961pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
18962    /// Unit of time between subscription charges.
18963    pub interval: UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
18964    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
18965    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
18966    #[serde(skip_serializing_if = "Option::is_none")]
18967    pub interval_count: Option<u64>,
18968    /// Name for subscription.
18969    #[serde(skip_serializing_if = "Option::is_none")]
18970    pub name: Option<String>,
18971    /// Describes the upcoming charge for this subscription.
18972    #[serde(skip_serializing_if = "Option::is_none")]
18973    pub next_billing: Option<SubscriptionNextBillingParam>,
18974    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
18975    /// Use a value that persists across subscription charges.
18976    pub reference: String,
18977}
18978impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
18979    pub fn new(
18980        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
18981        reference: impl Into<String>,
18982    ) -> Self {
18983        Self {
18984            interval: interval.into(),
18985            interval_count: None,
18986            name: None,
18987            next_billing: None,
18988            reference: reference.into(),
18989        }
18990    }
18991}
18992/// Unit of time between subscription charges.
18993#[derive(Copy, Clone, Eq, PartialEq)]
18994pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18995    Day,
18996    Month,
18997    Week,
18998    Year,
18999}
19000impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
19001    pub fn as_str(self) -> &'static str {
19002        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
19003        match self {
19004            Day => "day",
19005            Month => "month",
19006            Week => "week",
19007            Year => "year",
19008        }
19009    }
19010}
19011
19012impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
19013    type Err = stripe_types::StripeParseError;
19014    fn from_str(s: &str) -> Result<Self, Self::Err> {
19015        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
19016        match s {
19017            "day" => Ok(Day),
19018            "month" => Ok(Month),
19019            "week" => Ok(Week),
19020            "year" => Ok(Year),
19021            _ => Err(stripe_types::StripeParseError),
19022        }
19023    }
19024}
19025impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
19026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19027        f.write_str(self.as_str())
19028    }
19029}
19030
19031impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
19032    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19033        f.write_str(self.as_str())
19034    }
19035}
19036impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
19037    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19038    where
19039        S: serde::Serializer,
19040    {
19041        serializer.serialize_str(self.as_str())
19042    }
19043}
19044#[cfg(feature = "deserialize")]
19045impl<'de> serde::Deserialize<'de>
19046    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
19047{
19048    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19049        use std::str::FromStr;
19050        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19051        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
19052    }
19053}
19054/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
19055#[derive(Clone, Debug, serde::Serialize)]
19056pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini {
19057    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
19058    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
19059    /// We recommend to use the customer's phone number.
19060    #[serde(skip_serializing_if = "Option::is_none")]
19061    pub confirmation_number: Option<String>,
19062    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
19063    /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST.
19064    /// Defaults to 3 days.
19065    #[serde(skip_serializing_if = "Option::is_none")]
19066    pub expires_after_days: Option<u32>,
19067    /// The timestamp at which the Konbini payment instructions will expire.
19068    /// Only one of `expires_after_days` or `expires_at` may be set.
19069    #[serde(skip_serializing_if = "Option::is_none")]
19070    pub expires_at: Option<stripe_types::Timestamp>,
19071    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
19072    #[serde(skip_serializing_if = "Option::is_none")]
19073    pub product_description: Option<String>,
19074    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19075    ///
19076    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19077    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19078    ///
19079    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19080    ///
19081    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19082    ///
19083    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19084    #[serde(skip_serializing_if = "Option::is_none")]
19085    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
19086}
19087impl UpdatePaymentIntentPaymentMethodOptionsKonbini {
19088    pub fn new() -> Self {
19089        Self {
19090            confirmation_number: None,
19091            expires_after_days: None,
19092            expires_at: None,
19093            product_description: None,
19094            setup_future_usage: None,
19095        }
19096    }
19097}
19098impl Default for UpdatePaymentIntentPaymentMethodOptionsKonbini {
19099    fn default() -> Self {
19100        Self::new()
19101    }
19102}
19103/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19104///
19105/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19106/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19107///
19108/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19109///
19110/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19111///
19112/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19113#[derive(Copy, Clone, Eq, PartialEq)]
19114pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
19115    None,
19116}
19117impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
19118    pub fn as_str(self) -> &'static str {
19119        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
19120        match self {
19121            None => "none",
19122        }
19123    }
19124}
19125
19126impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
19127    type Err = stripe_types::StripeParseError;
19128    fn from_str(s: &str) -> Result<Self, Self::Err> {
19129        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
19130        match s {
19131            "none" => Ok(None),
19132            _ => Err(stripe_types::StripeParseError),
19133        }
19134    }
19135}
19136impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
19137    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19138        f.write_str(self.as_str())
19139    }
19140}
19141
19142impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
19143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19144        f.write_str(self.as_str())
19145    }
19146}
19147impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
19148    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19149    where
19150        S: serde::Serializer,
19151    {
19152        serializer.serialize_str(self.as_str())
19153    }
19154}
19155#[cfg(feature = "deserialize")]
19156impl<'de> serde::Deserialize<'de>
19157    for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
19158{
19159    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19160        use std::str::FromStr;
19161        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19162        Self::from_str(&s).map_err(|_| {
19163            serde::de::Error::custom(
19164                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
19165            )
19166        })
19167    }
19168}
19169/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
19170#[derive(Copy, Clone, Debug, serde::Serialize)]
19171pub struct UpdatePaymentIntentPaymentMethodOptionsKrCard {
19172    /// Controls when the funds are captured from the customer's account.
19173    ///
19174    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19175    ///
19176    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19177    #[serde(skip_serializing_if = "Option::is_none")]
19178    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
19179    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19180    ///
19181    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19182    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19183    ///
19184    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19185    ///
19186    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19187    #[serde(skip_serializing_if = "Option::is_none")]
19188    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
19189}
19190impl UpdatePaymentIntentPaymentMethodOptionsKrCard {
19191    pub fn new() -> Self {
19192        Self { capture_method: None, setup_future_usage: None }
19193    }
19194}
19195impl Default for UpdatePaymentIntentPaymentMethodOptionsKrCard {
19196    fn default() -> Self {
19197        Self::new()
19198    }
19199}
19200/// Controls when the funds are captured from the customer's account.
19201///
19202/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19203///
19204/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19205#[derive(Copy, Clone, Eq, PartialEq)]
19206pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19207    Manual,
19208}
19209impl UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19210    pub fn as_str(self) -> &'static str {
19211        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
19212        match self {
19213            Manual => "manual",
19214        }
19215    }
19216}
19217
19218impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19219    type Err = stripe_types::StripeParseError;
19220    fn from_str(s: &str) -> Result<Self, Self::Err> {
19221        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
19222        match s {
19223            "manual" => Ok(Manual),
19224            _ => Err(stripe_types::StripeParseError),
19225        }
19226    }
19227}
19228impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19229    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19230        f.write_str(self.as_str())
19231    }
19232}
19233
19234impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19235    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19236        f.write_str(self.as_str())
19237    }
19238}
19239impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19240    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19241    where
19242        S: serde::Serializer,
19243    {
19244        serializer.serialize_str(self.as_str())
19245    }
19246}
19247#[cfg(feature = "deserialize")]
19248impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19249    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19250        use std::str::FromStr;
19251        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19252        Self::from_str(&s).map_err(|_| {
19253            serde::de::Error::custom(
19254                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
19255            )
19256        })
19257    }
19258}
19259/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19260///
19261/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19262/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19263///
19264/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19265///
19266/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19267#[derive(Copy, Clone, Eq, PartialEq)]
19268pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19269    None,
19270    OffSession,
19271}
19272impl UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19273    pub fn as_str(self) -> &'static str {
19274        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
19275        match self {
19276            None => "none",
19277            OffSession => "off_session",
19278        }
19279    }
19280}
19281
19282impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19283    type Err = stripe_types::StripeParseError;
19284    fn from_str(s: &str) -> Result<Self, Self::Err> {
19285        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
19286        match s {
19287            "none" => Ok(None),
19288            "off_session" => Ok(OffSession),
19289            _ => Err(stripe_types::StripeParseError),
19290        }
19291    }
19292}
19293impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19295        f.write_str(self.as_str())
19296    }
19297}
19298
19299impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19300    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19301        f.write_str(self.as_str())
19302    }
19303}
19304impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19305    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19306    where
19307        S: serde::Serializer,
19308    {
19309        serializer.serialize_str(self.as_str())
19310    }
19311}
19312#[cfg(feature = "deserialize")]
19313impl<'de> serde::Deserialize<'de>
19314    for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
19315{
19316    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19317        use std::str::FromStr;
19318        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19319        Self::from_str(&s).map_err(|_| {
19320            serde::de::Error::custom(
19321                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
19322            )
19323        })
19324    }
19325}
19326/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
19327#[derive(Clone, Debug, serde::Serialize)]
19328pub struct UpdatePaymentIntentPaymentMethodOptionsLink {
19329    /// Controls when the funds are captured from the customer's account.
19330    ///
19331    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19332    ///
19333    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19334    #[serde(skip_serializing_if = "Option::is_none")]
19335    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
19336    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
19337    #[serde(skip_serializing_if = "Option::is_none")]
19338    pub persistent_token: Option<String>,
19339    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19340    ///
19341    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19342    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19343    ///
19344    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19345    ///
19346    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19347    ///
19348    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19349    #[serde(skip_serializing_if = "Option::is_none")]
19350    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
19351}
19352impl UpdatePaymentIntentPaymentMethodOptionsLink {
19353    pub fn new() -> Self {
19354        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
19355    }
19356}
19357impl Default for UpdatePaymentIntentPaymentMethodOptionsLink {
19358    fn default() -> Self {
19359        Self::new()
19360    }
19361}
19362/// Controls when the funds are captured from the customer's account.
19363///
19364/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19365///
19366/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19367#[derive(Copy, Clone, Eq, PartialEq)]
19368pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19369    Manual,
19370}
19371impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19372    pub fn as_str(self) -> &'static str {
19373        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
19374        match self {
19375            Manual => "manual",
19376        }
19377    }
19378}
19379
19380impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19381    type Err = stripe_types::StripeParseError;
19382    fn from_str(s: &str) -> Result<Self, Self::Err> {
19383        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
19384        match s {
19385            "manual" => Ok(Manual),
19386            _ => Err(stripe_types::StripeParseError),
19387        }
19388    }
19389}
19390impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19391    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19392        f.write_str(self.as_str())
19393    }
19394}
19395
19396impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19397    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19398        f.write_str(self.as_str())
19399    }
19400}
19401impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19402    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19403    where
19404        S: serde::Serializer,
19405    {
19406        serializer.serialize_str(self.as_str())
19407    }
19408}
19409#[cfg(feature = "deserialize")]
19410impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19411    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19412        use std::str::FromStr;
19413        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19414        Self::from_str(&s).map_err(|_| {
19415            serde::de::Error::custom(
19416                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod",
19417            )
19418        })
19419    }
19420}
19421/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19422///
19423/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19424/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19425///
19426/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19427///
19428/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19429///
19430/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19431#[derive(Copy, Clone, Eq, PartialEq)]
19432pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19433    None,
19434    OffSession,
19435}
19436impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19437    pub fn as_str(self) -> &'static str {
19438        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
19439        match self {
19440            None => "none",
19441            OffSession => "off_session",
19442        }
19443    }
19444}
19445
19446impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19447    type Err = stripe_types::StripeParseError;
19448    fn from_str(s: &str) -> Result<Self, Self::Err> {
19449        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
19450        match s {
19451            "none" => Ok(None),
19452            "off_session" => Ok(OffSession),
19453            _ => Err(stripe_types::StripeParseError),
19454        }
19455    }
19456}
19457impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19459        f.write_str(self.as_str())
19460    }
19461}
19462
19463impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19465        f.write_str(self.as_str())
19466    }
19467}
19468impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19469    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19470    where
19471        S: serde::Serializer,
19472    {
19473        serializer.serialize_str(self.as_str())
19474    }
19475}
19476#[cfg(feature = "deserialize")]
19477impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19478    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19479        use std::str::FromStr;
19480        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19481        Self::from_str(&s).map_err(|_| {
19482            serde::de::Error::custom(
19483                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
19484            )
19485        })
19486    }
19487}
19488/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
19489#[derive(Copy, Clone, Debug, serde::Serialize)]
19490pub struct UpdatePaymentIntentPaymentMethodOptionsMbWay {
19491    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19492    ///
19493    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19494    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19495    ///
19496    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19497    ///
19498    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19499    ///
19500    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19501    #[serde(skip_serializing_if = "Option::is_none")]
19502    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
19503}
19504impl UpdatePaymentIntentPaymentMethodOptionsMbWay {
19505    pub fn new() -> Self {
19506        Self { setup_future_usage: None }
19507    }
19508}
19509impl Default for UpdatePaymentIntentPaymentMethodOptionsMbWay {
19510    fn default() -> Self {
19511        Self::new()
19512    }
19513}
19514/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19515///
19516/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19517/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19518///
19519/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19520///
19521/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19522///
19523/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19524#[derive(Copy, Clone, Eq, PartialEq)]
19525pub enum UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19526    None,
19527}
19528impl UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19529    pub fn as_str(self) -> &'static str {
19530        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
19531        match self {
19532            None => "none",
19533        }
19534    }
19535}
19536
19537impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19538    type Err = stripe_types::StripeParseError;
19539    fn from_str(s: &str) -> Result<Self, Self::Err> {
19540        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
19541        match s {
19542            "none" => Ok(None),
19543            _ => Err(stripe_types::StripeParseError),
19544        }
19545    }
19546}
19547impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19548    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19549        f.write_str(self.as_str())
19550    }
19551}
19552
19553impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19554    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19555        f.write_str(self.as_str())
19556    }
19557}
19558impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19559    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19560    where
19561        S: serde::Serializer,
19562    {
19563        serializer.serialize_str(self.as_str())
19564    }
19565}
19566#[cfg(feature = "deserialize")]
19567impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19568    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19569        use std::str::FromStr;
19570        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19571        Self::from_str(&s).map_err(|_| {
19572            serde::de::Error::custom(
19573                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
19574            )
19575        })
19576    }
19577}
19578/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
19579#[derive(Copy, Clone, Debug, serde::Serialize)]
19580pub struct UpdatePaymentIntentPaymentMethodOptionsMobilepay {
19581    /// Controls when the funds are captured from the customer's account.
19582    ///
19583    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19584    ///
19585    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19586    #[serde(skip_serializing_if = "Option::is_none")]
19587    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
19588    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19589    ///
19590    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19591    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19592    ///
19593    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19594    ///
19595    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19596    ///
19597    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19598    #[serde(skip_serializing_if = "Option::is_none")]
19599    pub setup_future_usage:
19600        Option<UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
19601}
19602impl UpdatePaymentIntentPaymentMethodOptionsMobilepay {
19603    pub fn new() -> Self {
19604        Self { capture_method: None, setup_future_usage: None }
19605    }
19606}
19607impl Default for UpdatePaymentIntentPaymentMethodOptionsMobilepay {
19608    fn default() -> Self {
19609        Self::new()
19610    }
19611}
19612/// Controls when the funds are captured from the customer's account.
19613///
19614/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19615///
19616/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19617#[derive(Copy, Clone, Eq, PartialEq)]
19618pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19619    Manual,
19620}
19621impl UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19622    pub fn as_str(self) -> &'static str {
19623        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
19624        match self {
19625            Manual => "manual",
19626        }
19627    }
19628}
19629
19630impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19631    type Err = stripe_types::StripeParseError;
19632    fn from_str(s: &str) -> Result<Self, Self::Err> {
19633        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
19634        match s {
19635            "manual" => Ok(Manual),
19636            _ => Err(stripe_types::StripeParseError),
19637        }
19638    }
19639}
19640impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19641    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19642        f.write_str(self.as_str())
19643    }
19644}
19645
19646impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19648        f.write_str(self.as_str())
19649    }
19650}
19651impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19652    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19653    where
19654        S: serde::Serializer,
19655    {
19656        serializer.serialize_str(self.as_str())
19657    }
19658}
19659#[cfg(feature = "deserialize")]
19660impl<'de> serde::Deserialize<'de>
19661    for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
19662{
19663    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19664        use std::str::FromStr;
19665        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19666        Self::from_str(&s).map_err(|_| {
19667            serde::de::Error::custom(
19668                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
19669            )
19670        })
19671    }
19672}
19673/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19674///
19675/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19676/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19677///
19678/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19679///
19680/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19681///
19682/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19683#[derive(Copy, Clone, Eq, PartialEq)]
19684pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19685    None,
19686}
19687impl UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19688    pub fn as_str(self) -> &'static str {
19689        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
19690        match self {
19691            None => "none",
19692        }
19693    }
19694}
19695
19696impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19697    type Err = stripe_types::StripeParseError;
19698    fn from_str(s: &str) -> Result<Self, Self::Err> {
19699        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
19700        match s {
19701            "none" => Ok(None),
19702            _ => Err(stripe_types::StripeParseError),
19703        }
19704    }
19705}
19706impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19708        f.write_str(self.as_str())
19709    }
19710}
19711
19712impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19714        f.write_str(self.as_str())
19715    }
19716}
19717impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19718    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19719    where
19720        S: serde::Serializer,
19721    {
19722        serializer.serialize_str(self.as_str())
19723    }
19724}
19725#[cfg(feature = "deserialize")]
19726impl<'de> serde::Deserialize<'de>
19727    for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
19728{
19729    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19730        use std::str::FromStr;
19731        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19732        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
19733    }
19734}
19735/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
19736#[derive(Copy, Clone, Debug, serde::Serialize)]
19737pub struct UpdatePaymentIntentPaymentMethodOptionsMultibanco {
19738    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19739    ///
19740    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19741    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19742    ///
19743    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19744    ///
19745    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19746    ///
19747    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19748    #[serde(skip_serializing_if = "Option::is_none")]
19749    pub setup_future_usage:
19750        Option<UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
19751}
19752impl UpdatePaymentIntentPaymentMethodOptionsMultibanco {
19753    pub fn new() -> Self {
19754        Self { setup_future_usage: None }
19755    }
19756}
19757impl Default for UpdatePaymentIntentPaymentMethodOptionsMultibanco {
19758    fn default() -> Self {
19759        Self::new()
19760    }
19761}
19762/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19763///
19764/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19765/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19766///
19767/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19768///
19769/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19770///
19771/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19772#[derive(Copy, Clone, Eq, PartialEq)]
19773pub enum UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19774    None,
19775}
19776impl UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19777    pub fn as_str(self) -> &'static str {
19778        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
19779        match self {
19780            None => "none",
19781        }
19782    }
19783}
19784
19785impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19786    type Err = stripe_types::StripeParseError;
19787    fn from_str(s: &str) -> Result<Self, Self::Err> {
19788        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
19789        match s {
19790            "none" => Ok(None),
19791            _ => Err(stripe_types::StripeParseError),
19792        }
19793    }
19794}
19795impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19796    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19797        f.write_str(self.as_str())
19798    }
19799}
19800
19801impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19803        f.write_str(self.as_str())
19804    }
19805}
19806impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19807    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19808    where
19809        S: serde::Serializer,
19810    {
19811        serializer.serialize_str(self.as_str())
19812    }
19813}
19814#[cfg(feature = "deserialize")]
19815impl<'de> serde::Deserialize<'de>
19816    for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
19817{
19818    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19819        use std::str::FromStr;
19820        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19821        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
19822    }
19823}
19824/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
19825#[derive(Copy, Clone, Debug, serde::Serialize)]
19826pub struct UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19827    /// Controls when the funds are captured from the customer's account.
19828    ///
19829    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19830    ///
19831    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19832    #[serde(skip_serializing_if = "Option::is_none")]
19833    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
19834    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19835    ///
19836    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19837    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19838    ///
19839    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19840    ///
19841    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19842    #[serde(skip_serializing_if = "Option::is_none")]
19843    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
19844}
19845impl UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19846    pub fn new() -> Self {
19847        Self { capture_method: None, setup_future_usage: None }
19848    }
19849}
19850impl Default for UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19851    fn default() -> Self {
19852        Self::new()
19853    }
19854}
19855/// Controls when the funds are captured from the customer's account.
19856///
19857/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
19858///
19859/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
19860#[derive(Copy, Clone, Eq, PartialEq)]
19861pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19862    Manual,
19863}
19864impl UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19865    pub fn as_str(self) -> &'static str {
19866        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
19867        match self {
19868            Manual => "manual",
19869        }
19870    }
19871}
19872
19873impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19874    type Err = stripe_types::StripeParseError;
19875    fn from_str(s: &str) -> Result<Self, Self::Err> {
19876        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
19877        match s {
19878            "manual" => Ok(Manual),
19879            _ => Err(stripe_types::StripeParseError),
19880        }
19881    }
19882}
19883impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19884    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19885        f.write_str(self.as_str())
19886    }
19887}
19888
19889impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19890    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19891        f.write_str(self.as_str())
19892    }
19893}
19894impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19895    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19896    where
19897        S: serde::Serializer,
19898    {
19899        serializer.serialize_str(self.as_str())
19900    }
19901}
19902#[cfg(feature = "deserialize")]
19903impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19904    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19905        use std::str::FromStr;
19906        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19907        Self::from_str(&s).map_err(|_| {
19908            serde::de::Error::custom(
19909                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
19910            )
19911        })
19912    }
19913}
19914/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19915///
19916/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19917/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19918///
19919/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19920///
19921/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19922#[derive(Copy, Clone, Eq, PartialEq)]
19923pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19924    None,
19925    OffSession,
19926}
19927impl UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19928    pub fn as_str(self) -> &'static str {
19929        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
19930        match self {
19931            None => "none",
19932            OffSession => "off_session",
19933        }
19934    }
19935}
19936
19937impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19938    type Err = stripe_types::StripeParseError;
19939    fn from_str(s: &str) -> Result<Self, Self::Err> {
19940        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
19941        match s {
19942            "none" => Ok(None),
19943            "off_session" => Ok(OffSession),
19944            _ => Err(stripe_types::StripeParseError),
19945        }
19946    }
19947}
19948impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19949    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19950        f.write_str(self.as_str())
19951    }
19952}
19953
19954impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19956        f.write_str(self.as_str())
19957    }
19958}
19959impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19960    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19961    where
19962        S: serde::Serializer,
19963    {
19964        serializer.serialize_str(self.as_str())
19965    }
19966}
19967#[cfg(feature = "deserialize")]
19968impl<'de> serde::Deserialize<'de>
19969    for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
19970{
19971    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19972        use std::str::FromStr;
19973        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19974        Self::from_str(&s).map_err(|_| {
19975            serde::de::Error::custom(
19976                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage",
19977            )
19978        })
19979    }
19980}
19981/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
19982#[derive(Clone, Debug, serde::Serialize)]
19983pub struct UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19984    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19985    ///
19986    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19987    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19988    ///
19989    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19990    ///
19991    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19992    ///
19993    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19994    #[serde(skip_serializing_if = "Option::is_none")]
19995    pub setup_future_usage:
19996        Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
19997    /// Controls when Stripe will attempt to debit the funds from the customer's account.
19998    /// The date must be a string in YYYY-MM-DD format.
19999    /// The date must be in the future and between 3 and 15 calendar days from now.
20000    #[serde(skip_serializing_if = "Option::is_none")]
20001    pub target_date: Option<String>,
20002}
20003impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
20004    pub fn new() -> Self {
20005        Self { setup_future_usage: None, target_date: None }
20006    }
20007}
20008impl Default for UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
20009    fn default() -> Self {
20010        Self::new()
20011    }
20012}
20013/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20014///
20015/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20016/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20017///
20018/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20019///
20020/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20021///
20022/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20023#[derive(Copy, Clone, Eq, PartialEq)]
20024pub enum UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
20025    None,
20026    OffSession,
20027    OnSession,
20028}
20029impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
20030    pub fn as_str(self) -> &'static str {
20031        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
20032        match self {
20033            None => "none",
20034            OffSession => "off_session",
20035            OnSession => "on_session",
20036        }
20037    }
20038}
20039
20040impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
20041    type Err = stripe_types::StripeParseError;
20042    fn from_str(s: &str) -> Result<Self, Self::Err> {
20043        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
20044        match s {
20045            "none" => Ok(None),
20046            "off_session" => Ok(OffSession),
20047            "on_session" => Ok(OnSession),
20048            _ => Err(stripe_types::StripeParseError),
20049        }
20050    }
20051}
20052impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
20053    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20054        f.write_str(self.as_str())
20055    }
20056}
20057
20058impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
20059    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20060        f.write_str(self.as_str())
20061    }
20062}
20063impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
20064    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20065    where
20066        S: serde::Serializer,
20067    {
20068        serializer.serialize_str(self.as_str())
20069    }
20070}
20071#[cfg(feature = "deserialize")]
20072impl<'de> serde::Deserialize<'de>
20073    for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
20074{
20075    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20076        use std::str::FromStr;
20077        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20078        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
20079    }
20080}
20081/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
20082#[derive(Copy, Clone, Debug, serde::Serialize)]
20083pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo {
20084    /// The number of calendar days before an OXXO voucher expires.
20085    /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
20086    #[serde(skip_serializing_if = "Option::is_none")]
20087    pub expires_after_days: Option<u32>,
20088    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20089    ///
20090    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20091    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20092    ///
20093    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20094    ///
20095    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20096    ///
20097    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20098    #[serde(skip_serializing_if = "Option::is_none")]
20099    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
20100}
20101impl UpdatePaymentIntentPaymentMethodOptionsOxxo {
20102    pub fn new() -> Self {
20103        Self { expires_after_days: None, setup_future_usage: None }
20104    }
20105}
20106impl Default for UpdatePaymentIntentPaymentMethodOptionsOxxo {
20107    fn default() -> Self {
20108        Self::new()
20109    }
20110}
20111/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20112///
20113/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20114/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20115///
20116/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20117///
20118/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20119///
20120/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20121#[derive(Copy, Clone, Eq, PartialEq)]
20122pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20123    None,
20124}
20125impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20126    pub fn as_str(self) -> &'static str {
20127        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
20128        match self {
20129            None => "none",
20130        }
20131    }
20132}
20133
20134impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20135    type Err = stripe_types::StripeParseError;
20136    fn from_str(s: &str) -> Result<Self, Self::Err> {
20137        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
20138        match s {
20139            "none" => Ok(None),
20140            _ => Err(stripe_types::StripeParseError),
20141        }
20142    }
20143}
20144impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20145    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20146        f.write_str(self.as_str())
20147    }
20148}
20149
20150impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20151    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20152        f.write_str(self.as_str())
20153    }
20154}
20155impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20156    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20157    where
20158        S: serde::Serializer,
20159    {
20160        serializer.serialize_str(self.as_str())
20161    }
20162}
20163#[cfg(feature = "deserialize")]
20164impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20165    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20166        use std::str::FromStr;
20167        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20168        Self::from_str(&s).map_err(|_| {
20169            serde::de::Error::custom(
20170                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
20171            )
20172        })
20173    }
20174}
20175/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
20176#[derive(Copy, Clone, Debug, serde::Serialize)]
20177pub struct UpdatePaymentIntentPaymentMethodOptionsP24 {
20178    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20179    ///
20180    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20181    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20182    ///
20183    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20184    ///
20185    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20186    ///
20187    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20188    #[serde(skip_serializing_if = "Option::is_none")]
20189    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
20190    /// Confirm that the payer has accepted the P24 terms and conditions.
20191    #[serde(skip_serializing_if = "Option::is_none")]
20192    pub tos_shown_and_accepted: Option<bool>,
20193}
20194impl UpdatePaymentIntentPaymentMethodOptionsP24 {
20195    pub fn new() -> Self {
20196        Self { setup_future_usage: None, tos_shown_and_accepted: None }
20197    }
20198}
20199impl Default for UpdatePaymentIntentPaymentMethodOptionsP24 {
20200    fn default() -> Self {
20201        Self::new()
20202    }
20203}
20204/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20205///
20206/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20207/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20208///
20209/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20210///
20211/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20212///
20213/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20214#[derive(Copy, Clone, Eq, PartialEq)]
20215pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20216    None,
20217}
20218impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20219    pub fn as_str(self) -> &'static str {
20220        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
20221        match self {
20222            None => "none",
20223        }
20224    }
20225}
20226
20227impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20228    type Err = stripe_types::StripeParseError;
20229    fn from_str(s: &str) -> Result<Self, Self::Err> {
20230        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
20231        match s {
20232            "none" => Ok(None),
20233            _ => Err(stripe_types::StripeParseError),
20234        }
20235    }
20236}
20237impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20238    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20239        f.write_str(self.as_str())
20240    }
20241}
20242
20243impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20244    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20245        f.write_str(self.as_str())
20246    }
20247}
20248impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20249    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20250    where
20251        S: serde::Serializer,
20252    {
20253        serializer.serialize_str(self.as_str())
20254    }
20255}
20256#[cfg(feature = "deserialize")]
20257impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20258    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20259        use std::str::FromStr;
20260        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20261        Self::from_str(&s).map_err(|_| {
20262            serde::de::Error::custom(
20263                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
20264            )
20265        })
20266    }
20267}
20268/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
20269#[derive(Copy, Clone, Debug, serde::Serialize)]
20270pub struct UpdatePaymentIntentPaymentMethodOptionsPayco {
20271    /// Controls when the funds are captured from the customer's account.
20272    ///
20273    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20274    ///
20275    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20276    #[serde(skip_serializing_if = "Option::is_none")]
20277    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
20278}
20279impl UpdatePaymentIntentPaymentMethodOptionsPayco {
20280    pub fn new() -> Self {
20281        Self { capture_method: None }
20282    }
20283}
20284impl Default for UpdatePaymentIntentPaymentMethodOptionsPayco {
20285    fn default() -> Self {
20286        Self::new()
20287    }
20288}
20289/// Controls when the funds are captured from the customer's account.
20290///
20291/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20292///
20293/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20294#[derive(Copy, Clone, Eq, PartialEq)]
20295pub enum UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20296    Manual,
20297}
20298impl UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20299    pub fn as_str(self) -> &'static str {
20300        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
20301        match self {
20302            Manual => "manual",
20303        }
20304    }
20305}
20306
20307impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20308    type Err = stripe_types::StripeParseError;
20309    fn from_str(s: &str) -> Result<Self, Self::Err> {
20310        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
20311        match s {
20312            "manual" => Ok(Manual),
20313            _ => Err(stripe_types::StripeParseError),
20314        }
20315    }
20316}
20317impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20318    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20319        f.write_str(self.as_str())
20320    }
20321}
20322
20323impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20324    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20325        f.write_str(self.as_str())
20326    }
20327}
20328impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20329    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20330    where
20331        S: serde::Serializer,
20332    {
20333        serializer.serialize_str(self.as_str())
20334    }
20335}
20336#[cfg(feature = "deserialize")]
20337impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20338    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20339        use std::str::FromStr;
20340        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20341        Self::from_str(&s).map_err(|_| {
20342            serde::de::Error::custom(
20343                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
20344            )
20345        })
20346    }
20347}
20348/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
20349#[derive(Copy, Clone, Debug, serde::Serialize)]
20350pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow {
20351    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20352    ///
20353    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20354    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20355    ///
20356    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20357    ///
20358    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20359    ///
20360    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20361    #[serde(skip_serializing_if = "Option::is_none")]
20362    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
20363}
20364impl UpdatePaymentIntentPaymentMethodOptionsPaynow {
20365    pub fn new() -> Self {
20366        Self { setup_future_usage: None }
20367    }
20368}
20369impl Default for UpdatePaymentIntentPaymentMethodOptionsPaynow {
20370    fn default() -> Self {
20371        Self::new()
20372    }
20373}
20374/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20375///
20376/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20377/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20378///
20379/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20380///
20381/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20382///
20383/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20384#[derive(Copy, Clone, Eq, PartialEq)]
20385pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20386    None,
20387}
20388impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20389    pub fn as_str(self) -> &'static str {
20390        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
20391        match self {
20392            None => "none",
20393        }
20394    }
20395}
20396
20397impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20398    type Err = stripe_types::StripeParseError;
20399    fn from_str(s: &str) -> Result<Self, Self::Err> {
20400        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
20401        match s {
20402            "none" => Ok(None),
20403            _ => Err(stripe_types::StripeParseError),
20404        }
20405    }
20406}
20407impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20408    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20409        f.write_str(self.as_str())
20410    }
20411}
20412
20413impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20414    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20415        f.write_str(self.as_str())
20416    }
20417}
20418impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20419    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20420    where
20421        S: serde::Serializer,
20422    {
20423        serializer.serialize_str(self.as_str())
20424    }
20425}
20426#[cfg(feature = "deserialize")]
20427impl<'de> serde::Deserialize<'de>
20428    for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
20429{
20430    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20431        use std::str::FromStr;
20432        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20433        Self::from_str(&s).map_err(|_| {
20434            serde::de::Error::custom(
20435                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
20436            )
20437        })
20438    }
20439}
20440/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
20441#[derive(Clone, Debug, serde::Serialize)]
20442pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal {
20443    /// Controls when the funds will be captured from the customer's account.
20444    #[serde(skip_serializing_if = "Option::is_none")]
20445    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
20446    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
20447    #[serde(skip_serializing_if = "Option::is_none")]
20448    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
20449    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
20450    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
20451    #[serde(skip_serializing_if = "Option::is_none")]
20452    pub reference: Option<String>,
20453    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
20454    #[serde(skip_serializing_if = "Option::is_none")]
20455    pub risk_correlation_id: Option<String>,
20456    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20457    ///
20458    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20459    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20460    ///
20461    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20462    ///
20463    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20464    ///
20465    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20466    #[serde(skip_serializing_if = "Option::is_none")]
20467    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
20468}
20469impl UpdatePaymentIntentPaymentMethodOptionsPaypal {
20470    pub fn new() -> Self {
20471        Self {
20472            capture_method: None,
20473            preferred_locale: None,
20474            reference: None,
20475            risk_correlation_id: None,
20476            setup_future_usage: None,
20477        }
20478    }
20479}
20480impl Default for UpdatePaymentIntentPaymentMethodOptionsPaypal {
20481    fn default() -> Self {
20482        Self::new()
20483    }
20484}
20485/// Controls when the funds will be captured from the customer's account.
20486#[derive(Copy, Clone, Eq, PartialEq)]
20487pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20488    Manual,
20489}
20490impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20491    pub fn as_str(self) -> &'static str {
20492        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
20493        match self {
20494            Manual => "manual",
20495        }
20496    }
20497}
20498
20499impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20500    type Err = stripe_types::StripeParseError;
20501    fn from_str(s: &str) -> Result<Self, Self::Err> {
20502        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
20503        match s {
20504            "manual" => Ok(Manual),
20505            _ => Err(stripe_types::StripeParseError),
20506        }
20507    }
20508}
20509impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20510    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20511        f.write_str(self.as_str())
20512    }
20513}
20514
20515impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20516    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20517        f.write_str(self.as_str())
20518    }
20519}
20520impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20521    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20522    where
20523        S: serde::Serializer,
20524    {
20525        serializer.serialize_str(self.as_str())
20526    }
20527}
20528#[cfg(feature = "deserialize")]
20529impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20530    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20531        use std::str::FromStr;
20532        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20533        Self::from_str(&s).map_err(|_| {
20534            serde::de::Error::custom(
20535                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
20536            )
20537        })
20538    }
20539}
20540/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
20541#[derive(Clone, Eq, PartialEq)]
20542#[non_exhaustive]
20543pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20544    CsMinusCz,
20545    DaMinusDk,
20546    DeMinusAt,
20547    DeMinusDe,
20548    DeMinusLu,
20549    ElMinusGr,
20550    EnMinusGb,
20551    EnMinusUs,
20552    EsMinusEs,
20553    FiMinusFi,
20554    FrMinusBe,
20555    FrMinusFr,
20556    FrMinusLu,
20557    HuMinusHu,
20558    ItMinusIt,
20559    NlMinusBe,
20560    NlMinusNl,
20561    PlMinusPl,
20562    PtMinusPt,
20563    SkMinusSk,
20564    SvMinusSe,
20565    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20566    Unknown(String),
20567}
20568impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20569    pub fn as_str(&self) -> &str {
20570        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
20571        match self {
20572            CsMinusCz => "cs-CZ",
20573            DaMinusDk => "da-DK",
20574            DeMinusAt => "de-AT",
20575            DeMinusDe => "de-DE",
20576            DeMinusLu => "de-LU",
20577            ElMinusGr => "el-GR",
20578            EnMinusGb => "en-GB",
20579            EnMinusUs => "en-US",
20580            EsMinusEs => "es-ES",
20581            FiMinusFi => "fi-FI",
20582            FrMinusBe => "fr-BE",
20583            FrMinusFr => "fr-FR",
20584            FrMinusLu => "fr-LU",
20585            HuMinusHu => "hu-HU",
20586            ItMinusIt => "it-IT",
20587            NlMinusBe => "nl-BE",
20588            NlMinusNl => "nl-NL",
20589            PlMinusPl => "pl-PL",
20590            PtMinusPt => "pt-PT",
20591            SkMinusSk => "sk-SK",
20592            SvMinusSe => "sv-SE",
20593            Unknown(v) => v,
20594        }
20595    }
20596}
20597
20598impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20599    type Err = std::convert::Infallible;
20600    fn from_str(s: &str) -> Result<Self, Self::Err> {
20601        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
20602        match s {
20603            "cs-CZ" => Ok(CsMinusCz),
20604            "da-DK" => Ok(DaMinusDk),
20605            "de-AT" => Ok(DeMinusAt),
20606            "de-DE" => Ok(DeMinusDe),
20607            "de-LU" => Ok(DeMinusLu),
20608            "el-GR" => Ok(ElMinusGr),
20609            "en-GB" => Ok(EnMinusGb),
20610            "en-US" => Ok(EnMinusUs),
20611            "es-ES" => Ok(EsMinusEs),
20612            "fi-FI" => Ok(FiMinusFi),
20613            "fr-BE" => Ok(FrMinusBe),
20614            "fr-FR" => Ok(FrMinusFr),
20615            "fr-LU" => Ok(FrMinusLu),
20616            "hu-HU" => Ok(HuMinusHu),
20617            "it-IT" => Ok(ItMinusIt),
20618            "nl-BE" => Ok(NlMinusBe),
20619            "nl-NL" => Ok(NlMinusNl),
20620            "pl-PL" => Ok(PlMinusPl),
20621            "pt-PT" => Ok(PtMinusPt),
20622            "sk-SK" => Ok(SkMinusSk),
20623            "sv-SE" => Ok(SvMinusSe),
20624            v => Ok(Unknown(v.to_owned())),
20625        }
20626    }
20627}
20628impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20629    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20630        f.write_str(self.as_str())
20631    }
20632}
20633
20634impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20636        f.write_str(self.as_str())
20637    }
20638}
20639impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20640    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20641    where
20642        S: serde::Serializer,
20643    {
20644        serializer.serialize_str(self.as_str())
20645    }
20646}
20647#[cfg(feature = "deserialize")]
20648impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20649    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20650        use std::str::FromStr;
20651        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20652        Ok(Self::from_str(&s).unwrap())
20653    }
20654}
20655/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20656///
20657/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20658/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20659///
20660/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20661///
20662/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20663///
20664/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20665#[derive(Copy, Clone, Eq, PartialEq)]
20666pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20667    None,
20668    OffSession,
20669}
20670impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20671    pub fn as_str(self) -> &'static str {
20672        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
20673        match self {
20674            None => "none",
20675            OffSession => "off_session",
20676        }
20677    }
20678}
20679
20680impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20681    type Err = stripe_types::StripeParseError;
20682    fn from_str(s: &str) -> Result<Self, Self::Err> {
20683        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
20684        match s {
20685            "none" => Ok(None),
20686            "off_session" => Ok(OffSession),
20687            _ => Err(stripe_types::StripeParseError),
20688        }
20689    }
20690}
20691impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20692    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20693        f.write_str(self.as_str())
20694    }
20695}
20696
20697impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20698    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20699        f.write_str(self.as_str())
20700    }
20701}
20702impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20703    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20704    where
20705        S: serde::Serializer,
20706    {
20707        serializer.serialize_str(self.as_str())
20708    }
20709}
20710#[cfg(feature = "deserialize")]
20711impl<'de> serde::Deserialize<'de>
20712    for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
20713{
20714    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20715        use std::str::FromStr;
20716        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20717        Self::from_str(&s).map_err(|_| {
20718            serde::de::Error::custom(
20719                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
20720            )
20721        })
20722    }
20723}
20724/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
20725#[derive(Copy, Clone, Debug, serde::Serialize)]
20726pub struct UpdatePaymentIntentPaymentMethodOptionsPix {
20727    /// Determines if the amount includes the IOF tax. Defaults to `never`.
20728    #[serde(skip_serializing_if = "Option::is_none")]
20729    pub amount_includes_iof: Option<UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
20730    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
20731    /// Defaults to 86400 seconds.
20732    #[serde(skip_serializing_if = "Option::is_none")]
20733    pub expires_after_seconds: Option<i64>,
20734    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
20735    /// Defaults to 1 day in the future.
20736    #[serde(skip_serializing_if = "Option::is_none")]
20737    pub expires_at: Option<stripe_types::Timestamp>,
20738    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20739    ///
20740    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20741    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20742    ///
20743    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20744    ///
20745    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20746    ///
20747    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20748    #[serde(skip_serializing_if = "Option::is_none")]
20749    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
20750}
20751impl UpdatePaymentIntentPaymentMethodOptionsPix {
20752    pub fn new() -> Self {
20753        Self {
20754            amount_includes_iof: None,
20755            expires_after_seconds: None,
20756            expires_at: None,
20757            setup_future_usage: None,
20758        }
20759    }
20760}
20761impl Default for UpdatePaymentIntentPaymentMethodOptionsPix {
20762    fn default() -> Self {
20763        Self::new()
20764    }
20765}
20766/// Determines if the amount includes the IOF tax. Defaults to `never`.
20767#[derive(Copy, Clone, Eq, PartialEq)]
20768pub enum UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20769    Always,
20770    Never,
20771}
20772impl UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20773    pub fn as_str(self) -> &'static str {
20774        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
20775        match self {
20776            Always => "always",
20777            Never => "never",
20778        }
20779    }
20780}
20781
20782impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20783    type Err = stripe_types::StripeParseError;
20784    fn from_str(s: &str) -> Result<Self, Self::Err> {
20785        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
20786        match s {
20787            "always" => Ok(Always),
20788            "never" => Ok(Never),
20789            _ => Err(stripe_types::StripeParseError),
20790        }
20791    }
20792}
20793impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20795        f.write_str(self.as_str())
20796    }
20797}
20798
20799impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20800    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20801        f.write_str(self.as_str())
20802    }
20803}
20804impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20805    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20806    where
20807        S: serde::Serializer,
20808    {
20809        serializer.serialize_str(self.as_str())
20810    }
20811}
20812#[cfg(feature = "deserialize")]
20813impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20814    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20815        use std::str::FromStr;
20816        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20817        Self::from_str(&s).map_err(|_| {
20818            serde::de::Error::custom(
20819                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
20820            )
20821        })
20822    }
20823}
20824/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20825///
20826/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20827/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20828///
20829/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20830///
20831/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20832///
20833/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20834#[derive(Copy, Clone, Eq, PartialEq)]
20835pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20836    None,
20837}
20838impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20839    pub fn as_str(self) -> &'static str {
20840        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
20841        match self {
20842            None => "none",
20843        }
20844    }
20845}
20846
20847impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20848    type Err = stripe_types::StripeParseError;
20849    fn from_str(s: &str) -> Result<Self, Self::Err> {
20850        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
20851        match s {
20852            "none" => Ok(None),
20853            _ => Err(stripe_types::StripeParseError),
20854        }
20855    }
20856}
20857impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20858    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20859        f.write_str(self.as_str())
20860    }
20861}
20862
20863impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20865        f.write_str(self.as_str())
20866    }
20867}
20868impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20869    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20870    where
20871        S: serde::Serializer,
20872    {
20873        serializer.serialize_str(self.as_str())
20874    }
20875}
20876#[cfg(feature = "deserialize")]
20877impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20878    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20879        use std::str::FromStr;
20880        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20881        Self::from_str(&s).map_err(|_| {
20882            serde::de::Error::custom(
20883                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
20884            )
20885        })
20886    }
20887}
20888/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
20889#[derive(Copy, Clone, Debug, serde::Serialize)]
20890pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20891    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20892    ///
20893    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20894    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20895    ///
20896    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20897    ///
20898    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20899    ///
20900    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20901    #[serde(skip_serializing_if = "Option::is_none")]
20902    pub setup_future_usage:
20903        Option<UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
20904}
20905impl UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20906    pub fn new() -> Self {
20907        Self { setup_future_usage: None }
20908    }
20909}
20910impl Default for UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20911    fn default() -> Self {
20912        Self::new()
20913    }
20914}
20915/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20916///
20917/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20918/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20919///
20920/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20921///
20922/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20923///
20924/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20925#[derive(Copy, Clone, Eq, PartialEq)]
20926pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20927    None,
20928}
20929impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20930    pub fn as_str(self) -> &'static str {
20931        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
20932        match self {
20933            None => "none",
20934        }
20935    }
20936}
20937
20938impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20939    type Err = stripe_types::StripeParseError;
20940    fn from_str(s: &str) -> Result<Self, Self::Err> {
20941        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
20942        match s {
20943            "none" => Ok(None),
20944            _ => Err(stripe_types::StripeParseError),
20945        }
20946    }
20947}
20948impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20949    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20950        f.write_str(self.as_str())
20951    }
20952}
20953
20954impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20956        f.write_str(self.as_str())
20957    }
20958}
20959impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20960    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20961    where
20962        S: serde::Serializer,
20963    {
20964        serializer.serialize_str(self.as_str())
20965    }
20966}
20967#[cfg(feature = "deserialize")]
20968impl<'de> serde::Deserialize<'de>
20969    for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
20970{
20971    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20972        use std::str::FromStr;
20973        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20974        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
20975    }
20976}
20977/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
20978#[derive(Copy, Clone, Debug, serde::Serialize)]
20979pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20980    /// Controls when the funds are captured from the customer's account.
20981    ///
20982    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
20983    ///
20984    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
20985    #[serde(skip_serializing_if = "Option::is_none")]
20986    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
20987    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20988    ///
20989    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20990    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20991    ///
20992    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20993    ///
20994    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20995    #[serde(skip_serializing_if = "Option::is_none")]
20996    pub setup_future_usage:
20997        Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
20998}
20999impl UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
21000    pub fn new() -> Self {
21001        Self { capture_method: None, setup_future_usage: None }
21002    }
21003}
21004impl Default for UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
21005    fn default() -> Self {
21006        Self::new()
21007    }
21008}
21009/// Controls when the funds are captured from the customer's account.
21010///
21011/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
21012///
21013/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
21014#[derive(Copy, Clone, Eq, PartialEq)]
21015pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
21016    Manual,
21017}
21018impl UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
21019    pub fn as_str(self) -> &'static str {
21020        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
21021        match self {
21022            Manual => "manual",
21023        }
21024    }
21025}
21026
21027impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
21028    type Err = stripe_types::StripeParseError;
21029    fn from_str(s: &str) -> Result<Self, Self::Err> {
21030        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
21031        match s {
21032            "manual" => Ok(Manual),
21033            _ => Err(stripe_types::StripeParseError),
21034        }
21035    }
21036}
21037impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
21038    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21039        f.write_str(self.as_str())
21040    }
21041}
21042
21043impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
21044    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21045        f.write_str(self.as_str())
21046    }
21047}
21048impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
21049    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21050    where
21051        S: serde::Serializer,
21052    {
21053        serializer.serialize_str(self.as_str())
21054    }
21055}
21056#[cfg(feature = "deserialize")]
21057impl<'de> serde::Deserialize<'de>
21058    for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
21059{
21060    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21061        use std::str::FromStr;
21062        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21063        Self::from_str(&s).map_err(|_| {
21064            serde::de::Error::custom(
21065                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
21066            )
21067        })
21068    }
21069}
21070/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21071///
21072/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21073/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21074///
21075/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21076///
21077/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21078#[derive(Copy, Clone, Eq, PartialEq)]
21079pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
21080    None,
21081    OffSession,
21082}
21083impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
21084    pub fn as_str(self) -> &'static str {
21085        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
21086        match self {
21087            None => "none",
21088            OffSession => "off_session",
21089        }
21090    }
21091}
21092
21093impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
21094    type Err = stripe_types::StripeParseError;
21095    fn from_str(s: &str) -> Result<Self, Self::Err> {
21096        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
21097        match s {
21098            "none" => Ok(None),
21099            "off_session" => Ok(OffSession),
21100            _ => Err(stripe_types::StripeParseError),
21101        }
21102    }
21103}
21104impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
21105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21106        f.write_str(self.as_str())
21107    }
21108}
21109
21110impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
21111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21112        f.write_str(self.as_str())
21113    }
21114}
21115impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
21116    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21117    where
21118        S: serde::Serializer,
21119    {
21120        serializer.serialize_str(self.as_str())
21121    }
21122}
21123#[cfg(feature = "deserialize")]
21124impl<'de> serde::Deserialize<'de>
21125    for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
21126{
21127    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21128        use std::str::FromStr;
21129        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21130        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
21131    }
21132}
21133/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
21134#[derive(Copy, Clone, Debug, serde::Serialize)]
21135pub struct UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
21136    /// Controls when the funds are captured from the customer's account.
21137    ///
21138    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
21139    ///
21140    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
21141    #[serde(skip_serializing_if = "Option::is_none")]
21142    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
21143}
21144impl UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
21145    pub fn new() -> Self {
21146        Self { capture_method: None }
21147    }
21148}
21149impl Default for UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
21150    fn default() -> Self {
21151        Self::new()
21152    }
21153}
21154/// Controls when the funds are captured from the customer's account.
21155///
21156/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
21157///
21158/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
21159#[derive(Copy, Clone, Eq, PartialEq)]
21160pub enum UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21161    Manual,
21162}
21163impl UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21164    pub fn as_str(self) -> &'static str {
21165        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
21166        match self {
21167            Manual => "manual",
21168        }
21169    }
21170}
21171
21172impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21173    type Err = stripe_types::StripeParseError;
21174    fn from_str(s: &str) -> Result<Self, Self::Err> {
21175        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
21176        match s {
21177            "manual" => Ok(Manual),
21178            _ => Err(stripe_types::StripeParseError),
21179        }
21180    }
21181}
21182impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21183    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21184        f.write_str(self.as_str())
21185    }
21186}
21187
21188impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21190        f.write_str(self.as_str())
21191    }
21192}
21193impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21194    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21195    where
21196        S: serde::Serializer,
21197    {
21198        serializer.serialize_str(self.as_str())
21199    }
21200}
21201#[cfg(feature = "deserialize")]
21202impl<'de> serde::Deserialize<'de>
21203    for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
21204{
21205    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21206        use std::str::FromStr;
21207        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21208        Self::from_str(&s).map_err(|_| {
21209            serde::de::Error::custom(
21210                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
21211            )
21212        })
21213    }
21214}
21215/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
21216#[derive(Copy, Clone, Debug, serde::Serialize)]
21217pub struct UpdatePaymentIntentPaymentMethodOptionsSatispay {
21218    /// Controls when the funds are captured from the customer's account.
21219    ///
21220    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
21221    ///
21222    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
21223    #[serde(skip_serializing_if = "Option::is_none")]
21224    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
21225}
21226impl UpdatePaymentIntentPaymentMethodOptionsSatispay {
21227    pub fn new() -> Self {
21228        Self { capture_method: None }
21229    }
21230}
21231impl Default for UpdatePaymentIntentPaymentMethodOptionsSatispay {
21232    fn default() -> Self {
21233        Self::new()
21234    }
21235}
21236/// Controls when the funds are captured from the customer's account.
21237///
21238/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
21239///
21240/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
21241#[derive(Copy, Clone, Eq, PartialEq)]
21242pub enum UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21243    Manual,
21244}
21245impl UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21246    pub fn as_str(self) -> &'static str {
21247        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
21248        match self {
21249            Manual => "manual",
21250        }
21251    }
21252}
21253
21254impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21255    type Err = stripe_types::StripeParseError;
21256    fn from_str(s: &str) -> Result<Self, Self::Err> {
21257        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
21258        match s {
21259            "manual" => Ok(Manual),
21260            _ => Err(stripe_types::StripeParseError),
21261        }
21262    }
21263}
21264impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21265    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21266        f.write_str(self.as_str())
21267    }
21268}
21269
21270impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21272        f.write_str(self.as_str())
21273    }
21274}
21275impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21276    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21277    where
21278        S: serde::Serializer,
21279    {
21280        serializer.serialize_str(self.as_str())
21281    }
21282}
21283#[cfg(feature = "deserialize")]
21284impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21285    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21286        use std::str::FromStr;
21287        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21288        Self::from_str(&s).map_err(|_| {
21289            serde::de::Error::custom(
21290                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
21291            )
21292        })
21293    }
21294}
21295/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
21296#[derive(Clone, Debug, serde::Serialize)]
21297pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
21298    /// Additional fields for Mandate creation
21299    #[serde(skip_serializing_if = "Option::is_none")]
21300    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
21301    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21302    ///
21303    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21304    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21305    ///
21306    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21307    ///
21308    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21309    ///
21310    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21311    #[serde(skip_serializing_if = "Option::is_none")]
21312    pub setup_future_usage:
21313        Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
21314    /// Controls when Stripe will attempt to debit the funds from the customer's account.
21315    /// The date must be a string in YYYY-MM-DD format.
21316    /// The date must be in the future and between 3 and 15 calendar days from now.
21317    #[serde(skip_serializing_if = "Option::is_none")]
21318    pub target_date: Option<String>,
21319}
21320impl UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
21321    pub fn new() -> Self {
21322        Self { mandate_options: None, setup_future_usage: None, target_date: None }
21323    }
21324}
21325impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
21326    fn default() -> Self {
21327        Self::new()
21328    }
21329}
21330/// Additional fields for Mandate creation
21331#[derive(Clone, Debug, serde::Serialize)]
21332pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
21333    /// Prefix used to generate the Mandate reference.
21334    /// Must be at most 12 characters long.
21335    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
21336    /// Cannot begin with 'STRIPE'.
21337    #[serde(skip_serializing_if = "Option::is_none")]
21338    pub reference_prefix: Option<String>,
21339}
21340impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
21341    pub fn new() -> Self {
21342        Self { reference_prefix: None }
21343    }
21344}
21345impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
21346    fn default() -> Self {
21347        Self::new()
21348    }
21349}
21350/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21351///
21352/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21353/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21354///
21355/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21356///
21357/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21358///
21359/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21360#[derive(Copy, Clone, Eq, PartialEq)]
21361pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21362    None,
21363    OffSession,
21364    OnSession,
21365}
21366impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21367    pub fn as_str(self) -> &'static str {
21368        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
21369        match self {
21370            None => "none",
21371            OffSession => "off_session",
21372            OnSession => "on_session",
21373        }
21374    }
21375}
21376
21377impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21378    type Err = stripe_types::StripeParseError;
21379    fn from_str(s: &str) -> Result<Self, Self::Err> {
21380        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
21381        match s {
21382            "none" => Ok(None),
21383            "off_session" => Ok(OffSession),
21384            "on_session" => Ok(OnSession),
21385            _ => Err(stripe_types::StripeParseError),
21386        }
21387    }
21388}
21389impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21390    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21391        f.write_str(self.as_str())
21392    }
21393}
21394
21395impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21396    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21397        f.write_str(self.as_str())
21398    }
21399}
21400impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21401    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21402    where
21403        S: serde::Serializer,
21404    {
21405        serializer.serialize_str(self.as_str())
21406    }
21407}
21408#[cfg(feature = "deserialize")]
21409impl<'de> serde::Deserialize<'de>
21410    for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
21411{
21412    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21413        use std::str::FromStr;
21414        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21415        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
21416    }
21417}
21418/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
21419#[derive(Copy, Clone, Debug, serde::Serialize)]
21420pub struct UpdatePaymentIntentPaymentMethodOptionsSofort {
21421    /// Language shown to the payer on redirect.
21422    #[serde(skip_serializing_if = "Option::is_none")]
21423    pub preferred_language: Option<UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
21424    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21425    ///
21426    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21427    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21428    ///
21429    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21430    ///
21431    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21432    ///
21433    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21434    #[serde(skip_serializing_if = "Option::is_none")]
21435    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
21436}
21437impl UpdatePaymentIntentPaymentMethodOptionsSofort {
21438    pub fn new() -> Self {
21439        Self { preferred_language: None, setup_future_usage: None }
21440    }
21441}
21442impl Default for UpdatePaymentIntentPaymentMethodOptionsSofort {
21443    fn default() -> Self {
21444        Self::new()
21445    }
21446}
21447/// Language shown to the payer on redirect.
21448#[derive(Copy, Clone, Eq, PartialEq)]
21449pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21450    De,
21451    En,
21452    Es,
21453    Fr,
21454    It,
21455    Nl,
21456    Pl,
21457}
21458impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21459    pub fn as_str(self) -> &'static str {
21460        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
21461        match self {
21462            De => "de",
21463            En => "en",
21464            Es => "es",
21465            Fr => "fr",
21466            It => "it",
21467            Nl => "nl",
21468            Pl => "pl",
21469        }
21470    }
21471}
21472
21473impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21474    type Err = stripe_types::StripeParseError;
21475    fn from_str(s: &str) -> Result<Self, Self::Err> {
21476        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
21477        match s {
21478            "de" => Ok(De),
21479            "en" => Ok(En),
21480            "es" => Ok(Es),
21481            "fr" => Ok(Fr),
21482            "it" => Ok(It),
21483            "nl" => Ok(Nl),
21484            "pl" => Ok(Pl),
21485            _ => Err(stripe_types::StripeParseError),
21486        }
21487    }
21488}
21489impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21490    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21491        f.write_str(self.as_str())
21492    }
21493}
21494
21495impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21496    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21497        f.write_str(self.as_str())
21498    }
21499}
21500impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21501    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21502    where
21503        S: serde::Serializer,
21504    {
21505        serializer.serialize_str(self.as_str())
21506    }
21507}
21508#[cfg(feature = "deserialize")]
21509impl<'de> serde::Deserialize<'de>
21510    for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
21511{
21512    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21513        use std::str::FromStr;
21514        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21515        Self::from_str(&s).map_err(|_| {
21516            serde::de::Error::custom(
21517                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
21518            )
21519        })
21520    }
21521}
21522/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21523///
21524/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21525/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21526///
21527/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21528///
21529/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21530///
21531/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21532#[derive(Copy, Clone, Eq, PartialEq)]
21533pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21534    None,
21535    OffSession,
21536}
21537impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21538    pub fn as_str(self) -> &'static str {
21539        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
21540        match self {
21541            None => "none",
21542            OffSession => "off_session",
21543        }
21544    }
21545}
21546
21547impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21548    type Err = stripe_types::StripeParseError;
21549    fn from_str(s: &str) -> Result<Self, Self::Err> {
21550        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
21551        match s {
21552            "none" => Ok(None),
21553            "off_session" => Ok(OffSession),
21554            _ => Err(stripe_types::StripeParseError),
21555        }
21556    }
21557}
21558impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21559    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21560        f.write_str(self.as_str())
21561    }
21562}
21563
21564impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21565    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21566        f.write_str(self.as_str())
21567    }
21568}
21569impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21570    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21571    where
21572        S: serde::Serializer,
21573    {
21574        serializer.serialize_str(self.as_str())
21575    }
21576}
21577#[cfg(feature = "deserialize")]
21578impl<'de> serde::Deserialize<'de>
21579    for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
21580{
21581    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21582        use std::str::FromStr;
21583        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21584        Self::from_str(&s).map_err(|_| {
21585            serde::de::Error::custom(
21586                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
21587            )
21588        })
21589    }
21590}
21591/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
21592#[derive(Clone, Debug, serde::Serialize)]
21593pub struct UpdatePaymentIntentPaymentMethodOptionsSwish {
21594    /// A reference for this payment to be displayed in the Swish app.
21595    #[serde(skip_serializing_if = "Option::is_none")]
21596    pub reference: Option<String>,
21597    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21598    ///
21599    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21600    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21601    ///
21602    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21603    ///
21604    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21605    ///
21606    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21607    #[serde(skip_serializing_if = "Option::is_none")]
21608    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
21609}
21610impl UpdatePaymentIntentPaymentMethodOptionsSwish {
21611    pub fn new() -> Self {
21612        Self { reference: None, setup_future_usage: None }
21613    }
21614}
21615impl Default for UpdatePaymentIntentPaymentMethodOptionsSwish {
21616    fn default() -> Self {
21617        Self::new()
21618    }
21619}
21620/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21621///
21622/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21623/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21624///
21625/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21626///
21627/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21628///
21629/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21630#[derive(Copy, Clone, Eq, PartialEq)]
21631pub enum UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21632    None,
21633}
21634impl UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21635    pub fn as_str(self) -> &'static str {
21636        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
21637        match self {
21638            None => "none",
21639        }
21640    }
21641}
21642
21643impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21644    type Err = stripe_types::StripeParseError;
21645    fn from_str(s: &str) -> Result<Self, Self::Err> {
21646        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
21647        match s {
21648            "none" => Ok(None),
21649            _ => Err(stripe_types::StripeParseError),
21650        }
21651    }
21652}
21653impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21655        f.write_str(self.as_str())
21656    }
21657}
21658
21659impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21660    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21661        f.write_str(self.as_str())
21662    }
21663}
21664impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21665    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21666    where
21667        S: serde::Serializer,
21668    {
21669        serializer.serialize_str(self.as_str())
21670    }
21671}
21672#[cfg(feature = "deserialize")]
21673impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21674    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21675        use std::str::FromStr;
21676        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21677        Self::from_str(&s).map_err(|_| {
21678            serde::de::Error::custom(
21679                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
21680            )
21681        })
21682    }
21683}
21684/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
21685#[derive(Copy, Clone, Debug, serde::Serialize)]
21686pub struct UpdatePaymentIntentPaymentMethodOptionsTwint {
21687    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21688    ///
21689    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21690    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21691    ///
21692    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21693    ///
21694    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21695    ///
21696    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21697    #[serde(skip_serializing_if = "Option::is_none")]
21698    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
21699}
21700impl UpdatePaymentIntentPaymentMethodOptionsTwint {
21701    pub fn new() -> Self {
21702        Self { setup_future_usage: None }
21703    }
21704}
21705impl Default for UpdatePaymentIntentPaymentMethodOptionsTwint {
21706    fn default() -> Self {
21707        Self::new()
21708    }
21709}
21710/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21711///
21712/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21713/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21714///
21715/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21716///
21717/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21718///
21719/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21720#[derive(Copy, Clone, Eq, PartialEq)]
21721pub enum UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21722    None,
21723}
21724impl UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21725    pub fn as_str(self) -> &'static str {
21726        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
21727        match self {
21728            None => "none",
21729        }
21730    }
21731}
21732
21733impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21734    type Err = stripe_types::StripeParseError;
21735    fn from_str(s: &str) -> Result<Self, Self::Err> {
21736        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
21737        match s {
21738            "none" => Ok(None),
21739            _ => Err(stripe_types::StripeParseError),
21740        }
21741    }
21742}
21743impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21744    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21745        f.write_str(self.as_str())
21746    }
21747}
21748
21749impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21750    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21751        f.write_str(self.as_str())
21752    }
21753}
21754impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21755    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21756    where
21757        S: serde::Serializer,
21758    {
21759        serializer.serialize_str(self.as_str())
21760    }
21761}
21762#[cfg(feature = "deserialize")]
21763impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21764    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21765        use std::str::FromStr;
21766        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21767        Self::from_str(&s).map_err(|_| {
21768            serde::de::Error::custom(
21769                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
21770            )
21771        })
21772    }
21773}
21774/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
21775#[derive(Clone, Debug, serde::Serialize)]
21776pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21777    /// Additional fields for Financial Connections Session creation
21778    #[serde(skip_serializing_if = "Option::is_none")]
21779    pub financial_connections:
21780        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
21781    /// Additional fields for Mandate creation
21782    #[serde(skip_serializing_if = "Option::is_none")]
21783    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
21784    /// Additional fields for network related functions
21785    #[serde(skip_serializing_if = "Option::is_none")]
21786    pub networks: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
21787    /// Preferred transaction settlement speed
21788    #[serde(skip_serializing_if = "Option::is_none")]
21789    pub preferred_settlement_speed:
21790        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
21791    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21792    ///
21793    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21794    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21795    ///
21796    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21797    ///
21798    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21799    ///
21800    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21801    #[serde(skip_serializing_if = "Option::is_none")]
21802    pub setup_future_usage:
21803        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
21804    /// Controls when Stripe will attempt to debit the funds from the customer's account.
21805    /// The date must be a string in YYYY-MM-DD format.
21806    /// The date must be in the future and between 3 and 15 calendar days from now.
21807    #[serde(skip_serializing_if = "Option::is_none")]
21808    pub target_date: Option<String>,
21809    /// Bank account verification method.
21810    #[serde(skip_serializing_if = "Option::is_none")]
21811    pub verification_method:
21812        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
21813}
21814impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21815    pub fn new() -> Self {
21816        Self {
21817            financial_connections: None,
21818            mandate_options: None,
21819            networks: None,
21820            preferred_settlement_speed: None,
21821            setup_future_usage: None,
21822            target_date: None,
21823            verification_method: None,
21824        }
21825    }
21826}
21827impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21828    fn default() -> Self {
21829        Self::new()
21830    }
21831}
21832/// Additional fields for Financial Connections Session creation
21833#[derive(Clone, Debug, serde::Serialize)]
21834pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21835    /// Provide filters for the linked accounts that the customer can select for the payment method.
21836    #[serde(skip_serializing_if = "Option::is_none")]
21837    pub filters:
21838        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
21839    /// The list of permissions to request.
21840    /// If this parameter is passed, the `payment_method` permission must be included.
21841    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
21842    #[serde(skip_serializing_if = "Option::is_none")]
21843    pub permissions: Option<
21844        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
21845    >,
21846    /// List of data features that you would like to retrieve upon account creation.
21847    #[serde(skip_serializing_if = "Option::is_none")]
21848    pub prefetch: Option<
21849        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
21850    >,
21851    /// For webview integrations only.
21852    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
21853    #[serde(skip_serializing_if = "Option::is_none")]
21854    pub return_url: Option<String>,
21855}
21856impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21857    pub fn new() -> Self {
21858        Self { filters: None, permissions: None, prefetch: None, return_url: None }
21859    }
21860}
21861impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21862    fn default() -> Self {
21863        Self::new()
21864    }
21865}
21866/// Provide filters for the linked accounts that the customer can select for the payment method.
21867#[derive(Clone, Debug, serde::Serialize)]
21868pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21869        /// The account subcategories to use to filter for selectable accounts.
21870    /// Valid subcategories are `checking` and `savings`.
21871#[serde(skip_serializing_if = "Option::is_none")]
21872pub account_subcategories: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
21873
21874}
21875impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21876    pub fn new() -> Self {
21877        Self { account_subcategories: None }
21878    }
21879}
21880impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21881    fn default() -> Self {
21882        Self::new()
21883    }
21884}
21885/// The account subcategories to use to filter for selectable accounts.
21886/// Valid subcategories are `checking` and `savings`.
21887#[derive(Copy, Clone, Eq, PartialEq)]
21888pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
21889{
21890    Checking,
21891    Savings,
21892}
21893impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21894    pub fn as_str(self) -> &'static str {
21895        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
21896        match self {
21897Checking => "checking",
21898Savings => "savings",
21899
21900        }
21901    }
21902}
21903
21904impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21905    type Err = stripe_types::StripeParseError;
21906    fn from_str(s: &str) -> Result<Self, Self::Err> {
21907        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
21908        match s {
21909    "checking" => Ok(Checking),
21910"savings" => Ok(Savings),
21911_ => Err(stripe_types::StripeParseError)
21912
21913        }
21914    }
21915}
21916impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21917    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21918        f.write_str(self.as_str())
21919    }
21920}
21921
21922impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21923    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21924        f.write_str(self.as_str())
21925    }
21926}
21927impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21928    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
21929        serializer.serialize_str(self.as_str())
21930    }
21931}
21932#[cfg(feature = "deserialize")]
21933impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21934    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21935        use std::str::FromStr;
21936        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21937        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
21938    }
21939}
21940/// The list of permissions to request.
21941/// If this parameter is passed, the `payment_method` permission must be included.
21942/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
21943#[derive(Copy, Clone, Eq, PartialEq)]
21944pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
21945    Balances,
21946    Ownership,
21947    PaymentMethod,
21948    Transactions,
21949}
21950impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
21951    pub fn as_str(self) -> &'static str {
21952        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
21953        match self {
21954            Balances => "balances",
21955            Ownership => "ownership",
21956            PaymentMethod => "payment_method",
21957            Transactions => "transactions",
21958        }
21959    }
21960}
21961
21962impl std::str::FromStr
21963    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21964{
21965    type Err = stripe_types::StripeParseError;
21966    fn from_str(s: &str) -> Result<Self, Self::Err> {
21967        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
21968        match s {
21969            "balances" => Ok(Balances),
21970            "ownership" => Ok(Ownership),
21971            "payment_method" => Ok(PaymentMethod),
21972            "transactions" => Ok(Transactions),
21973            _ => Err(stripe_types::StripeParseError),
21974        }
21975    }
21976}
21977impl std::fmt::Display
21978    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21979{
21980    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21981        f.write_str(self.as_str())
21982    }
21983}
21984
21985impl std::fmt::Debug
21986    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21987{
21988    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21989        f.write_str(self.as_str())
21990    }
21991}
21992impl serde::Serialize
21993    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21994{
21995    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21996    where
21997        S: serde::Serializer,
21998    {
21999        serializer.serialize_str(self.as_str())
22000    }
22001}
22002#[cfg(feature = "deserialize")]
22003impl<'de> serde::Deserialize<'de>
22004    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
22005{
22006    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22007        use std::str::FromStr;
22008        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22009        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
22010    }
22011}
22012/// List of data features that you would like to retrieve upon account creation.
22013#[derive(Copy, Clone, Eq, PartialEq)]
22014pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
22015    Balances,
22016    Ownership,
22017    Transactions,
22018}
22019impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
22020    pub fn as_str(self) -> &'static str {
22021        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
22022        match self {
22023            Balances => "balances",
22024            Ownership => "ownership",
22025            Transactions => "transactions",
22026        }
22027    }
22028}
22029
22030impl std::str::FromStr
22031    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
22032{
22033    type Err = stripe_types::StripeParseError;
22034    fn from_str(s: &str) -> Result<Self, Self::Err> {
22035        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
22036        match s {
22037            "balances" => Ok(Balances),
22038            "ownership" => Ok(Ownership),
22039            "transactions" => Ok(Transactions),
22040            _ => Err(stripe_types::StripeParseError),
22041        }
22042    }
22043}
22044impl std::fmt::Display
22045    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
22046{
22047    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22048        f.write_str(self.as_str())
22049    }
22050}
22051
22052impl std::fmt::Debug
22053    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
22054{
22055    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22056        f.write_str(self.as_str())
22057    }
22058}
22059impl serde::Serialize
22060    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
22061{
22062    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22063    where
22064        S: serde::Serializer,
22065    {
22066        serializer.serialize_str(self.as_str())
22067    }
22068}
22069#[cfg(feature = "deserialize")]
22070impl<'de> serde::Deserialize<'de>
22071    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
22072{
22073    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22074        use std::str::FromStr;
22075        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22076        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
22077    }
22078}
22079/// Additional fields for Mandate creation
22080#[derive(Copy, Clone, Debug, serde::Serialize)]
22081pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
22082    /// The method used to collect offline mandate customer acceptance.
22083    #[serde(skip_serializing_if = "Option::is_none")]
22084    pub collection_method:
22085        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
22086}
22087impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
22088    pub fn new() -> Self {
22089        Self { collection_method: None }
22090    }
22091}
22092impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
22093    fn default() -> Self {
22094        Self::new()
22095    }
22096}
22097/// The method used to collect offline mandate customer acceptance.
22098#[derive(Copy, Clone, Eq, PartialEq)]
22099pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
22100    Paper,
22101}
22102impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
22103    pub fn as_str(self) -> &'static str {
22104        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
22105        match self {
22106            Paper => "paper",
22107        }
22108    }
22109}
22110
22111impl std::str::FromStr
22112    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
22113{
22114    type Err = stripe_types::StripeParseError;
22115    fn from_str(s: &str) -> Result<Self, Self::Err> {
22116        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
22117        match s {
22118            "paper" => Ok(Paper),
22119            _ => Err(stripe_types::StripeParseError),
22120        }
22121    }
22122}
22123impl std::fmt::Display
22124    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
22125{
22126    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22127        f.write_str(self.as_str())
22128    }
22129}
22130
22131impl std::fmt::Debug
22132    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
22133{
22134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22135        f.write_str(self.as_str())
22136    }
22137}
22138impl serde::Serialize
22139    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
22140{
22141    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22142    where
22143        S: serde::Serializer,
22144    {
22145        serializer.serialize_str(self.as_str())
22146    }
22147}
22148#[cfg(feature = "deserialize")]
22149impl<'de> serde::Deserialize<'de>
22150    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
22151{
22152    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22153        use std::str::FromStr;
22154        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22155        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
22156    }
22157}
22158/// Additional fields for network related functions
22159#[derive(Clone, Debug, serde::Serialize)]
22160pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
22161    /// Triggers validations to run across the selected networks
22162    #[serde(skip_serializing_if = "Option::is_none")]
22163    pub requested:
22164        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
22165}
22166impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
22167    pub fn new() -> Self {
22168        Self { requested: None }
22169    }
22170}
22171impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
22172    fn default() -> Self {
22173        Self::new()
22174    }
22175}
22176/// Triggers validations to run across the selected networks
22177#[derive(Copy, Clone, Eq, PartialEq)]
22178pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22179    Ach,
22180    UsDomesticWire,
22181}
22182impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22183    pub fn as_str(self) -> &'static str {
22184        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
22185        match self {
22186            Ach => "ach",
22187            UsDomesticWire => "us_domestic_wire",
22188        }
22189    }
22190}
22191
22192impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22193    type Err = stripe_types::StripeParseError;
22194    fn from_str(s: &str) -> Result<Self, Self::Err> {
22195        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
22196        match s {
22197            "ach" => Ok(Ach),
22198            "us_domestic_wire" => Ok(UsDomesticWire),
22199            _ => Err(stripe_types::StripeParseError),
22200        }
22201    }
22202}
22203impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22205        f.write_str(self.as_str())
22206    }
22207}
22208
22209impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22210    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22211        f.write_str(self.as_str())
22212    }
22213}
22214impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22215    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22216    where
22217        S: serde::Serializer,
22218    {
22219        serializer.serialize_str(self.as_str())
22220    }
22221}
22222#[cfg(feature = "deserialize")]
22223impl<'de> serde::Deserialize<'de>
22224    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
22225{
22226    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22227        use std::str::FromStr;
22228        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22229        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
22230    }
22231}
22232/// Preferred transaction settlement speed
22233#[derive(Copy, Clone, Eq, PartialEq)]
22234pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
22235    Fastest,
22236    Standard,
22237}
22238impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
22239    pub fn as_str(self) -> &'static str {
22240        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
22241        match self {
22242            Fastest => "fastest",
22243            Standard => "standard",
22244        }
22245    }
22246}
22247
22248impl std::str::FromStr
22249    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22250{
22251    type Err = stripe_types::StripeParseError;
22252    fn from_str(s: &str) -> Result<Self, Self::Err> {
22253        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
22254        match s {
22255            "fastest" => Ok(Fastest),
22256            "standard" => Ok(Standard),
22257            _ => Err(stripe_types::StripeParseError),
22258        }
22259    }
22260}
22261impl std::fmt::Display
22262    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22263{
22264    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22265        f.write_str(self.as_str())
22266    }
22267}
22268
22269impl std::fmt::Debug
22270    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22271{
22272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22273        f.write_str(self.as_str())
22274    }
22275}
22276impl serde::Serialize
22277    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22278{
22279    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22280    where
22281        S: serde::Serializer,
22282    {
22283        serializer.serialize_str(self.as_str())
22284    }
22285}
22286#[cfg(feature = "deserialize")]
22287impl<'de> serde::Deserialize<'de>
22288    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22289{
22290    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22291        use std::str::FromStr;
22292        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22293        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
22294    }
22295}
22296/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22297///
22298/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22299/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22300///
22301/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22302///
22303/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22304///
22305/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22306#[derive(Copy, Clone, Eq, PartialEq)]
22307pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22308    None,
22309    OffSession,
22310    OnSession,
22311}
22312impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22313    pub fn as_str(self) -> &'static str {
22314        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
22315        match self {
22316            None => "none",
22317            OffSession => "off_session",
22318            OnSession => "on_session",
22319        }
22320    }
22321}
22322
22323impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22324    type Err = stripe_types::StripeParseError;
22325    fn from_str(s: &str) -> Result<Self, Self::Err> {
22326        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
22327        match s {
22328            "none" => Ok(None),
22329            "off_session" => Ok(OffSession),
22330            "on_session" => Ok(OnSession),
22331            _ => Err(stripe_types::StripeParseError),
22332        }
22333    }
22334}
22335impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22336    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22337        f.write_str(self.as_str())
22338    }
22339}
22340
22341impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22343        f.write_str(self.as_str())
22344    }
22345}
22346impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22347    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22348    where
22349        S: serde::Serializer,
22350    {
22351        serializer.serialize_str(self.as_str())
22352    }
22353}
22354#[cfg(feature = "deserialize")]
22355impl<'de> serde::Deserialize<'de>
22356    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
22357{
22358    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22359        use std::str::FromStr;
22360        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22361        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
22362    }
22363}
22364/// Bank account verification method.
22365#[derive(Copy, Clone, Eq, PartialEq)]
22366pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22367    Automatic,
22368    Instant,
22369    Microdeposits,
22370}
22371impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22372    pub fn as_str(self) -> &'static str {
22373        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
22374        match self {
22375            Automatic => "automatic",
22376            Instant => "instant",
22377            Microdeposits => "microdeposits",
22378        }
22379    }
22380}
22381
22382impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22383    type Err = stripe_types::StripeParseError;
22384    fn from_str(s: &str) -> Result<Self, Self::Err> {
22385        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
22386        match s {
22387            "automatic" => Ok(Automatic),
22388            "instant" => Ok(Instant),
22389            "microdeposits" => Ok(Microdeposits),
22390            _ => Err(stripe_types::StripeParseError),
22391        }
22392    }
22393}
22394impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22395    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22396        f.write_str(self.as_str())
22397    }
22398}
22399
22400impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22401    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22402        f.write_str(self.as_str())
22403    }
22404}
22405impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22406    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22407    where
22408        S: serde::Serializer,
22409    {
22410        serializer.serialize_str(self.as_str())
22411    }
22412}
22413#[cfg(feature = "deserialize")]
22414impl<'de> serde::Deserialize<'de>
22415    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
22416{
22417    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22418        use std::str::FromStr;
22419        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22420        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
22421    }
22422}
22423/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
22424#[derive(Clone, Debug, serde::Serialize)]
22425pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay {
22426    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
22427    #[serde(skip_serializing_if = "Option::is_none")]
22428    pub app_id: Option<String>,
22429    /// The client type that the end customer will pay from
22430    #[serde(skip_serializing_if = "Option::is_none")]
22431    pub client: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPayClient>,
22432    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22433    ///
22434    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22435    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22436    ///
22437    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22438    ///
22439    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22440    ///
22441    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22442    #[serde(skip_serializing_if = "Option::is_none")]
22443    pub setup_future_usage:
22444        Option<UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
22445}
22446impl UpdatePaymentIntentPaymentMethodOptionsWechatPay {
22447    pub fn new() -> Self {
22448        Self { app_id: None, client: None, setup_future_usage: None }
22449    }
22450}
22451impl Default for UpdatePaymentIntentPaymentMethodOptionsWechatPay {
22452    fn default() -> Self {
22453        Self::new()
22454    }
22455}
22456/// The client type that the end customer will pay from
22457#[derive(Copy, Clone, Eq, PartialEq)]
22458pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22459    Android,
22460    Ios,
22461    Web,
22462}
22463impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22464    pub fn as_str(self) -> &'static str {
22465        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
22466        match self {
22467            Android => "android",
22468            Ios => "ios",
22469            Web => "web",
22470        }
22471    }
22472}
22473
22474impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22475    type Err = stripe_types::StripeParseError;
22476    fn from_str(s: &str) -> Result<Self, Self::Err> {
22477        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
22478        match s {
22479            "android" => Ok(Android),
22480            "ios" => Ok(Ios),
22481            "web" => Ok(Web),
22482            _ => Err(stripe_types::StripeParseError),
22483        }
22484    }
22485}
22486impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22487    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22488        f.write_str(self.as_str())
22489    }
22490}
22491
22492impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22494        f.write_str(self.as_str())
22495    }
22496}
22497impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22498    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22499    where
22500        S: serde::Serializer,
22501    {
22502        serializer.serialize_str(self.as_str())
22503    }
22504}
22505#[cfg(feature = "deserialize")]
22506impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22507    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22508        use std::str::FromStr;
22509        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22510        Self::from_str(&s).map_err(|_| {
22511            serde::de::Error::custom(
22512                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient",
22513            )
22514        })
22515    }
22516}
22517/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22518///
22519/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22520/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22521///
22522/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22523///
22524/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22525///
22526/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22527#[derive(Copy, Clone, Eq, PartialEq)]
22528pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22529    None,
22530}
22531impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22532    pub fn as_str(self) -> &'static str {
22533        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
22534        match self {
22535            None => "none",
22536        }
22537    }
22538}
22539
22540impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22541    type Err = stripe_types::StripeParseError;
22542    fn from_str(s: &str) -> Result<Self, Self::Err> {
22543        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
22544        match s {
22545            "none" => Ok(None),
22546            _ => Err(stripe_types::StripeParseError),
22547        }
22548    }
22549}
22550impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22551    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22552        f.write_str(self.as_str())
22553    }
22554}
22555
22556impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22557    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22558        f.write_str(self.as_str())
22559    }
22560}
22561impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22562    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22563    where
22564        S: serde::Serializer,
22565    {
22566        serializer.serialize_str(self.as_str())
22567    }
22568}
22569#[cfg(feature = "deserialize")]
22570impl<'de> serde::Deserialize<'de>
22571    for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
22572{
22573    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22574        use std::str::FromStr;
22575        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22576        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
22577    }
22578}
22579/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
22580#[derive(Copy, Clone, Debug, serde::Serialize)]
22581pub struct UpdatePaymentIntentPaymentMethodOptionsZip {
22582    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22583    ///
22584    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22585    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22586    ///
22587    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22588    ///
22589    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22590    ///
22591    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22592    #[serde(skip_serializing_if = "Option::is_none")]
22593    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
22594}
22595impl UpdatePaymentIntentPaymentMethodOptionsZip {
22596    pub fn new() -> Self {
22597        Self { setup_future_usage: None }
22598    }
22599}
22600impl Default for UpdatePaymentIntentPaymentMethodOptionsZip {
22601    fn default() -> Self {
22602        Self::new()
22603    }
22604}
22605/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22606///
22607/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22608/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22609///
22610/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22611///
22612/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22613///
22614/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22615#[derive(Copy, Clone, Eq, PartialEq)]
22616pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22617    None,
22618}
22619impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22620    pub fn as_str(self) -> &'static str {
22621        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
22622        match self {
22623            None => "none",
22624        }
22625    }
22626}
22627
22628impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22629    type Err = stripe_types::StripeParseError;
22630    fn from_str(s: &str) -> Result<Self, Self::Err> {
22631        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
22632        match s {
22633            "none" => Ok(None),
22634            _ => Err(stripe_types::StripeParseError),
22635        }
22636    }
22637}
22638impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22639    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22640        f.write_str(self.as_str())
22641    }
22642}
22643
22644impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22645    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22646        f.write_str(self.as_str())
22647    }
22648}
22649impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22650    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22651    where
22652        S: serde::Serializer,
22653    {
22654        serializer.serialize_str(self.as_str())
22655    }
22656}
22657#[cfg(feature = "deserialize")]
22658impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22659    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22660        use std::str::FromStr;
22661        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22662        Self::from_str(&s).map_err(|_| {
22663            serde::de::Error::custom(
22664                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
22665            )
22666        })
22667    }
22668}
22669/// Shipping information for this PaymentIntent.
22670#[derive(Clone, Debug, serde::Serialize)]
22671pub struct UpdatePaymentIntentShipping {
22672    /// Shipping address.
22673    pub address: UpdatePaymentIntentShippingAddress,
22674    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
22675    #[serde(skip_serializing_if = "Option::is_none")]
22676    pub carrier: Option<String>,
22677    /// Recipient name.
22678    pub name: String,
22679    /// Recipient phone (including extension).
22680    #[serde(skip_serializing_if = "Option::is_none")]
22681    pub phone: Option<String>,
22682    /// The tracking number for a physical product, obtained from the delivery service.
22683    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
22684    #[serde(skip_serializing_if = "Option::is_none")]
22685    pub tracking_number: Option<String>,
22686}
22687impl UpdatePaymentIntentShipping {
22688    pub fn new(
22689        address: impl Into<UpdatePaymentIntentShippingAddress>,
22690        name: impl Into<String>,
22691    ) -> Self {
22692        Self {
22693            address: address.into(),
22694            carrier: None,
22695            name: name.into(),
22696            phone: None,
22697            tracking_number: None,
22698        }
22699    }
22700}
22701/// Shipping address.
22702#[derive(Clone, Debug, serde::Serialize)]
22703pub struct UpdatePaymentIntentShippingAddress {
22704    /// City, district, suburb, town, or village.
22705    #[serde(skip_serializing_if = "Option::is_none")]
22706    pub city: Option<String>,
22707    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
22708    #[serde(skip_serializing_if = "Option::is_none")]
22709    pub country: Option<String>,
22710    /// Address line 1, such as the street, PO Box, or company name.
22711    #[serde(skip_serializing_if = "Option::is_none")]
22712    pub line1: Option<String>,
22713    /// Address line 2, such as the apartment, suite, unit, or building.
22714    #[serde(skip_serializing_if = "Option::is_none")]
22715    pub line2: Option<String>,
22716    /// ZIP or postal code.
22717    #[serde(skip_serializing_if = "Option::is_none")]
22718    pub postal_code: Option<String>,
22719    /// State, county, province, or region.
22720    #[serde(skip_serializing_if = "Option::is_none")]
22721    pub state: Option<String>,
22722}
22723impl UpdatePaymentIntentShippingAddress {
22724    pub fn new() -> Self {
22725        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
22726    }
22727}
22728impl Default for UpdatePaymentIntentShippingAddress {
22729    fn default() -> Self {
22730        Self::new()
22731    }
22732}
22733/// Use this parameter to automatically create a Transfer when the payment succeeds.
22734/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22735#[derive(Copy, Clone, Debug, serde::Serialize)]
22736pub struct UpdatePaymentIntentTransferData {
22737    /// The amount that will be transferred automatically when a charge succeeds.
22738    #[serde(skip_serializing_if = "Option::is_none")]
22739    pub amount: Option<i64>,
22740}
22741impl UpdatePaymentIntentTransferData {
22742    pub fn new() -> Self {
22743        Self { amount: None }
22744    }
22745}
22746impl Default for UpdatePaymentIntentTransferData {
22747    fn default() -> Self {
22748        Self::new()
22749    }
22750}
22751/// Updates properties on a PaymentIntent object without confirming.
22752///
22753/// Depending on which properties you update, you might need to confirm the
22754/// PaymentIntent again. For example, updating the `payment_method`
22755/// always requires you to confirm the PaymentIntent again. If you prefer to
22756/// update and confirm at the same time, we recommend updating properties through
22757/// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
22758#[derive(Clone, Debug, serde::Serialize)]
22759pub struct UpdatePaymentIntent {
22760    inner: UpdatePaymentIntentBuilder,
22761    intent: stripe_shared::PaymentIntentId,
22762}
22763impl UpdatePaymentIntent {
22764    /// Construct a new `UpdatePaymentIntent`.
22765    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22766        Self { intent: intent.into(), inner: UpdatePaymentIntentBuilder::new() }
22767    }
22768    /// Amount intended to be collected by this PaymentIntent.
22769    /// 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).
22770    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
22771    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
22772    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
22773        self.inner.amount = Some(amount.into());
22774        self
22775    }
22776    /// Provides industry-specific information about the amount.
22777    pub fn amount_details(
22778        mut self,
22779        amount_details: impl Into<UpdatePaymentIntentAmountDetails>,
22780    ) -> Self {
22781        self.inner.amount_details = Some(amount_details.into());
22782        self
22783    }
22784    /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
22785    /// The amount of the application fee collected will be capped at the total amount captured.
22786    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22787    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
22788        self.inner.application_fee_amount = Some(application_fee_amount.into());
22789        self
22790    }
22791    /// Controls when the funds will be captured from the customer's account.
22792    pub fn capture_method(
22793        mut self,
22794        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
22795    ) -> Self {
22796        self.inner.capture_method = Some(capture_method.into());
22797        self
22798    }
22799    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
22800    /// Must be a [supported currency](https://stripe.com/docs/currencies).
22801    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
22802        self.inner.currency = Some(currency.into());
22803        self
22804    }
22805    /// ID of the Customer this PaymentIntent belongs to, if one exists.
22806    ///
22807    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
22808    ///
22809    /// If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
22810    /// If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead.
22811    pub fn customer(mut self, customer: impl Into<String>) -> Self {
22812        self.inner.customer = Some(customer.into());
22813        self
22814    }
22815    /// An arbitrary string attached to the object. Often useful for displaying to users.
22816    pub fn description(mut self, description: impl Into<String>) -> Self {
22817        self.inner.description = Some(description.into());
22818        self
22819    }
22820    /// The list of payment method types to exclude from use with this payment.
22821    pub fn excluded_payment_method_types(
22822        mut self,
22823        excluded_payment_method_types: impl Into<
22824            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
22825        >,
22826    ) -> Self {
22827        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
22828        self
22829    }
22830    /// Specifies which fields in the response should be expanded.
22831    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22832        self.inner.expand = Some(expand.into());
22833        self
22834    }
22835    /// Automations to be run during the PaymentIntent lifecycle
22836    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
22837        self.inner.hooks = Some(hooks.into());
22838        self
22839    }
22840    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
22841    /// This can be useful for storing additional information about the object in a structured format.
22842    /// Individual keys can be unset by posting an empty value to them.
22843    /// All keys can be unset by posting an empty value to `metadata`.
22844    pub fn metadata(
22845        mut self,
22846        metadata: impl Into<std::collections::HashMap<String, String>>,
22847    ) -> Self {
22848        self.inner.metadata = Some(metadata.into());
22849        self
22850    }
22851    /// Provides industry-specific information about the charge.
22852    pub fn payment_details(
22853        mut self,
22854        payment_details: impl Into<UpdatePaymentIntentPaymentDetails>,
22855    ) -> Self {
22856        self.inner.payment_details = Some(payment_details.into());
22857        self
22858    }
22859    /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.
22860    /// To unset this field to null, pass in an empty string.
22861    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
22862        self.inner.payment_method = Some(payment_method.into());
22863        self
22864    }
22865    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
22866    pub fn payment_method_configuration(
22867        mut self,
22868        payment_method_configuration: impl Into<String>,
22869    ) -> Self {
22870        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
22871        self
22872    }
22873    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
22874    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
22875    /// property on the PaymentIntent.
22876    pub fn payment_method_data(
22877        mut self,
22878        payment_method_data: impl Into<UpdatePaymentIntentPaymentMethodData>,
22879    ) -> Self {
22880        self.inner.payment_method_data = Some(payment_method_data.into());
22881        self
22882    }
22883    /// Payment-method-specific configuration for this PaymentIntent.
22884    pub fn payment_method_options(
22885        mut self,
22886        payment_method_options: impl Into<UpdatePaymentIntentPaymentMethodOptions>,
22887    ) -> Self {
22888        self.inner.payment_method_options = Some(payment_method_options.into());
22889        self
22890    }
22891    /// The list of payment method types (for example, card) that this PaymentIntent can use.
22892    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
22893    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
22894    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
22895        self.inner.payment_method_types = Some(payment_method_types.into());
22896        self
22897    }
22898    /// Email address that the receipt for the resulting payment will be sent to.
22899    /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
22900    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
22901        self.inner.receipt_email = Some(receipt_email.into());
22902        self
22903    }
22904    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22905    ///
22906    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22907    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22908    ///
22909    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22910    ///
22911    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22912    ///
22913    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22914    pub fn setup_future_usage(
22915        mut self,
22916        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
22917    ) -> Self {
22918        self.inner.setup_future_usage = Some(setup_future_usage.into());
22919        self
22920    }
22921    /// Shipping information for this PaymentIntent.
22922    pub fn shipping(mut self, shipping: impl Into<UpdatePaymentIntentShipping>) -> Self {
22923        self.inner.shipping = Some(shipping.into());
22924        self
22925    }
22926    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
22927    /// This value overrides the account's default statement descriptor.
22928    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
22929    ///
22930    /// Setting this value for a card charge returns an error.
22931    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
22932    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
22933        self.inner.statement_descriptor = Some(statement_descriptor.into());
22934        self
22935    }
22936    /// Provides information about a card charge.
22937    /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
22938    pub fn statement_descriptor_suffix(
22939        mut self,
22940        statement_descriptor_suffix: impl Into<String>,
22941    ) -> Self {
22942        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
22943        self
22944    }
22945    /// Use this parameter to automatically create a Transfer when the payment succeeds.
22946    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22947    pub fn transfer_data(
22948        mut self,
22949        transfer_data: impl Into<UpdatePaymentIntentTransferData>,
22950    ) -> Self {
22951        self.inner.transfer_data = Some(transfer_data.into());
22952        self
22953    }
22954    /// A string that identifies the resulting payment as part of a group.
22955    /// You can only provide `transfer_group` if it hasn't been set.
22956    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22957    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
22958        self.inner.transfer_group = Some(transfer_group.into());
22959        self
22960    }
22961}
22962impl UpdatePaymentIntent {
22963    /// Send the request and return the deserialized response.
22964    pub async fn send<C: StripeClient>(
22965        &self,
22966        client: &C,
22967    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22968        self.customize().send(client).await
22969    }
22970
22971    /// Send the request and return the deserialized response, blocking until completion.
22972    pub fn send_blocking<C: StripeBlockingClient>(
22973        &self,
22974        client: &C,
22975    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22976        self.customize().send_blocking(client)
22977    }
22978}
22979
22980impl StripeRequest for UpdatePaymentIntent {
22981    type Output = stripe_shared::PaymentIntent;
22982
22983    fn build(&self) -> RequestBuilder {
22984        let intent = &self.intent;
22985        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}"))
22986            .form(&self.inner)
22987    }
22988}
22989#[derive(Clone, Debug, serde::Serialize)]
22990struct ApplyCustomerBalancePaymentIntentBuilder {
22991    #[serde(skip_serializing_if = "Option::is_none")]
22992    amount: Option<i64>,
22993    #[serde(skip_serializing_if = "Option::is_none")]
22994    currency: Option<stripe_types::Currency>,
22995    #[serde(skip_serializing_if = "Option::is_none")]
22996    expand: Option<Vec<String>>,
22997}
22998impl ApplyCustomerBalancePaymentIntentBuilder {
22999    fn new() -> Self {
23000        Self { amount: None, currency: None, expand: None }
23001    }
23002}
23003/// Manually reconcile the remaining amount for a `customer_balance` PaymentIntent.
23004#[derive(Clone, Debug, serde::Serialize)]
23005pub struct ApplyCustomerBalancePaymentIntent {
23006    inner: ApplyCustomerBalancePaymentIntentBuilder,
23007    intent: stripe_shared::PaymentIntentId,
23008}
23009impl ApplyCustomerBalancePaymentIntent {
23010    /// Construct a new `ApplyCustomerBalancePaymentIntent`.
23011    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
23012        Self { intent: intent.into(), inner: ApplyCustomerBalancePaymentIntentBuilder::new() }
23013    }
23014    /// Amount that you intend to apply to this PaymentIntent from the customer’s cash balance.
23015    /// If the PaymentIntent was created by an Invoice, the full amount of the PaymentIntent is applied regardless of this parameter.
23016    ///
23017    /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency).
23018    /// The maximum amount is the amount of the PaymentIntent.
23019    ///
23020    /// When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent.
23021    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
23022        self.inner.amount = Some(amount.into());
23023        self
23024    }
23025    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
23026    /// Must be a [supported currency](https://stripe.com/docs/currencies).
23027    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
23028        self.inner.currency = Some(currency.into());
23029        self
23030    }
23031    /// Specifies which fields in the response should be expanded.
23032    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
23033        self.inner.expand = Some(expand.into());
23034        self
23035    }
23036}
23037impl ApplyCustomerBalancePaymentIntent {
23038    /// Send the request and return the deserialized response.
23039    pub async fn send<C: StripeClient>(
23040        &self,
23041        client: &C,
23042    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23043        self.customize().send(client).await
23044    }
23045
23046    /// Send the request and return the deserialized response, blocking until completion.
23047    pub fn send_blocking<C: StripeBlockingClient>(
23048        &self,
23049        client: &C,
23050    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23051        self.customize().send_blocking(client)
23052    }
23053}
23054
23055impl StripeRequest for ApplyCustomerBalancePaymentIntent {
23056    type Output = stripe_shared::PaymentIntent;
23057
23058    fn build(&self) -> RequestBuilder {
23059        let intent = &self.intent;
23060        RequestBuilder::new(
23061            StripeMethod::Post,
23062            format!("/payment_intents/{intent}/apply_customer_balance"),
23063        )
23064        .form(&self.inner)
23065    }
23066}
23067#[derive(Clone, Debug, serde::Serialize)]
23068struct CancelPaymentIntentBuilder {
23069    #[serde(skip_serializing_if = "Option::is_none")]
23070    cancellation_reason: Option<CancelPaymentIntentCancellationReason>,
23071    #[serde(skip_serializing_if = "Option::is_none")]
23072    expand: Option<Vec<String>>,
23073}
23074impl CancelPaymentIntentBuilder {
23075    fn new() -> Self {
23076        Self { cancellation_reason: None, expand: None }
23077    }
23078}
23079/// Reason for canceling this PaymentIntent.
23080/// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
23081#[derive(Copy, Clone, Eq, PartialEq)]
23082pub enum CancelPaymentIntentCancellationReason {
23083    Abandoned,
23084    Duplicate,
23085    Fraudulent,
23086    RequestedByCustomer,
23087}
23088impl CancelPaymentIntentCancellationReason {
23089    pub fn as_str(self) -> &'static str {
23090        use CancelPaymentIntentCancellationReason::*;
23091        match self {
23092            Abandoned => "abandoned",
23093            Duplicate => "duplicate",
23094            Fraudulent => "fraudulent",
23095            RequestedByCustomer => "requested_by_customer",
23096        }
23097    }
23098}
23099
23100impl std::str::FromStr for CancelPaymentIntentCancellationReason {
23101    type Err = stripe_types::StripeParseError;
23102    fn from_str(s: &str) -> Result<Self, Self::Err> {
23103        use CancelPaymentIntentCancellationReason::*;
23104        match s {
23105            "abandoned" => Ok(Abandoned),
23106            "duplicate" => Ok(Duplicate),
23107            "fraudulent" => Ok(Fraudulent),
23108            "requested_by_customer" => Ok(RequestedByCustomer),
23109            _ => Err(stripe_types::StripeParseError),
23110        }
23111    }
23112}
23113impl std::fmt::Display for CancelPaymentIntentCancellationReason {
23114    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23115        f.write_str(self.as_str())
23116    }
23117}
23118
23119impl std::fmt::Debug for CancelPaymentIntentCancellationReason {
23120    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23121        f.write_str(self.as_str())
23122    }
23123}
23124impl serde::Serialize for CancelPaymentIntentCancellationReason {
23125    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23126    where
23127        S: serde::Serializer,
23128    {
23129        serializer.serialize_str(self.as_str())
23130    }
23131}
23132#[cfg(feature = "deserialize")]
23133impl<'de> serde::Deserialize<'de> for CancelPaymentIntentCancellationReason {
23134    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23135        use std::str::FromStr;
23136        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23137        Self::from_str(&s).map_err(|_| {
23138            serde::de::Error::custom("Unknown value for CancelPaymentIntentCancellationReason")
23139        })
23140    }
23141}
23142/// You can cancel a PaymentIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action` or, [in rare cases](https://stripe.com/docs/payments/intents), `processing`.
23143///
23144///
23145/// After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error.
23146/// For PaymentIntents with a `status` of `requires_capture`, the remaining `amount_capturable` is automatically refunded.
23147///
23148///
23149/// You can’t cancel the PaymentIntent for a Checkout Session.
23150/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
23151#[derive(Clone, Debug, serde::Serialize)]
23152pub struct CancelPaymentIntent {
23153    inner: CancelPaymentIntentBuilder,
23154    intent: stripe_shared::PaymentIntentId,
23155}
23156impl CancelPaymentIntent {
23157    /// Construct a new `CancelPaymentIntent`.
23158    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
23159        Self { intent: intent.into(), inner: CancelPaymentIntentBuilder::new() }
23160    }
23161    /// Reason for canceling this PaymentIntent.
23162    /// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
23163    pub fn cancellation_reason(
23164        mut self,
23165        cancellation_reason: impl Into<CancelPaymentIntentCancellationReason>,
23166    ) -> Self {
23167        self.inner.cancellation_reason = Some(cancellation_reason.into());
23168        self
23169    }
23170    /// Specifies which fields in the response should be expanded.
23171    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
23172        self.inner.expand = Some(expand.into());
23173        self
23174    }
23175}
23176impl CancelPaymentIntent {
23177    /// Send the request and return the deserialized response.
23178    pub async fn send<C: StripeClient>(
23179        &self,
23180        client: &C,
23181    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23182        self.customize().send(client).await
23183    }
23184
23185    /// Send the request and return the deserialized response, blocking until completion.
23186    pub fn send_blocking<C: StripeBlockingClient>(
23187        &self,
23188        client: &C,
23189    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23190        self.customize().send_blocking(client)
23191    }
23192}
23193
23194impl StripeRequest for CancelPaymentIntent {
23195    type Output = stripe_shared::PaymentIntent;
23196
23197    fn build(&self) -> RequestBuilder {
23198        let intent = &self.intent;
23199        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/cancel"))
23200            .form(&self.inner)
23201    }
23202}
23203#[derive(Clone, Debug, serde::Serialize)]
23204struct CapturePaymentIntentBuilder {
23205    #[serde(skip_serializing_if = "Option::is_none")]
23206    amount_details: Option<CapturePaymentIntentAmountDetails>,
23207    #[serde(skip_serializing_if = "Option::is_none")]
23208    amount_to_capture: Option<i64>,
23209    #[serde(skip_serializing_if = "Option::is_none")]
23210    application_fee_amount: Option<i64>,
23211    #[serde(skip_serializing_if = "Option::is_none")]
23212    expand: Option<Vec<String>>,
23213    #[serde(skip_serializing_if = "Option::is_none")]
23214    final_capture: Option<bool>,
23215    #[serde(skip_serializing_if = "Option::is_none")]
23216    hooks: Option<AsyncWorkflowsParam>,
23217    #[serde(skip_serializing_if = "Option::is_none")]
23218    metadata: Option<std::collections::HashMap<String, String>>,
23219    #[serde(skip_serializing_if = "Option::is_none")]
23220    payment_details: Option<CapturePaymentIntentPaymentDetails>,
23221    #[serde(skip_serializing_if = "Option::is_none")]
23222    statement_descriptor: Option<String>,
23223    #[serde(skip_serializing_if = "Option::is_none")]
23224    statement_descriptor_suffix: Option<String>,
23225    #[serde(skip_serializing_if = "Option::is_none")]
23226    transfer_data: Option<CapturePaymentIntentTransferData>,
23227}
23228impl CapturePaymentIntentBuilder {
23229    fn new() -> Self {
23230        Self {
23231            amount_details: None,
23232            amount_to_capture: None,
23233            application_fee_amount: None,
23234            expand: None,
23235            final_capture: None,
23236            hooks: None,
23237            metadata: None,
23238            payment_details: None,
23239            statement_descriptor: None,
23240            statement_descriptor_suffix: None,
23241            transfer_data: None,
23242        }
23243    }
23244}
23245/// Provides industry-specific information about the amount.
23246#[derive(Clone, Debug, serde::Serialize)]
23247pub struct CapturePaymentIntentAmountDetails {
23248    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23249    /// An integer greater than 0.
23250    ///
23251    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
23252    #[serde(skip_serializing_if = "Option::is_none")]
23253    pub discount_amount: Option<i64>,
23254    /// A list of line items, each containing information about a product in the PaymentIntent.
23255    /// There is a maximum of 100 line items.
23256    #[serde(skip_serializing_if = "Option::is_none")]
23257    pub line_items: Option<Vec<CapturePaymentIntentAmountDetailsLineItems>>,
23258    /// Contains information about the shipping portion of the amount.
23259    #[serde(skip_serializing_if = "Option::is_none")]
23260    pub shipping: Option<AmountDetailsShippingParam>,
23261    /// Contains information about the tax portion of the amount.
23262    #[serde(skip_serializing_if = "Option::is_none")]
23263    pub tax: Option<AmountDetailsTaxParam>,
23264}
23265impl CapturePaymentIntentAmountDetails {
23266    pub fn new() -> Self {
23267        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
23268    }
23269}
23270impl Default for CapturePaymentIntentAmountDetails {
23271    fn default() -> Self {
23272        Self::new()
23273    }
23274}
23275/// A list of line items, each containing information about a product in the PaymentIntent.
23276/// There is a maximum of 100 line items.
23277#[derive(Clone, Debug, serde::Serialize)]
23278pub struct CapturePaymentIntentAmountDetailsLineItems {
23279    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23280    /// An integer greater than 0.
23281    ///
23282    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
23283    #[serde(skip_serializing_if = "Option::is_none")]
23284    pub discount_amount: Option<i64>,
23285    /// Payment method-specific information for line items.
23286    #[serde(skip_serializing_if = "Option::is_none")]
23287    pub payment_method_options:
23288        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
23289    /// The product code of the line item, such as an SKU.
23290    /// Required for L3 rates.
23291    /// At most 12 characters long.
23292    #[serde(skip_serializing_if = "Option::is_none")]
23293    pub product_code: Option<String>,
23294    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
23295    ///
23296    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
23297    /// For Paypal, this field is truncated to 127 characters.
23298    pub product_name: String,
23299    /// The quantity of items. Required for L3 rates. An integer greater than 0.
23300    pub quantity: u64,
23301    /// Contains information about the tax on the item.
23302    #[serde(skip_serializing_if = "Option::is_none")]
23303    pub tax: Option<AmountDetailsLineItemTaxParam>,
23304    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23305    /// Required for L3 rates.
23306    /// An integer greater than or equal to 0.
23307    pub unit_cost: i64,
23308    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
23309    #[serde(skip_serializing_if = "Option::is_none")]
23310    pub unit_of_measure: Option<String>,
23311}
23312impl CapturePaymentIntentAmountDetailsLineItems {
23313    pub fn new(
23314        product_name: impl Into<String>,
23315        quantity: impl Into<u64>,
23316        unit_cost: impl Into<i64>,
23317    ) -> Self {
23318        Self {
23319            discount_amount: None,
23320            payment_method_options: None,
23321            product_code: None,
23322            product_name: product_name.into(),
23323            quantity: quantity.into(),
23324            tax: None,
23325            unit_cost: unit_cost.into(),
23326            unit_of_measure: None,
23327        }
23328    }
23329}
23330/// Payment method-specific information for line items.
23331#[derive(Clone, Debug, serde::Serialize)]
23332pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23333    /// This sub-hash contains line item details that are specific to `card` payment method."
23334    #[serde(skip_serializing_if = "Option::is_none")]
23335    pub card: Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
23336    /// This sub-hash contains line item details that are specific to `card_present` payment method."
23337    #[serde(skip_serializing_if = "Option::is_none")]
23338    pub card_present:
23339        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
23340    /// This sub-hash contains line item details that are specific to `klarna` payment method."
23341    #[serde(skip_serializing_if = "Option::is_none")]
23342    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
23343    /// This sub-hash contains line item details that are specific to `paypal` payment method."
23344    #[serde(skip_serializing_if = "Option::is_none")]
23345    pub paypal: Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
23346}
23347impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23348    pub fn new() -> Self {
23349        Self { card: None, card_present: None, klarna: None, paypal: None }
23350    }
23351}
23352impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23353    fn default() -> Self {
23354        Self::new()
23355    }
23356}
23357/// This sub-hash contains line item details that are specific to `card` payment method."
23358#[derive(Clone, Debug, serde::Serialize)]
23359pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23360    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23361    #[serde(skip_serializing_if = "Option::is_none")]
23362    pub commodity_code: Option<String>,
23363}
23364impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23365    pub fn new() -> Self {
23366        Self { commodity_code: None }
23367    }
23368}
23369impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23370    fn default() -> Self {
23371        Self::new()
23372    }
23373}
23374/// This sub-hash contains line item details that are specific to `card_present` payment method."
23375#[derive(Clone, Debug, serde::Serialize)]
23376pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23377    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23378    #[serde(skip_serializing_if = "Option::is_none")]
23379    pub commodity_code: Option<String>,
23380}
23381impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23382    pub fn new() -> Self {
23383        Self { commodity_code: None }
23384    }
23385}
23386impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23387    fn default() -> Self {
23388        Self::new()
23389    }
23390}
23391/// This sub-hash contains line item details that are specific to `paypal` payment method."
23392#[derive(Clone, Debug, serde::Serialize)]
23393pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23394    /// Type of the line item.
23395    #[serde(skip_serializing_if = "Option::is_none")]
23396    pub category:
23397        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
23398    /// Description of the line item.
23399    #[serde(skip_serializing_if = "Option::is_none")]
23400    pub description: Option<String>,
23401    /// The Stripe account ID of the connected account that sells the item.
23402    #[serde(skip_serializing_if = "Option::is_none")]
23403    pub sold_by: Option<String>,
23404}
23405impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23406    pub fn new() -> Self {
23407        Self { category: None, description: None, sold_by: None }
23408    }
23409}
23410impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23411    fn default() -> Self {
23412        Self::new()
23413    }
23414}
23415/// Type of the line item.
23416#[derive(Copy, Clone, Eq, PartialEq)]
23417pub enum CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23418    DigitalGoods,
23419    Donation,
23420    PhysicalGoods,
23421}
23422impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23423    pub fn as_str(self) -> &'static str {
23424        use CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23425        match self {
23426            DigitalGoods => "digital_goods",
23427            Donation => "donation",
23428            PhysicalGoods => "physical_goods",
23429        }
23430    }
23431}
23432
23433impl std::str::FromStr
23434    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23435{
23436    type Err = stripe_types::StripeParseError;
23437    fn from_str(s: &str) -> Result<Self, Self::Err> {
23438        use CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23439        match s {
23440            "digital_goods" => Ok(DigitalGoods),
23441            "donation" => Ok(Donation),
23442            "physical_goods" => Ok(PhysicalGoods),
23443            _ => Err(stripe_types::StripeParseError),
23444        }
23445    }
23446}
23447impl std::fmt::Display
23448    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23449{
23450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23451        f.write_str(self.as_str())
23452    }
23453}
23454
23455impl std::fmt::Debug
23456    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23457{
23458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23459        f.write_str(self.as_str())
23460    }
23461}
23462impl serde::Serialize
23463    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23464{
23465    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23466    where
23467        S: serde::Serializer,
23468    {
23469        serializer.serialize_str(self.as_str())
23470    }
23471}
23472#[cfg(feature = "deserialize")]
23473impl<'de> serde::Deserialize<'de>
23474    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23475{
23476    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23477        use std::str::FromStr;
23478        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23479        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
23480    }
23481}
23482/// Provides industry-specific information about the charge.
23483#[derive(Clone, Debug, serde::Serialize)]
23484pub struct CapturePaymentIntentPaymentDetails {
23485    /// A unique value to identify the customer. This field is available only for card payments.
23486    ///
23487    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
23488    #[serde(skip_serializing_if = "Option::is_none")]
23489    pub customer_reference: Option<String>,
23490    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
23491    ///
23492    /// Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`.
23493    ///
23494    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
23495    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
23496    #[serde(skip_serializing_if = "Option::is_none")]
23497    pub order_reference: Option<String>,
23498}
23499impl CapturePaymentIntentPaymentDetails {
23500    pub fn new() -> Self {
23501        Self { customer_reference: None, order_reference: None }
23502    }
23503}
23504impl Default for CapturePaymentIntentPaymentDetails {
23505    fn default() -> Self {
23506        Self::new()
23507    }
23508}
23509/// The parameters that you can use to automatically create a transfer after the payment
23510/// is captured.
23511/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
23512#[derive(Copy, Clone, Debug, serde::Serialize)]
23513pub struct CapturePaymentIntentTransferData {
23514    /// The amount that will be transferred automatically when a charge succeeds.
23515    #[serde(skip_serializing_if = "Option::is_none")]
23516    pub amount: Option<i64>,
23517}
23518impl CapturePaymentIntentTransferData {
23519    pub fn new() -> Self {
23520        Self { amount: None }
23521    }
23522}
23523impl Default for CapturePaymentIntentTransferData {
23524    fn default() -> Self {
23525        Self::new()
23526    }
23527}
23528/// Capture the funds of an existing uncaptured PaymentIntent when its status is `requires_capture`.
23529///
23530/// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
23531///
23532/// Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
23533#[derive(Clone, Debug, serde::Serialize)]
23534pub struct CapturePaymentIntent {
23535    inner: CapturePaymentIntentBuilder,
23536    intent: stripe_shared::PaymentIntentId,
23537}
23538impl CapturePaymentIntent {
23539    /// Construct a new `CapturePaymentIntent`.
23540    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
23541        Self { intent: intent.into(), inner: CapturePaymentIntentBuilder::new() }
23542    }
23543    /// Provides industry-specific information about the amount.
23544    pub fn amount_details(
23545        mut self,
23546        amount_details: impl Into<CapturePaymentIntentAmountDetails>,
23547    ) -> Self {
23548        self.inner.amount_details = Some(amount_details.into());
23549        self
23550    }
23551    /// The amount to capture from the PaymentIntent, which must be less than or equal to the original amount.
23552    /// Defaults to the full `amount_capturable` if it's not provided.
23553    pub fn amount_to_capture(mut self, amount_to_capture: impl Into<i64>) -> Self {
23554        self.inner.amount_to_capture = Some(amount_to_capture.into());
23555        self
23556    }
23557    /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
23558    /// The amount of the application fee collected will be capped at the total amount captured.
23559    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
23560    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
23561        self.inner.application_fee_amount = Some(application_fee_amount.into());
23562        self
23563    }
23564    /// Specifies which fields in the response should be expanded.
23565    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
23566        self.inner.expand = Some(expand.into());
23567        self
23568    }
23569    /// Defaults to `true`.
23570    /// When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests.
23571    /// You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents.
23572    pub fn final_capture(mut self, final_capture: impl Into<bool>) -> Self {
23573        self.inner.final_capture = Some(final_capture.into());
23574        self
23575    }
23576    /// Automations to be run during the PaymentIntent lifecycle
23577    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
23578        self.inner.hooks = Some(hooks.into());
23579        self
23580    }
23581    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
23582    /// This can be useful for storing additional information about the object in a structured format.
23583    /// Individual keys can be unset by posting an empty value to them.
23584    /// All keys can be unset by posting an empty value to `metadata`.
23585    pub fn metadata(
23586        mut self,
23587        metadata: impl Into<std::collections::HashMap<String, String>>,
23588    ) -> Self {
23589        self.inner.metadata = Some(metadata.into());
23590        self
23591    }
23592    /// Provides industry-specific information about the charge.
23593    pub fn payment_details(
23594        mut self,
23595        payment_details: impl Into<CapturePaymentIntentPaymentDetails>,
23596    ) -> Self {
23597        self.inner.payment_details = Some(payment_details.into());
23598        self
23599    }
23600    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
23601    /// This value overrides the account's default statement descriptor.
23602    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
23603    ///
23604    /// Setting this value for a card charge returns an error.
23605    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
23606    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
23607        self.inner.statement_descriptor = Some(statement_descriptor.into());
23608        self
23609    }
23610    /// Provides information about a card charge.
23611    /// Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
23612    pub fn statement_descriptor_suffix(
23613        mut self,
23614        statement_descriptor_suffix: impl Into<String>,
23615    ) -> Self {
23616        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
23617        self
23618    }
23619    /// The parameters that you can use to automatically create a transfer after the payment
23620    /// is captured.
23621    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
23622    pub fn transfer_data(
23623        mut self,
23624        transfer_data: impl Into<CapturePaymentIntentTransferData>,
23625    ) -> Self {
23626        self.inner.transfer_data = Some(transfer_data.into());
23627        self
23628    }
23629}
23630impl CapturePaymentIntent {
23631    /// Send the request and return the deserialized response.
23632    pub async fn send<C: StripeClient>(
23633        &self,
23634        client: &C,
23635    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23636        self.customize().send(client).await
23637    }
23638
23639    /// Send the request and return the deserialized response, blocking until completion.
23640    pub fn send_blocking<C: StripeBlockingClient>(
23641        &self,
23642        client: &C,
23643    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23644        self.customize().send_blocking(client)
23645    }
23646}
23647
23648impl StripeRequest for CapturePaymentIntent {
23649    type Output = stripe_shared::PaymentIntent;
23650
23651    fn build(&self) -> RequestBuilder {
23652        let intent = &self.intent;
23653        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/capture"))
23654            .form(&self.inner)
23655    }
23656}
23657#[derive(Clone, Debug, serde::Serialize)]
23658struct ConfirmPaymentIntentBuilder {
23659    #[serde(skip_serializing_if = "Option::is_none")]
23660    amount_details: Option<ConfirmPaymentIntentAmountDetails>,
23661    #[serde(skip_serializing_if = "Option::is_none")]
23662    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
23663    #[serde(skip_serializing_if = "Option::is_none")]
23664    confirmation_token: Option<String>,
23665    #[serde(skip_serializing_if = "Option::is_none")]
23666    error_on_requires_action: Option<bool>,
23667    #[serde(skip_serializing_if = "Option::is_none")]
23668    excluded_payment_method_types:
23669        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
23670    #[serde(skip_serializing_if = "Option::is_none")]
23671    expand: Option<Vec<String>>,
23672    #[serde(skip_serializing_if = "Option::is_none")]
23673    hooks: Option<AsyncWorkflowsParam>,
23674    #[serde(skip_serializing_if = "Option::is_none")]
23675    mandate: Option<String>,
23676    #[serde(skip_serializing_if = "Option::is_none")]
23677    mandate_data: Option<ConfirmPaymentIntentMandateData>,
23678    #[serde(skip_serializing_if = "Option::is_none")]
23679    off_session: Option<ConfirmPaymentIntentOffSession>,
23680    #[serde(skip_serializing_if = "Option::is_none")]
23681    payment_details: Option<ConfirmPaymentIntentPaymentDetails>,
23682    #[serde(skip_serializing_if = "Option::is_none")]
23683    payment_method: Option<String>,
23684    #[serde(skip_serializing_if = "Option::is_none")]
23685    payment_method_data: Option<ConfirmPaymentIntentPaymentMethodData>,
23686    #[serde(skip_serializing_if = "Option::is_none")]
23687    payment_method_options: Option<ConfirmPaymentIntentPaymentMethodOptions>,
23688    #[serde(skip_serializing_if = "Option::is_none")]
23689    payment_method_types: Option<Vec<String>>,
23690    #[serde(skip_serializing_if = "Option::is_none")]
23691    radar_options: Option<ConfirmPaymentIntentRadarOptions>,
23692    #[serde(skip_serializing_if = "Option::is_none")]
23693    receipt_email: Option<String>,
23694    #[serde(skip_serializing_if = "Option::is_none")]
23695    return_url: Option<String>,
23696    #[serde(skip_serializing_if = "Option::is_none")]
23697    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
23698    #[serde(skip_serializing_if = "Option::is_none")]
23699    shipping: Option<ConfirmPaymentIntentShipping>,
23700    #[serde(skip_serializing_if = "Option::is_none")]
23701    use_stripe_sdk: Option<bool>,
23702}
23703impl ConfirmPaymentIntentBuilder {
23704    fn new() -> Self {
23705        Self {
23706            amount_details: None,
23707            capture_method: None,
23708            confirmation_token: None,
23709            error_on_requires_action: None,
23710            excluded_payment_method_types: None,
23711            expand: None,
23712            hooks: None,
23713            mandate: None,
23714            mandate_data: None,
23715            off_session: None,
23716            payment_details: None,
23717            payment_method: None,
23718            payment_method_data: None,
23719            payment_method_options: None,
23720            payment_method_types: None,
23721            radar_options: None,
23722            receipt_email: None,
23723            return_url: None,
23724            setup_future_usage: None,
23725            shipping: None,
23726            use_stripe_sdk: None,
23727        }
23728    }
23729}
23730/// Provides industry-specific information about the amount.
23731#[derive(Clone, Debug, serde::Serialize)]
23732pub struct ConfirmPaymentIntentAmountDetails {
23733    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23734    /// An integer greater than 0.
23735    ///
23736    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
23737    #[serde(skip_serializing_if = "Option::is_none")]
23738    pub discount_amount: Option<i64>,
23739    /// A list of line items, each containing information about a product in the PaymentIntent.
23740    /// There is a maximum of 100 line items.
23741    #[serde(skip_serializing_if = "Option::is_none")]
23742    pub line_items: Option<Vec<ConfirmPaymentIntentAmountDetailsLineItems>>,
23743    /// Contains information about the shipping portion of the amount.
23744    #[serde(skip_serializing_if = "Option::is_none")]
23745    pub shipping: Option<AmountDetailsShippingParam>,
23746    /// Contains information about the tax portion of the amount.
23747    #[serde(skip_serializing_if = "Option::is_none")]
23748    pub tax: Option<AmountDetailsTaxParam>,
23749}
23750impl ConfirmPaymentIntentAmountDetails {
23751    pub fn new() -> Self {
23752        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
23753    }
23754}
23755impl Default for ConfirmPaymentIntentAmountDetails {
23756    fn default() -> Self {
23757        Self::new()
23758    }
23759}
23760/// A list of line items, each containing information about a product in the PaymentIntent.
23761/// There is a maximum of 100 line items.
23762#[derive(Clone, Debug, serde::Serialize)]
23763pub struct ConfirmPaymentIntentAmountDetailsLineItems {
23764    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23765    /// An integer greater than 0.
23766    ///
23767    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
23768    #[serde(skip_serializing_if = "Option::is_none")]
23769    pub discount_amount: Option<i64>,
23770    /// Payment method-specific information for line items.
23771    #[serde(skip_serializing_if = "Option::is_none")]
23772    pub payment_method_options:
23773        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
23774    /// The product code of the line item, such as an SKU.
23775    /// Required for L3 rates.
23776    /// At most 12 characters long.
23777    #[serde(skip_serializing_if = "Option::is_none")]
23778    pub product_code: Option<String>,
23779    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
23780    ///
23781    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
23782    /// For Paypal, this field is truncated to 127 characters.
23783    pub product_name: String,
23784    /// The quantity of items. Required for L3 rates. An integer greater than 0.
23785    pub quantity: u64,
23786    /// Contains information about the tax on the item.
23787    #[serde(skip_serializing_if = "Option::is_none")]
23788    pub tax: Option<AmountDetailsLineItemTaxParam>,
23789    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23790    /// Required for L3 rates.
23791    /// An integer greater than or equal to 0.
23792    pub unit_cost: i64,
23793    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
23794    #[serde(skip_serializing_if = "Option::is_none")]
23795    pub unit_of_measure: Option<String>,
23796}
23797impl ConfirmPaymentIntentAmountDetailsLineItems {
23798    pub fn new(
23799        product_name: impl Into<String>,
23800        quantity: impl Into<u64>,
23801        unit_cost: impl Into<i64>,
23802    ) -> Self {
23803        Self {
23804            discount_amount: None,
23805            payment_method_options: None,
23806            product_code: None,
23807            product_name: product_name.into(),
23808            quantity: quantity.into(),
23809            tax: None,
23810            unit_cost: unit_cost.into(),
23811            unit_of_measure: None,
23812        }
23813    }
23814}
23815/// Payment method-specific information for line items.
23816#[derive(Clone, Debug, serde::Serialize)]
23817pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23818    /// This sub-hash contains line item details that are specific to `card` payment method."
23819    #[serde(skip_serializing_if = "Option::is_none")]
23820    pub card: Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
23821    /// This sub-hash contains line item details that are specific to `card_present` payment method."
23822    #[serde(skip_serializing_if = "Option::is_none")]
23823    pub card_present:
23824        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
23825    /// This sub-hash contains line item details that are specific to `klarna` payment method."
23826    #[serde(skip_serializing_if = "Option::is_none")]
23827    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
23828    /// This sub-hash contains line item details that are specific to `paypal` payment method."
23829    #[serde(skip_serializing_if = "Option::is_none")]
23830    pub paypal: Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
23831}
23832impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23833    pub fn new() -> Self {
23834        Self { card: None, card_present: None, klarna: None, paypal: None }
23835    }
23836}
23837impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23838    fn default() -> Self {
23839        Self::new()
23840    }
23841}
23842/// This sub-hash contains line item details that are specific to `card` payment method."
23843#[derive(Clone, Debug, serde::Serialize)]
23844pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23845    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23846    #[serde(skip_serializing_if = "Option::is_none")]
23847    pub commodity_code: Option<String>,
23848}
23849impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23850    pub fn new() -> Self {
23851        Self { commodity_code: None }
23852    }
23853}
23854impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23855    fn default() -> Self {
23856        Self::new()
23857    }
23858}
23859/// This sub-hash contains line item details that are specific to `card_present` payment method."
23860#[derive(Clone, Debug, serde::Serialize)]
23861pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23862    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23863    #[serde(skip_serializing_if = "Option::is_none")]
23864    pub commodity_code: Option<String>,
23865}
23866impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23867    pub fn new() -> Self {
23868        Self { commodity_code: None }
23869    }
23870}
23871impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23872    fn default() -> Self {
23873        Self::new()
23874    }
23875}
23876/// This sub-hash contains line item details that are specific to `paypal` payment method."
23877#[derive(Clone, Debug, serde::Serialize)]
23878pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23879    /// Type of the line item.
23880    #[serde(skip_serializing_if = "Option::is_none")]
23881    pub category:
23882        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
23883    /// Description of the line item.
23884    #[serde(skip_serializing_if = "Option::is_none")]
23885    pub description: Option<String>,
23886    /// The Stripe account ID of the connected account that sells the item.
23887    #[serde(skip_serializing_if = "Option::is_none")]
23888    pub sold_by: Option<String>,
23889}
23890impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23891    pub fn new() -> Self {
23892        Self { category: None, description: None, sold_by: None }
23893    }
23894}
23895impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23896    fn default() -> Self {
23897        Self::new()
23898    }
23899}
23900/// Type of the line item.
23901#[derive(Copy, Clone, Eq, PartialEq)]
23902pub enum ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23903    DigitalGoods,
23904    Donation,
23905    PhysicalGoods,
23906}
23907impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23908    pub fn as_str(self) -> &'static str {
23909        use ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23910        match self {
23911            DigitalGoods => "digital_goods",
23912            Donation => "donation",
23913            PhysicalGoods => "physical_goods",
23914        }
23915    }
23916}
23917
23918impl std::str::FromStr
23919    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23920{
23921    type Err = stripe_types::StripeParseError;
23922    fn from_str(s: &str) -> Result<Self, Self::Err> {
23923        use ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23924        match s {
23925            "digital_goods" => Ok(DigitalGoods),
23926            "donation" => Ok(Donation),
23927            "physical_goods" => Ok(PhysicalGoods),
23928            _ => Err(stripe_types::StripeParseError),
23929        }
23930    }
23931}
23932impl std::fmt::Display
23933    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23934{
23935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23936        f.write_str(self.as_str())
23937    }
23938}
23939
23940impl std::fmt::Debug
23941    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23942{
23943    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23944        f.write_str(self.as_str())
23945    }
23946}
23947impl serde::Serialize
23948    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23949{
23950    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23951    where
23952        S: serde::Serializer,
23953    {
23954        serializer.serialize_str(self.as_str())
23955    }
23956}
23957#[cfg(feature = "deserialize")]
23958impl<'de> serde::Deserialize<'de>
23959    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23960{
23961    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23962        use std::str::FromStr;
23963        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23964        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
23965    }
23966}
23967#[derive(Clone, Debug, serde::Serialize)]
23968#[serde(rename_all = "snake_case")]
23969pub enum ConfirmPaymentIntentMandateData {
23970    #[serde(untagged)]
23971    SecretKeyParam(ConfirmPaymentIntentSecretKeyParam),
23972    #[serde(untagged)]
23973    ClientKeyParam(ConfirmPaymentIntentClientKeyParam),
23974}
23975#[derive(Clone, Debug, serde::Serialize)]
23976pub struct ConfirmPaymentIntentSecretKeyParam {
23977    /// This hash contains details about the customer acceptance of the Mandate.
23978    pub customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance,
23979}
23980impl ConfirmPaymentIntentSecretKeyParam {
23981    pub fn new(
23982        customer_acceptance: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptance>,
23983    ) -> Self {
23984        Self { customer_acceptance: customer_acceptance.into() }
23985    }
23986}
23987/// This hash contains details about the customer acceptance of the Mandate.
23988#[derive(Clone, Debug, serde::Serialize)]
23989pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
23990    /// The time at which the customer accepted the Mandate.
23991    #[serde(skip_serializing_if = "Option::is_none")]
23992    pub accepted_at: Option<stripe_types::Timestamp>,
23993    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
23994    #[serde(skip_serializing_if = "Option::is_none")]
23995    #[serde(with = "stripe_types::with_serde_json_opt")]
23996    pub offline: Option<miniserde::json::Value>,
23997    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
23998    #[serde(skip_serializing_if = "Option::is_none")]
23999    pub online: Option<OnlineParam>,
24000    /// The type of customer acceptance information included with the Mandate.
24001    /// One of `online` or `offline`.
24002    #[serde(rename = "type")]
24003    pub type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType,
24004}
24005impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
24006    pub fn new(type_: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
24007        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
24008    }
24009}
24010/// The type of customer acceptance information included with the Mandate.
24011/// One of `online` or `offline`.
24012#[derive(Copy, Clone, Eq, PartialEq)]
24013pub enum ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24014    Offline,
24015    Online,
24016}
24017impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24018    pub fn as_str(self) -> &'static str {
24019        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
24020        match self {
24021            Offline => "offline",
24022            Online => "online",
24023        }
24024    }
24025}
24026
24027impl std::str::FromStr for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24028    type Err = stripe_types::StripeParseError;
24029    fn from_str(s: &str) -> Result<Self, Self::Err> {
24030        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
24031        match s {
24032            "offline" => Ok(Offline),
24033            "online" => Ok(Online),
24034            _ => Err(stripe_types::StripeParseError),
24035        }
24036    }
24037}
24038impl std::fmt::Display for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24039    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24040        f.write_str(self.as_str())
24041    }
24042}
24043
24044impl std::fmt::Debug for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24045    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24046        f.write_str(self.as_str())
24047    }
24048}
24049impl serde::Serialize for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24050    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24051    where
24052        S: serde::Serializer,
24053    {
24054        serializer.serialize_str(self.as_str())
24055    }
24056}
24057#[cfg(feature = "deserialize")]
24058impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
24059    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24060        use std::str::FromStr;
24061        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24062        Self::from_str(&s).map_err(|_| {
24063            serde::de::Error::custom(
24064                "Unknown value for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType",
24065            )
24066        })
24067    }
24068}
24069#[derive(Clone, Debug, serde::Serialize)]
24070pub struct ConfirmPaymentIntentClientKeyParam {
24071    /// This hash contains details about the customer acceptance of the Mandate.
24072    pub customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance,
24073}
24074impl ConfirmPaymentIntentClientKeyParam {
24075    pub fn new(
24076        customer_acceptance: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptance>,
24077    ) -> Self {
24078        Self { customer_acceptance: customer_acceptance.into() }
24079    }
24080}
24081/// This hash contains details about the customer acceptance of the Mandate.
24082#[derive(Clone, Debug, serde::Serialize)]
24083pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
24084    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
24085    pub online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline,
24086    /// The type of customer acceptance information included with the Mandate.
24087    #[serde(rename = "type")]
24088    pub type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType,
24089}
24090impl ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
24091    pub fn new(
24092        online: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline>,
24093        type_: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType>,
24094    ) -> Self {
24095        Self { online: online.into(), type_: type_.into() }
24096    }
24097}
24098/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
24099#[derive(Clone, Debug, serde::Serialize)]
24100pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
24101    /// The IP address from which the Mandate was accepted by the customer.
24102    #[serde(skip_serializing_if = "Option::is_none")]
24103    pub ip_address: Option<String>,
24104    /// The user agent of the browser from which the Mandate was accepted by the customer.
24105    #[serde(skip_serializing_if = "Option::is_none")]
24106    pub user_agent: Option<String>,
24107}
24108impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
24109    pub fn new() -> Self {
24110        Self { ip_address: None, user_agent: None }
24111    }
24112}
24113impl Default for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
24114    fn default() -> Self {
24115        Self::new()
24116    }
24117}
24118/// The type of customer acceptance information included with the Mandate.
24119#[derive(Copy, Clone, Eq, PartialEq)]
24120pub enum ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24121    Online,
24122}
24123impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24124    pub fn as_str(self) -> &'static str {
24125        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
24126        match self {
24127            Online => "online",
24128        }
24129    }
24130}
24131
24132impl std::str::FromStr for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24133    type Err = stripe_types::StripeParseError;
24134    fn from_str(s: &str) -> Result<Self, Self::Err> {
24135        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
24136        match s {
24137            "online" => Ok(Online),
24138            _ => Err(stripe_types::StripeParseError),
24139        }
24140    }
24141}
24142impl std::fmt::Display for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24144        f.write_str(self.as_str())
24145    }
24146}
24147
24148impl std::fmt::Debug for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24149    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24150        f.write_str(self.as_str())
24151    }
24152}
24153impl serde::Serialize for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24154    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24155    where
24156        S: serde::Serializer,
24157    {
24158        serializer.serialize_str(self.as_str())
24159    }
24160}
24161#[cfg(feature = "deserialize")]
24162impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
24163    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24164        use std::str::FromStr;
24165        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24166        Self::from_str(&s).map_err(|_| {
24167            serde::de::Error::custom(
24168                "Unknown value for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType",
24169            )
24170        })
24171    }
24172}
24173/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
24174/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
24175#[derive(Copy, Clone, Debug, serde::Serialize)]
24176#[serde(rename_all = "snake_case")]
24177pub enum ConfirmPaymentIntentOffSession {
24178    OneOff,
24179    Recurring,
24180    #[serde(untagged)]
24181    Bool(bool),
24182}
24183/// Provides industry-specific information about the charge.
24184#[derive(Clone, Debug, serde::Serialize)]
24185pub struct ConfirmPaymentIntentPaymentDetails {
24186    /// A unique value to identify the customer. This field is available only for card payments.
24187    ///
24188    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
24189    #[serde(skip_serializing_if = "Option::is_none")]
24190    pub customer_reference: Option<String>,
24191    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
24192    ///
24193    /// Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`.
24194    ///
24195    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
24196    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
24197    #[serde(skip_serializing_if = "Option::is_none")]
24198    pub order_reference: Option<String>,
24199}
24200impl ConfirmPaymentIntentPaymentDetails {
24201    pub fn new() -> Self {
24202        Self { customer_reference: None, order_reference: None }
24203    }
24204}
24205impl Default for ConfirmPaymentIntentPaymentDetails {
24206    fn default() -> Self {
24207        Self::new()
24208    }
24209}
24210/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
24211/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
24212/// property on the PaymentIntent.
24213#[derive(Clone, Debug, serde::Serialize)]
24214pub struct ConfirmPaymentIntentPaymentMethodData {
24215    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
24216    #[serde(skip_serializing_if = "Option::is_none")]
24217    pub acss_debit: Option<PaymentMethodParam>,
24218    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
24219    #[serde(skip_serializing_if = "Option::is_none")]
24220    #[serde(with = "stripe_types::with_serde_json_opt")]
24221    pub affirm: Option<miniserde::json::Value>,
24222    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
24223    #[serde(skip_serializing_if = "Option::is_none")]
24224    #[serde(with = "stripe_types::with_serde_json_opt")]
24225    pub afterpay_clearpay: Option<miniserde::json::Value>,
24226    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
24227    #[serde(skip_serializing_if = "Option::is_none")]
24228    #[serde(with = "stripe_types::with_serde_json_opt")]
24229    pub alipay: Option<miniserde::json::Value>,
24230    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
24231    /// 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.
24232    /// The field defaults to `unspecified`.
24233    #[serde(skip_serializing_if = "Option::is_none")]
24234    pub allow_redisplay: Option<ConfirmPaymentIntentPaymentMethodDataAllowRedisplay>,
24235    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
24236    #[serde(skip_serializing_if = "Option::is_none")]
24237    #[serde(with = "stripe_types::with_serde_json_opt")]
24238    pub alma: Option<miniserde::json::Value>,
24239    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
24240    #[serde(skip_serializing_if = "Option::is_none")]
24241    #[serde(with = "stripe_types::with_serde_json_opt")]
24242    pub amazon_pay: Option<miniserde::json::Value>,
24243    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
24244    #[serde(skip_serializing_if = "Option::is_none")]
24245    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodDataAuBecsDebit>,
24246    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
24247    #[serde(skip_serializing_if = "Option::is_none")]
24248    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodDataBacsDebit>,
24249    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
24250    #[serde(skip_serializing_if = "Option::is_none")]
24251    #[serde(with = "stripe_types::with_serde_json_opt")]
24252    pub bancontact: Option<miniserde::json::Value>,
24253    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
24254    #[serde(skip_serializing_if = "Option::is_none")]
24255    #[serde(with = "stripe_types::with_serde_json_opt")]
24256    pub billie: Option<miniserde::json::Value>,
24257    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
24258    #[serde(skip_serializing_if = "Option::is_none")]
24259    pub billing_details: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetails>,
24260    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
24261    #[serde(skip_serializing_if = "Option::is_none")]
24262    #[serde(with = "stripe_types::with_serde_json_opt")]
24263    pub blik: Option<miniserde::json::Value>,
24264    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
24265    #[serde(skip_serializing_if = "Option::is_none")]
24266    pub boleto: Option<ConfirmPaymentIntentPaymentMethodDataBoleto>,
24267    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
24268    #[serde(skip_serializing_if = "Option::is_none")]
24269    #[serde(with = "stripe_types::with_serde_json_opt")]
24270    pub cashapp: Option<miniserde::json::Value>,
24271    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
24272    #[serde(skip_serializing_if = "Option::is_none")]
24273    #[serde(with = "stripe_types::with_serde_json_opt")]
24274    pub crypto: Option<miniserde::json::Value>,
24275    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
24276    #[serde(skip_serializing_if = "Option::is_none")]
24277    #[serde(with = "stripe_types::with_serde_json_opt")]
24278    pub customer_balance: Option<miniserde::json::Value>,
24279    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
24280    #[serde(skip_serializing_if = "Option::is_none")]
24281    pub eps: Option<ConfirmPaymentIntentPaymentMethodDataEps>,
24282    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
24283    #[serde(skip_serializing_if = "Option::is_none")]
24284    pub fpx: Option<ConfirmPaymentIntentPaymentMethodDataFpx>,
24285    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
24286    #[serde(skip_serializing_if = "Option::is_none")]
24287    #[serde(with = "stripe_types::with_serde_json_opt")]
24288    pub giropay: Option<miniserde::json::Value>,
24289    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
24290    #[serde(skip_serializing_if = "Option::is_none")]
24291    #[serde(with = "stripe_types::with_serde_json_opt")]
24292    pub grabpay: Option<miniserde::json::Value>,
24293    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
24294    #[serde(skip_serializing_if = "Option::is_none")]
24295    pub ideal: Option<ConfirmPaymentIntentPaymentMethodDataIdeal>,
24296    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
24297    #[serde(skip_serializing_if = "Option::is_none")]
24298    #[serde(with = "stripe_types::with_serde_json_opt")]
24299    pub interac_present: Option<miniserde::json::Value>,
24300    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
24301    #[serde(skip_serializing_if = "Option::is_none")]
24302    #[serde(with = "stripe_types::with_serde_json_opt")]
24303    pub kakao_pay: Option<miniserde::json::Value>,
24304    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
24305    #[serde(skip_serializing_if = "Option::is_none")]
24306    pub klarna: Option<ConfirmPaymentIntentPaymentMethodDataKlarna>,
24307    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
24308    #[serde(skip_serializing_if = "Option::is_none")]
24309    #[serde(with = "stripe_types::with_serde_json_opt")]
24310    pub konbini: Option<miniserde::json::Value>,
24311    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
24312    #[serde(skip_serializing_if = "Option::is_none")]
24313    #[serde(with = "stripe_types::with_serde_json_opt")]
24314    pub kr_card: Option<miniserde::json::Value>,
24315    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
24316    #[serde(skip_serializing_if = "Option::is_none")]
24317    #[serde(with = "stripe_types::with_serde_json_opt")]
24318    pub link: Option<miniserde::json::Value>,
24319    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
24320    #[serde(skip_serializing_if = "Option::is_none")]
24321    #[serde(with = "stripe_types::with_serde_json_opt")]
24322    pub mb_way: Option<miniserde::json::Value>,
24323    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
24324    /// This can be useful for storing additional information about the object in a structured format.
24325    /// Individual keys can be unset by posting an empty value to them.
24326    /// All keys can be unset by posting an empty value to `metadata`.
24327    #[serde(skip_serializing_if = "Option::is_none")]
24328    pub metadata: Option<std::collections::HashMap<String, String>>,
24329    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
24330    #[serde(skip_serializing_if = "Option::is_none")]
24331    #[serde(with = "stripe_types::with_serde_json_opt")]
24332    pub mobilepay: Option<miniserde::json::Value>,
24333    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
24334    #[serde(skip_serializing_if = "Option::is_none")]
24335    #[serde(with = "stripe_types::with_serde_json_opt")]
24336    pub multibanco: Option<miniserde::json::Value>,
24337    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
24338    #[serde(skip_serializing_if = "Option::is_none")]
24339    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodDataNaverPay>,
24340    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
24341    #[serde(skip_serializing_if = "Option::is_none")]
24342    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataNzBankAccount>,
24343    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
24344    #[serde(skip_serializing_if = "Option::is_none")]
24345    #[serde(with = "stripe_types::with_serde_json_opt")]
24346    pub oxxo: Option<miniserde::json::Value>,
24347    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
24348    #[serde(skip_serializing_if = "Option::is_none")]
24349    pub p24: Option<ConfirmPaymentIntentPaymentMethodDataP24>,
24350    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
24351    #[serde(skip_serializing_if = "Option::is_none")]
24352    #[serde(with = "stripe_types::with_serde_json_opt")]
24353    pub pay_by_bank: Option<miniserde::json::Value>,
24354    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
24355    #[serde(skip_serializing_if = "Option::is_none")]
24356    #[serde(with = "stripe_types::with_serde_json_opt")]
24357    pub payco: Option<miniserde::json::Value>,
24358    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
24359    #[serde(skip_serializing_if = "Option::is_none")]
24360    #[serde(with = "stripe_types::with_serde_json_opt")]
24361    pub paynow: Option<miniserde::json::Value>,
24362    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
24363    #[serde(skip_serializing_if = "Option::is_none")]
24364    #[serde(with = "stripe_types::with_serde_json_opt")]
24365    pub paypal: Option<miniserde::json::Value>,
24366    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
24367    #[serde(skip_serializing_if = "Option::is_none")]
24368    #[serde(with = "stripe_types::with_serde_json_opt")]
24369    pub pix: Option<miniserde::json::Value>,
24370    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
24371    #[serde(skip_serializing_if = "Option::is_none")]
24372    #[serde(with = "stripe_types::with_serde_json_opt")]
24373    pub promptpay: Option<miniserde::json::Value>,
24374    /// Options to configure Radar.
24375    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
24376    #[serde(skip_serializing_if = "Option::is_none")]
24377    pub radar_options: Option<ConfirmPaymentIntentPaymentMethodDataRadarOptions>,
24378    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
24379    #[serde(skip_serializing_if = "Option::is_none")]
24380    #[serde(with = "stripe_types::with_serde_json_opt")]
24381    pub revolut_pay: Option<miniserde::json::Value>,
24382    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
24383    #[serde(skip_serializing_if = "Option::is_none")]
24384    #[serde(with = "stripe_types::with_serde_json_opt")]
24385    pub samsung_pay: Option<miniserde::json::Value>,
24386    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
24387    #[serde(skip_serializing_if = "Option::is_none")]
24388    #[serde(with = "stripe_types::with_serde_json_opt")]
24389    pub satispay: Option<miniserde::json::Value>,
24390    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
24391    #[serde(skip_serializing_if = "Option::is_none")]
24392    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodDataSepaDebit>,
24393    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
24394    #[serde(skip_serializing_if = "Option::is_none")]
24395    pub sofort: Option<ConfirmPaymentIntentPaymentMethodDataSofort>,
24396    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
24397    #[serde(skip_serializing_if = "Option::is_none")]
24398    #[serde(with = "stripe_types::with_serde_json_opt")]
24399    pub swish: Option<miniserde::json::Value>,
24400    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
24401    #[serde(skip_serializing_if = "Option::is_none")]
24402    #[serde(with = "stripe_types::with_serde_json_opt")]
24403    pub twint: Option<miniserde::json::Value>,
24404    /// The type of the PaymentMethod.
24405    /// An additional hash is included on the PaymentMethod with a name matching this value.
24406    /// It contains additional information specific to the PaymentMethod type.
24407    #[serde(rename = "type")]
24408    pub type_: ConfirmPaymentIntentPaymentMethodDataType,
24409    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
24410    #[serde(skip_serializing_if = "Option::is_none")]
24411    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccount>,
24412    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
24413    #[serde(skip_serializing_if = "Option::is_none")]
24414    #[serde(with = "stripe_types::with_serde_json_opt")]
24415    pub wechat_pay: Option<miniserde::json::Value>,
24416    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
24417    #[serde(skip_serializing_if = "Option::is_none")]
24418    #[serde(with = "stripe_types::with_serde_json_opt")]
24419    pub zip: Option<miniserde::json::Value>,
24420}
24421impl ConfirmPaymentIntentPaymentMethodData {
24422    pub fn new(type_: impl Into<ConfirmPaymentIntentPaymentMethodDataType>) -> Self {
24423        Self {
24424            acss_debit: None,
24425            affirm: None,
24426            afterpay_clearpay: None,
24427            alipay: None,
24428            allow_redisplay: None,
24429            alma: None,
24430            amazon_pay: None,
24431            au_becs_debit: None,
24432            bacs_debit: None,
24433            bancontact: None,
24434            billie: None,
24435            billing_details: None,
24436            blik: None,
24437            boleto: None,
24438            cashapp: None,
24439            crypto: None,
24440            customer_balance: None,
24441            eps: None,
24442            fpx: None,
24443            giropay: None,
24444            grabpay: None,
24445            ideal: None,
24446            interac_present: None,
24447            kakao_pay: None,
24448            klarna: None,
24449            konbini: None,
24450            kr_card: None,
24451            link: None,
24452            mb_way: None,
24453            metadata: None,
24454            mobilepay: None,
24455            multibanco: None,
24456            naver_pay: None,
24457            nz_bank_account: None,
24458            oxxo: None,
24459            p24: None,
24460            pay_by_bank: None,
24461            payco: None,
24462            paynow: None,
24463            paypal: None,
24464            pix: None,
24465            promptpay: None,
24466            radar_options: None,
24467            revolut_pay: None,
24468            samsung_pay: None,
24469            satispay: None,
24470            sepa_debit: None,
24471            sofort: None,
24472            swish: None,
24473            twint: None,
24474            type_: type_.into(),
24475            us_bank_account: None,
24476            wechat_pay: None,
24477            zip: None,
24478        }
24479    }
24480}
24481/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
24482/// 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.
24483/// The field defaults to `unspecified`.
24484#[derive(Copy, Clone, Eq, PartialEq)]
24485pub enum ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24486    Always,
24487    Limited,
24488    Unspecified,
24489}
24490impl ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24491    pub fn as_str(self) -> &'static str {
24492        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
24493        match self {
24494            Always => "always",
24495            Limited => "limited",
24496            Unspecified => "unspecified",
24497        }
24498    }
24499}
24500
24501impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24502    type Err = stripe_types::StripeParseError;
24503    fn from_str(s: &str) -> Result<Self, Self::Err> {
24504        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
24505        match s {
24506            "always" => Ok(Always),
24507            "limited" => Ok(Limited),
24508            "unspecified" => Ok(Unspecified),
24509            _ => Err(stripe_types::StripeParseError),
24510        }
24511    }
24512}
24513impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24514    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24515        f.write_str(self.as_str())
24516    }
24517}
24518
24519impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24520    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24521        f.write_str(self.as_str())
24522    }
24523}
24524impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24525    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24526    where
24527        S: serde::Serializer,
24528    {
24529        serializer.serialize_str(self.as_str())
24530    }
24531}
24532#[cfg(feature = "deserialize")]
24533impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24534    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24535        use std::str::FromStr;
24536        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24537        Self::from_str(&s).map_err(|_| {
24538            serde::de::Error::custom(
24539                "Unknown value for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay",
24540            )
24541        })
24542    }
24543}
24544/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
24545#[derive(Clone, Debug, serde::Serialize)]
24546pub struct ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
24547    /// The account number for the bank account.
24548    pub account_number: String,
24549    /// Bank-State-Branch number of the bank account.
24550    pub bsb_number: String,
24551}
24552impl ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
24553    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
24554        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
24555    }
24556}
24557/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
24558#[derive(Clone, Debug, serde::Serialize)]
24559pub struct ConfirmPaymentIntentPaymentMethodDataBacsDebit {
24560    /// Account number of the bank account that the funds will be debited from.
24561    #[serde(skip_serializing_if = "Option::is_none")]
24562    pub account_number: Option<String>,
24563    /// Sort code of the bank account. (e.g., `10-20-30`)
24564    #[serde(skip_serializing_if = "Option::is_none")]
24565    pub sort_code: Option<String>,
24566}
24567impl ConfirmPaymentIntentPaymentMethodDataBacsDebit {
24568    pub fn new() -> Self {
24569        Self { account_number: None, sort_code: None }
24570    }
24571}
24572impl Default for ConfirmPaymentIntentPaymentMethodDataBacsDebit {
24573    fn default() -> Self {
24574        Self::new()
24575    }
24576}
24577/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
24578#[derive(Clone, Debug, serde::Serialize)]
24579pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetails {
24580    /// Billing address.
24581    #[serde(skip_serializing_if = "Option::is_none")]
24582    pub address: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress>,
24583    /// Email address.
24584    #[serde(skip_serializing_if = "Option::is_none")]
24585    pub email: Option<String>,
24586    /// Full name.
24587    #[serde(skip_serializing_if = "Option::is_none")]
24588    pub name: Option<String>,
24589    /// Billing phone number (including extension).
24590    #[serde(skip_serializing_if = "Option::is_none")]
24591    pub phone: Option<String>,
24592    /// Taxpayer identification number.
24593    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
24594    #[serde(skip_serializing_if = "Option::is_none")]
24595    pub tax_id: Option<String>,
24596}
24597impl ConfirmPaymentIntentPaymentMethodDataBillingDetails {
24598    pub fn new() -> Self {
24599        Self { address: None, email: None, name: None, phone: None, tax_id: None }
24600    }
24601}
24602impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetails {
24603    fn default() -> Self {
24604        Self::new()
24605    }
24606}
24607/// Billing address.
24608#[derive(Clone, Debug, serde::Serialize)]
24609pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
24610    /// City, district, suburb, town, or village.
24611    #[serde(skip_serializing_if = "Option::is_none")]
24612    pub city: Option<String>,
24613    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
24614    #[serde(skip_serializing_if = "Option::is_none")]
24615    pub country: Option<String>,
24616    /// Address line 1, such as the street, PO Box, or company name.
24617    #[serde(skip_serializing_if = "Option::is_none")]
24618    pub line1: Option<String>,
24619    /// Address line 2, such as the apartment, suite, unit, or building.
24620    #[serde(skip_serializing_if = "Option::is_none")]
24621    pub line2: Option<String>,
24622    /// ZIP or postal code.
24623    #[serde(skip_serializing_if = "Option::is_none")]
24624    pub postal_code: Option<String>,
24625    /// State, county, province, or region.
24626    #[serde(skip_serializing_if = "Option::is_none")]
24627    pub state: Option<String>,
24628}
24629impl ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
24630    pub fn new() -> Self {
24631        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
24632    }
24633}
24634impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
24635    fn default() -> Self {
24636        Self::new()
24637    }
24638}
24639/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
24640#[derive(Clone, Debug, serde::Serialize)]
24641pub struct ConfirmPaymentIntentPaymentMethodDataBoleto {
24642    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
24643    pub tax_id: String,
24644}
24645impl ConfirmPaymentIntentPaymentMethodDataBoleto {
24646    pub fn new(tax_id: impl Into<String>) -> Self {
24647        Self { tax_id: tax_id.into() }
24648    }
24649}
24650/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
24651#[derive(Clone, Debug, serde::Serialize)]
24652pub struct ConfirmPaymentIntentPaymentMethodDataEps {
24653    /// The customer's bank.
24654    #[serde(skip_serializing_if = "Option::is_none")]
24655    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataEpsBank>,
24656}
24657impl ConfirmPaymentIntentPaymentMethodDataEps {
24658    pub fn new() -> Self {
24659        Self { bank: None }
24660    }
24661}
24662impl Default for ConfirmPaymentIntentPaymentMethodDataEps {
24663    fn default() -> Self {
24664        Self::new()
24665    }
24666}
24667/// The customer's bank.
24668#[derive(Clone, Eq, PartialEq)]
24669#[non_exhaustive]
24670pub enum ConfirmPaymentIntentPaymentMethodDataEpsBank {
24671    ArzteUndApothekerBank,
24672    AustrianAnadiBankAg,
24673    BankAustria,
24674    BankhausCarlSpangler,
24675    BankhausSchelhammerUndSchatteraAg,
24676    BawagPskAg,
24677    BksBankAg,
24678    BrullKallmusBankAg,
24679    BtvVierLanderBank,
24680    CapitalBankGraweGruppeAg,
24681    DeutscheBankAg,
24682    Dolomitenbank,
24683    EasybankAg,
24684    ErsteBankUndSparkassen,
24685    HypoAlpeadriabankInternationalAg,
24686    HypoBankBurgenlandAktiengesellschaft,
24687    HypoNoeLbFurNiederosterreichUWien,
24688    HypoOberosterreichSalzburgSteiermark,
24689    HypoTirolBankAg,
24690    HypoVorarlbergBankAg,
24691    MarchfelderBank,
24692    OberbankAg,
24693    RaiffeisenBankengruppeOsterreich,
24694    SchoellerbankAg,
24695    SpardaBankWien,
24696    VolksbankGruppe,
24697    VolkskreditbankAg,
24698    VrBankBraunau,
24699    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24700    Unknown(String),
24701}
24702impl ConfirmPaymentIntentPaymentMethodDataEpsBank {
24703    pub fn as_str(&self) -> &str {
24704        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
24705        match self {
24706            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
24707            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
24708            BankAustria => "bank_austria",
24709            BankhausCarlSpangler => "bankhaus_carl_spangler",
24710            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
24711            BawagPskAg => "bawag_psk_ag",
24712            BksBankAg => "bks_bank_ag",
24713            BrullKallmusBankAg => "brull_kallmus_bank_ag",
24714            BtvVierLanderBank => "btv_vier_lander_bank",
24715            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
24716            DeutscheBankAg => "deutsche_bank_ag",
24717            Dolomitenbank => "dolomitenbank",
24718            EasybankAg => "easybank_ag",
24719            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
24720            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
24721            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
24722            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
24723            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
24724            HypoTirolBankAg => "hypo_tirol_bank_ag",
24725            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
24726            MarchfelderBank => "marchfelder_bank",
24727            OberbankAg => "oberbank_ag",
24728            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
24729            SchoellerbankAg => "schoellerbank_ag",
24730            SpardaBankWien => "sparda_bank_wien",
24731            VolksbankGruppe => "volksbank_gruppe",
24732            VolkskreditbankAg => "volkskreditbank_ag",
24733            VrBankBraunau => "vr_bank_braunau",
24734            Unknown(v) => v,
24735        }
24736    }
24737}
24738
24739impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24740    type Err = std::convert::Infallible;
24741    fn from_str(s: &str) -> Result<Self, Self::Err> {
24742        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
24743        match s {
24744            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
24745            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
24746            "bank_austria" => Ok(BankAustria),
24747            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
24748            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
24749            "bawag_psk_ag" => Ok(BawagPskAg),
24750            "bks_bank_ag" => Ok(BksBankAg),
24751            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
24752            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
24753            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
24754            "deutsche_bank_ag" => Ok(DeutscheBankAg),
24755            "dolomitenbank" => Ok(Dolomitenbank),
24756            "easybank_ag" => Ok(EasybankAg),
24757            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
24758            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
24759            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
24760            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
24761            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
24762            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
24763            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
24764            "marchfelder_bank" => Ok(MarchfelderBank),
24765            "oberbank_ag" => Ok(OberbankAg),
24766            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
24767            "schoellerbank_ag" => Ok(SchoellerbankAg),
24768            "sparda_bank_wien" => Ok(SpardaBankWien),
24769            "volksbank_gruppe" => Ok(VolksbankGruppe),
24770            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
24771            "vr_bank_braunau" => Ok(VrBankBraunau),
24772            v => Ok(Unknown(v.to_owned())),
24773        }
24774    }
24775}
24776impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24777    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24778        f.write_str(self.as_str())
24779    }
24780}
24781
24782impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24784        f.write_str(self.as_str())
24785    }
24786}
24787impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24788    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24789    where
24790        S: serde::Serializer,
24791    {
24792        serializer.serialize_str(self.as_str())
24793    }
24794}
24795#[cfg(feature = "deserialize")]
24796impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24797    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24798        use std::str::FromStr;
24799        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24800        Ok(Self::from_str(&s).unwrap())
24801    }
24802}
24803/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
24804#[derive(Clone, Debug, serde::Serialize)]
24805pub struct ConfirmPaymentIntentPaymentMethodDataFpx {
24806    /// Account holder type for FPX transaction
24807    #[serde(skip_serializing_if = "Option::is_none")]
24808    pub account_holder_type: Option<ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType>,
24809    /// The customer's bank.
24810    pub bank: ConfirmPaymentIntentPaymentMethodDataFpxBank,
24811}
24812impl ConfirmPaymentIntentPaymentMethodDataFpx {
24813    pub fn new(bank: impl Into<ConfirmPaymentIntentPaymentMethodDataFpxBank>) -> Self {
24814        Self { account_holder_type: None, bank: bank.into() }
24815    }
24816}
24817/// Account holder type for FPX transaction
24818#[derive(Copy, Clone, Eq, PartialEq)]
24819pub enum ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24820    Company,
24821    Individual,
24822}
24823impl ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24824    pub fn as_str(self) -> &'static str {
24825        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
24826        match self {
24827            Company => "company",
24828            Individual => "individual",
24829        }
24830    }
24831}
24832
24833impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24834    type Err = stripe_types::StripeParseError;
24835    fn from_str(s: &str) -> Result<Self, Self::Err> {
24836        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
24837        match s {
24838            "company" => Ok(Company),
24839            "individual" => Ok(Individual),
24840            _ => Err(stripe_types::StripeParseError),
24841        }
24842    }
24843}
24844impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24846        f.write_str(self.as_str())
24847    }
24848}
24849
24850impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24852        f.write_str(self.as_str())
24853    }
24854}
24855impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24856    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24857    where
24858        S: serde::Serializer,
24859    {
24860        serializer.serialize_str(self.as_str())
24861    }
24862}
24863#[cfg(feature = "deserialize")]
24864impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24865    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24866        use std::str::FromStr;
24867        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24868        Self::from_str(&s).map_err(|_| {
24869            serde::de::Error::custom(
24870                "Unknown value for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType",
24871            )
24872        })
24873    }
24874}
24875/// The customer's bank.
24876#[derive(Clone, Eq, PartialEq)]
24877#[non_exhaustive]
24878pub enum ConfirmPaymentIntentPaymentMethodDataFpxBank {
24879    AffinBank,
24880    Agrobank,
24881    AllianceBank,
24882    Ambank,
24883    BankIslam,
24884    BankMuamalat,
24885    BankOfChina,
24886    BankRakyat,
24887    Bsn,
24888    Cimb,
24889    DeutscheBank,
24890    HongLeongBank,
24891    Hsbc,
24892    Kfh,
24893    Maybank2e,
24894    Maybank2u,
24895    Ocbc,
24896    PbEnterprise,
24897    PublicBank,
24898    Rhb,
24899    StandardChartered,
24900    Uob,
24901    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24902    Unknown(String),
24903}
24904impl ConfirmPaymentIntentPaymentMethodDataFpxBank {
24905    pub fn as_str(&self) -> &str {
24906        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
24907        match self {
24908            AffinBank => "affin_bank",
24909            Agrobank => "agrobank",
24910            AllianceBank => "alliance_bank",
24911            Ambank => "ambank",
24912            BankIslam => "bank_islam",
24913            BankMuamalat => "bank_muamalat",
24914            BankOfChina => "bank_of_china",
24915            BankRakyat => "bank_rakyat",
24916            Bsn => "bsn",
24917            Cimb => "cimb",
24918            DeutscheBank => "deutsche_bank",
24919            HongLeongBank => "hong_leong_bank",
24920            Hsbc => "hsbc",
24921            Kfh => "kfh",
24922            Maybank2e => "maybank2e",
24923            Maybank2u => "maybank2u",
24924            Ocbc => "ocbc",
24925            PbEnterprise => "pb_enterprise",
24926            PublicBank => "public_bank",
24927            Rhb => "rhb",
24928            StandardChartered => "standard_chartered",
24929            Uob => "uob",
24930            Unknown(v) => v,
24931        }
24932    }
24933}
24934
24935impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24936    type Err = std::convert::Infallible;
24937    fn from_str(s: &str) -> Result<Self, Self::Err> {
24938        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
24939        match s {
24940            "affin_bank" => Ok(AffinBank),
24941            "agrobank" => Ok(Agrobank),
24942            "alliance_bank" => Ok(AllianceBank),
24943            "ambank" => Ok(Ambank),
24944            "bank_islam" => Ok(BankIslam),
24945            "bank_muamalat" => Ok(BankMuamalat),
24946            "bank_of_china" => Ok(BankOfChina),
24947            "bank_rakyat" => Ok(BankRakyat),
24948            "bsn" => Ok(Bsn),
24949            "cimb" => Ok(Cimb),
24950            "deutsche_bank" => Ok(DeutscheBank),
24951            "hong_leong_bank" => Ok(HongLeongBank),
24952            "hsbc" => Ok(Hsbc),
24953            "kfh" => Ok(Kfh),
24954            "maybank2e" => Ok(Maybank2e),
24955            "maybank2u" => Ok(Maybank2u),
24956            "ocbc" => Ok(Ocbc),
24957            "pb_enterprise" => Ok(PbEnterprise),
24958            "public_bank" => Ok(PublicBank),
24959            "rhb" => Ok(Rhb),
24960            "standard_chartered" => Ok(StandardChartered),
24961            "uob" => Ok(Uob),
24962            v => Ok(Unknown(v.to_owned())),
24963        }
24964    }
24965}
24966impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24967    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24968        f.write_str(self.as_str())
24969    }
24970}
24971
24972impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24973    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24974        f.write_str(self.as_str())
24975    }
24976}
24977impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24978    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24979    where
24980        S: serde::Serializer,
24981    {
24982        serializer.serialize_str(self.as_str())
24983    }
24984}
24985#[cfg(feature = "deserialize")]
24986impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24987    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24988        use std::str::FromStr;
24989        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24990        Ok(Self::from_str(&s).unwrap())
24991    }
24992}
24993/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
24994#[derive(Clone, Debug, serde::Serialize)]
24995pub struct ConfirmPaymentIntentPaymentMethodDataIdeal {
24996    /// The customer's bank.
24997    /// Only use this parameter for existing customers.
24998    /// Don't use it for new customers.
24999    #[serde(skip_serializing_if = "Option::is_none")]
25000    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataIdealBank>,
25001}
25002impl ConfirmPaymentIntentPaymentMethodDataIdeal {
25003    pub fn new() -> Self {
25004        Self { bank: None }
25005    }
25006}
25007impl Default for ConfirmPaymentIntentPaymentMethodDataIdeal {
25008    fn default() -> Self {
25009        Self::new()
25010    }
25011}
25012/// The customer's bank.
25013/// Only use this parameter for existing customers.
25014/// Don't use it for new customers.
25015#[derive(Clone, Eq, PartialEq)]
25016#[non_exhaustive]
25017pub enum ConfirmPaymentIntentPaymentMethodDataIdealBank {
25018    AbnAmro,
25019    AsnBank,
25020    Bunq,
25021    Buut,
25022    Finom,
25023    Handelsbanken,
25024    Ing,
25025    Knab,
25026    Moneyou,
25027    N26,
25028    Nn,
25029    Rabobank,
25030    Regiobank,
25031    Revolut,
25032    SnsBank,
25033    TriodosBank,
25034    VanLanschot,
25035    Yoursafe,
25036    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25037    Unknown(String),
25038}
25039impl ConfirmPaymentIntentPaymentMethodDataIdealBank {
25040    pub fn as_str(&self) -> &str {
25041        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
25042        match self {
25043            AbnAmro => "abn_amro",
25044            AsnBank => "asn_bank",
25045            Bunq => "bunq",
25046            Buut => "buut",
25047            Finom => "finom",
25048            Handelsbanken => "handelsbanken",
25049            Ing => "ing",
25050            Knab => "knab",
25051            Moneyou => "moneyou",
25052            N26 => "n26",
25053            Nn => "nn",
25054            Rabobank => "rabobank",
25055            Regiobank => "regiobank",
25056            Revolut => "revolut",
25057            SnsBank => "sns_bank",
25058            TriodosBank => "triodos_bank",
25059            VanLanschot => "van_lanschot",
25060            Yoursafe => "yoursafe",
25061            Unknown(v) => v,
25062        }
25063    }
25064}
25065
25066impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataIdealBank {
25067    type Err = std::convert::Infallible;
25068    fn from_str(s: &str) -> Result<Self, Self::Err> {
25069        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
25070        match s {
25071            "abn_amro" => Ok(AbnAmro),
25072            "asn_bank" => Ok(AsnBank),
25073            "bunq" => Ok(Bunq),
25074            "buut" => Ok(Buut),
25075            "finom" => Ok(Finom),
25076            "handelsbanken" => Ok(Handelsbanken),
25077            "ing" => Ok(Ing),
25078            "knab" => Ok(Knab),
25079            "moneyou" => Ok(Moneyou),
25080            "n26" => Ok(N26),
25081            "nn" => Ok(Nn),
25082            "rabobank" => Ok(Rabobank),
25083            "regiobank" => Ok(Regiobank),
25084            "revolut" => Ok(Revolut),
25085            "sns_bank" => Ok(SnsBank),
25086            "triodos_bank" => Ok(TriodosBank),
25087            "van_lanschot" => Ok(VanLanschot),
25088            "yoursafe" => Ok(Yoursafe),
25089            v => Ok(Unknown(v.to_owned())),
25090        }
25091    }
25092}
25093impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataIdealBank {
25094    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25095        f.write_str(self.as_str())
25096    }
25097}
25098
25099impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataIdealBank {
25100    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25101        f.write_str(self.as_str())
25102    }
25103}
25104impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataIdealBank {
25105    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25106    where
25107        S: serde::Serializer,
25108    {
25109        serializer.serialize_str(self.as_str())
25110    }
25111}
25112#[cfg(feature = "deserialize")]
25113impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataIdealBank {
25114    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25115        use std::str::FromStr;
25116        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25117        Ok(Self::from_str(&s).unwrap())
25118    }
25119}
25120/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
25121#[derive(Copy, Clone, Debug, serde::Serialize)]
25122pub struct ConfirmPaymentIntentPaymentMethodDataKlarna {
25123    /// Customer's date of birth
25124    #[serde(skip_serializing_if = "Option::is_none")]
25125    pub dob: Option<DateOfBirth>,
25126}
25127impl ConfirmPaymentIntentPaymentMethodDataKlarna {
25128    pub fn new() -> Self {
25129        Self { dob: None }
25130    }
25131}
25132impl Default for ConfirmPaymentIntentPaymentMethodDataKlarna {
25133    fn default() -> Self {
25134        Self::new()
25135    }
25136}
25137/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
25138#[derive(Copy, Clone, Debug, serde::Serialize)]
25139pub struct ConfirmPaymentIntentPaymentMethodDataNaverPay {
25140    /// Whether to use Naver Pay points or a card to fund this transaction.
25141    /// If not provided, this defaults to `card`.
25142    #[serde(skip_serializing_if = "Option::is_none")]
25143    pub funding: Option<ConfirmPaymentIntentPaymentMethodDataNaverPayFunding>,
25144}
25145impl ConfirmPaymentIntentPaymentMethodDataNaverPay {
25146    pub fn new() -> Self {
25147        Self { funding: None }
25148    }
25149}
25150impl Default for ConfirmPaymentIntentPaymentMethodDataNaverPay {
25151    fn default() -> Self {
25152        Self::new()
25153    }
25154}
25155/// Whether to use Naver Pay points or a card to fund this transaction.
25156/// If not provided, this defaults to `card`.
25157#[derive(Copy, Clone, Eq, PartialEq)]
25158pub enum ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25159    Card,
25160    Points,
25161}
25162impl ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25163    pub fn as_str(self) -> &'static str {
25164        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
25165        match self {
25166            Card => "card",
25167            Points => "points",
25168        }
25169    }
25170}
25171
25172impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25173    type Err = stripe_types::StripeParseError;
25174    fn from_str(s: &str) -> Result<Self, Self::Err> {
25175        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
25176        match s {
25177            "card" => Ok(Card),
25178            "points" => Ok(Points),
25179            _ => Err(stripe_types::StripeParseError),
25180        }
25181    }
25182}
25183impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25184    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25185        f.write_str(self.as_str())
25186    }
25187}
25188
25189impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25190    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25191        f.write_str(self.as_str())
25192    }
25193}
25194impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25195    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25196    where
25197        S: serde::Serializer,
25198    {
25199        serializer.serialize_str(self.as_str())
25200    }
25201}
25202#[cfg(feature = "deserialize")]
25203impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25204    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25205        use std::str::FromStr;
25206        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25207        Self::from_str(&s).map_err(|_| {
25208            serde::de::Error::custom(
25209                "Unknown value for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding",
25210            )
25211        })
25212    }
25213}
25214/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
25215#[derive(Clone, Debug, serde::Serialize)]
25216pub struct ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
25217    /// The name on the bank account.
25218    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
25219    #[serde(skip_serializing_if = "Option::is_none")]
25220    pub account_holder_name: Option<String>,
25221    /// The account number for the bank account.
25222    pub account_number: String,
25223    /// The numeric code for the bank account's bank.
25224    pub bank_code: String,
25225    /// The numeric code for the bank account's bank branch.
25226    pub branch_code: String,
25227    #[serde(skip_serializing_if = "Option::is_none")]
25228    pub reference: Option<String>,
25229    /// The suffix of the bank account number.
25230    pub suffix: String,
25231}
25232impl ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
25233    pub fn new(
25234        account_number: impl Into<String>,
25235        bank_code: impl Into<String>,
25236        branch_code: impl Into<String>,
25237        suffix: impl Into<String>,
25238    ) -> Self {
25239        Self {
25240            account_holder_name: None,
25241            account_number: account_number.into(),
25242            bank_code: bank_code.into(),
25243            branch_code: branch_code.into(),
25244            reference: None,
25245            suffix: suffix.into(),
25246        }
25247    }
25248}
25249/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
25250#[derive(Clone, Debug, serde::Serialize)]
25251pub struct ConfirmPaymentIntentPaymentMethodDataP24 {
25252    /// The customer's bank.
25253    #[serde(skip_serializing_if = "Option::is_none")]
25254    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataP24Bank>,
25255}
25256impl ConfirmPaymentIntentPaymentMethodDataP24 {
25257    pub fn new() -> Self {
25258        Self { bank: None }
25259    }
25260}
25261impl Default for ConfirmPaymentIntentPaymentMethodDataP24 {
25262    fn default() -> Self {
25263        Self::new()
25264    }
25265}
25266/// The customer's bank.
25267#[derive(Clone, Eq, PartialEq)]
25268#[non_exhaustive]
25269pub enum ConfirmPaymentIntentPaymentMethodDataP24Bank {
25270    AliorBank,
25271    BankMillennium,
25272    BankNowyBfgSa,
25273    BankPekaoSa,
25274    BankiSpbdzielcze,
25275    Blik,
25276    BnpParibas,
25277    Boz,
25278    CitiHandlowy,
25279    CreditAgricole,
25280    Envelobank,
25281    EtransferPocztowy24,
25282    GetinBank,
25283    Ideabank,
25284    Ing,
25285    Inteligo,
25286    MbankMtransfer,
25287    NestPrzelew,
25288    NoblePay,
25289    PbacZIpko,
25290    PlusBank,
25291    SantanderPrzelew24,
25292    TmobileUsbugiBankowe,
25293    ToyotaBank,
25294    Velobank,
25295    VolkswagenBank,
25296    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25297    Unknown(String),
25298}
25299impl ConfirmPaymentIntentPaymentMethodDataP24Bank {
25300    pub fn as_str(&self) -> &str {
25301        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
25302        match self {
25303            AliorBank => "alior_bank",
25304            BankMillennium => "bank_millennium",
25305            BankNowyBfgSa => "bank_nowy_bfg_sa",
25306            BankPekaoSa => "bank_pekao_sa",
25307            BankiSpbdzielcze => "banki_spbdzielcze",
25308            Blik => "blik",
25309            BnpParibas => "bnp_paribas",
25310            Boz => "boz",
25311            CitiHandlowy => "citi_handlowy",
25312            CreditAgricole => "credit_agricole",
25313            Envelobank => "envelobank",
25314            EtransferPocztowy24 => "etransfer_pocztowy24",
25315            GetinBank => "getin_bank",
25316            Ideabank => "ideabank",
25317            Ing => "ing",
25318            Inteligo => "inteligo",
25319            MbankMtransfer => "mbank_mtransfer",
25320            NestPrzelew => "nest_przelew",
25321            NoblePay => "noble_pay",
25322            PbacZIpko => "pbac_z_ipko",
25323            PlusBank => "plus_bank",
25324            SantanderPrzelew24 => "santander_przelew24",
25325            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
25326            ToyotaBank => "toyota_bank",
25327            Velobank => "velobank",
25328            VolkswagenBank => "volkswagen_bank",
25329            Unknown(v) => v,
25330        }
25331    }
25332}
25333
25334impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25335    type Err = std::convert::Infallible;
25336    fn from_str(s: &str) -> Result<Self, Self::Err> {
25337        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
25338        match s {
25339            "alior_bank" => Ok(AliorBank),
25340            "bank_millennium" => Ok(BankMillennium),
25341            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
25342            "bank_pekao_sa" => Ok(BankPekaoSa),
25343            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
25344            "blik" => Ok(Blik),
25345            "bnp_paribas" => Ok(BnpParibas),
25346            "boz" => Ok(Boz),
25347            "citi_handlowy" => Ok(CitiHandlowy),
25348            "credit_agricole" => Ok(CreditAgricole),
25349            "envelobank" => Ok(Envelobank),
25350            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
25351            "getin_bank" => Ok(GetinBank),
25352            "ideabank" => Ok(Ideabank),
25353            "ing" => Ok(Ing),
25354            "inteligo" => Ok(Inteligo),
25355            "mbank_mtransfer" => Ok(MbankMtransfer),
25356            "nest_przelew" => Ok(NestPrzelew),
25357            "noble_pay" => Ok(NoblePay),
25358            "pbac_z_ipko" => Ok(PbacZIpko),
25359            "plus_bank" => Ok(PlusBank),
25360            "santander_przelew24" => Ok(SantanderPrzelew24),
25361            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
25362            "toyota_bank" => Ok(ToyotaBank),
25363            "velobank" => Ok(Velobank),
25364            "volkswagen_bank" => Ok(VolkswagenBank),
25365            v => Ok(Unknown(v.to_owned())),
25366        }
25367    }
25368}
25369impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25370    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25371        f.write_str(self.as_str())
25372    }
25373}
25374
25375impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25376    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25377        f.write_str(self.as_str())
25378    }
25379}
25380impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25381    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25382    where
25383        S: serde::Serializer,
25384    {
25385        serializer.serialize_str(self.as_str())
25386    }
25387}
25388#[cfg(feature = "deserialize")]
25389impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25390    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25391        use std::str::FromStr;
25392        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25393        Ok(Self::from_str(&s).unwrap())
25394    }
25395}
25396/// Options to configure Radar.
25397/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
25398#[derive(Clone, Debug, serde::Serialize)]
25399pub struct ConfirmPaymentIntentPaymentMethodDataRadarOptions {
25400    /// 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.
25401    #[serde(skip_serializing_if = "Option::is_none")]
25402    pub session: Option<String>,
25403}
25404impl ConfirmPaymentIntentPaymentMethodDataRadarOptions {
25405    pub fn new() -> Self {
25406        Self { session: None }
25407    }
25408}
25409impl Default for ConfirmPaymentIntentPaymentMethodDataRadarOptions {
25410    fn default() -> Self {
25411        Self::new()
25412    }
25413}
25414/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
25415#[derive(Clone, Debug, serde::Serialize)]
25416pub struct ConfirmPaymentIntentPaymentMethodDataSepaDebit {
25417    /// IBAN of the bank account.
25418    pub iban: String,
25419}
25420impl ConfirmPaymentIntentPaymentMethodDataSepaDebit {
25421    pub fn new(iban: impl Into<String>) -> Self {
25422        Self { iban: iban.into() }
25423    }
25424}
25425/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
25426#[derive(Copy, Clone, Debug, serde::Serialize)]
25427pub struct ConfirmPaymentIntentPaymentMethodDataSofort {
25428    /// Two-letter ISO code representing the country the bank account is located in.
25429    pub country: ConfirmPaymentIntentPaymentMethodDataSofortCountry,
25430}
25431impl ConfirmPaymentIntentPaymentMethodDataSofort {
25432    pub fn new(country: impl Into<ConfirmPaymentIntentPaymentMethodDataSofortCountry>) -> Self {
25433        Self { country: country.into() }
25434    }
25435}
25436/// Two-letter ISO code representing the country the bank account is located in.
25437#[derive(Copy, Clone, Eq, PartialEq)]
25438pub enum ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25439    At,
25440    Be,
25441    De,
25442    Es,
25443    It,
25444    Nl,
25445}
25446impl ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25447    pub fn as_str(self) -> &'static str {
25448        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
25449        match self {
25450            At => "AT",
25451            Be => "BE",
25452            De => "DE",
25453            Es => "ES",
25454            It => "IT",
25455            Nl => "NL",
25456        }
25457    }
25458}
25459
25460impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25461    type Err = stripe_types::StripeParseError;
25462    fn from_str(s: &str) -> Result<Self, Self::Err> {
25463        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
25464        match s {
25465            "AT" => Ok(At),
25466            "BE" => Ok(Be),
25467            "DE" => Ok(De),
25468            "ES" => Ok(Es),
25469            "IT" => Ok(It),
25470            "NL" => Ok(Nl),
25471            _ => Err(stripe_types::StripeParseError),
25472        }
25473    }
25474}
25475impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25476    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25477        f.write_str(self.as_str())
25478    }
25479}
25480
25481impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25482    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25483        f.write_str(self.as_str())
25484    }
25485}
25486impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25487    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25488    where
25489        S: serde::Serializer,
25490    {
25491        serializer.serialize_str(self.as_str())
25492    }
25493}
25494#[cfg(feature = "deserialize")]
25495impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25496    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25497        use std::str::FromStr;
25498        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25499        Self::from_str(&s).map_err(|_| {
25500            serde::de::Error::custom(
25501                "Unknown value for ConfirmPaymentIntentPaymentMethodDataSofortCountry",
25502            )
25503        })
25504    }
25505}
25506/// The type of the PaymentMethod.
25507/// An additional hash is included on the PaymentMethod with a name matching this value.
25508/// It contains additional information specific to the PaymentMethod type.
25509#[derive(Clone, Eq, PartialEq)]
25510#[non_exhaustive]
25511pub enum ConfirmPaymentIntentPaymentMethodDataType {
25512    AcssDebit,
25513    Affirm,
25514    AfterpayClearpay,
25515    Alipay,
25516    Alma,
25517    AmazonPay,
25518    AuBecsDebit,
25519    BacsDebit,
25520    Bancontact,
25521    Billie,
25522    Blik,
25523    Boleto,
25524    Cashapp,
25525    Crypto,
25526    CustomerBalance,
25527    Eps,
25528    Fpx,
25529    Giropay,
25530    Grabpay,
25531    Ideal,
25532    KakaoPay,
25533    Klarna,
25534    Konbini,
25535    KrCard,
25536    Link,
25537    MbWay,
25538    Mobilepay,
25539    Multibanco,
25540    NaverPay,
25541    NzBankAccount,
25542    Oxxo,
25543    P24,
25544    PayByBank,
25545    Payco,
25546    Paynow,
25547    Paypal,
25548    Pix,
25549    Promptpay,
25550    RevolutPay,
25551    SamsungPay,
25552    Satispay,
25553    SepaDebit,
25554    Sofort,
25555    Swish,
25556    Twint,
25557    UsBankAccount,
25558    WechatPay,
25559    Zip,
25560    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25561    Unknown(String),
25562}
25563impl ConfirmPaymentIntentPaymentMethodDataType {
25564    pub fn as_str(&self) -> &str {
25565        use ConfirmPaymentIntentPaymentMethodDataType::*;
25566        match self {
25567            AcssDebit => "acss_debit",
25568            Affirm => "affirm",
25569            AfterpayClearpay => "afterpay_clearpay",
25570            Alipay => "alipay",
25571            Alma => "alma",
25572            AmazonPay => "amazon_pay",
25573            AuBecsDebit => "au_becs_debit",
25574            BacsDebit => "bacs_debit",
25575            Bancontact => "bancontact",
25576            Billie => "billie",
25577            Blik => "blik",
25578            Boleto => "boleto",
25579            Cashapp => "cashapp",
25580            Crypto => "crypto",
25581            CustomerBalance => "customer_balance",
25582            Eps => "eps",
25583            Fpx => "fpx",
25584            Giropay => "giropay",
25585            Grabpay => "grabpay",
25586            Ideal => "ideal",
25587            KakaoPay => "kakao_pay",
25588            Klarna => "klarna",
25589            Konbini => "konbini",
25590            KrCard => "kr_card",
25591            Link => "link",
25592            MbWay => "mb_way",
25593            Mobilepay => "mobilepay",
25594            Multibanco => "multibanco",
25595            NaverPay => "naver_pay",
25596            NzBankAccount => "nz_bank_account",
25597            Oxxo => "oxxo",
25598            P24 => "p24",
25599            PayByBank => "pay_by_bank",
25600            Payco => "payco",
25601            Paynow => "paynow",
25602            Paypal => "paypal",
25603            Pix => "pix",
25604            Promptpay => "promptpay",
25605            RevolutPay => "revolut_pay",
25606            SamsungPay => "samsung_pay",
25607            Satispay => "satispay",
25608            SepaDebit => "sepa_debit",
25609            Sofort => "sofort",
25610            Swish => "swish",
25611            Twint => "twint",
25612            UsBankAccount => "us_bank_account",
25613            WechatPay => "wechat_pay",
25614            Zip => "zip",
25615            Unknown(v) => v,
25616        }
25617    }
25618}
25619
25620impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataType {
25621    type Err = std::convert::Infallible;
25622    fn from_str(s: &str) -> Result<Self, Self::Err> {
25623        use ConfirmPaymentIntentPaymentMethodDataType::*;
25624        match s {
25625            "acss_debit" => Ok(AcssDebit),
25626            "affirm" => Ok(Affirm),
25627            "afterpay_clearpay" => Ok(AfterpayClearpay),
25628            "alipay" => Ok(Alipay),
25629            "alma" => Ok(Alma),
25630            "amazon_pay" => Ok(AmazonPay),
25631            "au_becs_debit" => Ok(AuBecsDebit),
25632            "bacs_debit" => Ok(BacsDebit),
25633            "bancontact" => Ok(Bancontact),
25634            "billie" => Ok(Billie),
25635            "blik" => Ok(Blik),
25636            "boleto" => Ok(Boleto),
25637            "cashapp" => Ok(Cashapp),
25638            "crypto" => Ok(Crypto),
25639            "customer_balance" => Ok(CustomerBalance),
25640            "eps" => Ok(Eps),
25641            "fpx" => Ok(Fpx),
25642            "giropay" => Ok(Giropay),
25643            "grabpay" => Ok(Grabpay),
25644            "ideal" => Ok(Ideal),
25645            "kakao_pay" => Ok(KakaoPay),
25646            "klarna" => Ok(Klarna),
25647            "konbini" => Ok(Konbini),
25648            "kr_card" => Ok(KrCard),
25649            "link" => Ok(Link),
25650            "mb_way" => Ok(MbWay),
25651            "mobilepay" => Ok(Mobilepay),
25652            "multibanco" => Ok(Multibanco),
25653            "naver_pay" => Ok(NaverPay),
25654            "nz_bank_account" => Ok(NzBankAccount),
25655            "oxxo" => Ok(Oxxo),
25656            "p24" => Ok(P24),
25657            "pay_by_bank" => Ok(PayByBank),
25658            "payco" => Ok(Payco),
25659            "paynow" => Ok(Paynow),
25660            "paypal" => Ok(Paypal),
25661            "pix" => Ok(Pix),
25662            "promptpay" => Ok(Promptpay),
25663            "revolut_pay" => Ok(RevolutPay),
25664            "samsung_pay" => Ok(SamsungPay),
25665            "satispay" => Ok(Satispay),
25666            "sepa_debit" => Ok(SepaDebit),
25667            "sofort" => Ok(Sofort),
25668            "swish" => Ok(Swish),
25669            "twint" => Ok(Twint),
25670            "us_bank_account" => Ok(UsBankAccount),
25671            "wechat_pay" => Ok(WechatPay),
25672            "zip" => Ok(Zip),
25673            v => Ok(Unknown(v.to_owned())),
25674        }
25675    }
25676}
25677impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataType {
25678    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25679        f.write_str(self.as_str())
25680    }
25681}
25682
25683impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataType {
25684    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25685        f.write_str(self.as_str())
25686    }
25687}
25688impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataType {
25689    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25690    where
25691        S: serde::Serializer,
25692    {
25693        serializer.serialize_str(self.as_str())
25694    }
25695}
25696#[cfg(feature = "deserialize")]
25697impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataType {
25698    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25699        use std::str::FromStr;
25700        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25701        Ok(Self::from_str(&s).unwrap())
25702    }
25703}
25704/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
25705#[derive(Clone, Debug, serde::Serialize)]
25706pub struct ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
25707    /// Account holder type: individual or company.
25708    #[serde(skip_serializing_if = "Option::is_none")]
25709    pub account_holder_type:
25710        Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
25711    /// Account number of the bank account.
25712    #[serde(skip_serializing_if = "Option::is_none")]
25713    pub account_number: Option<String>,
25714    /// Account type: checkings or savings. Defaults to checking if omitted.
25715    #[serde(skip_serializing_if = "Option::is_none")]
25716    pub account_type: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType>,
25717    /// The ID of a Financial Connections Account to use as a payment method.
25718    #[serde(skip_serializing_if = "Option::is_none")]
25719    pub financial_connections_account: Option<String>,
25720    /// Routing number of the bank account.
25721    #[serde(skip_serializing_if = "Option::is_none")]
25722    pub routing_number: Option<String>,
25723}
25724impl ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
25725    pub fn new() -> Self {
25726        Self {
25727            account_holder_type: None,
25728            account_number: None,
25729            account_type: None,
25730            financial_connections_account: None,
25731            routing_number: None,
25732        }
25733    }
25734}
25735impl Default for ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
25736    fn default() -> Self {
25737        Self::new()
25738    }
25739}
25740/// Account holder type: individual or company.
25741#[derive(Copy, Clone, Eq, PartialEq)]
25742pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25743    Company,
25744    Individual,
25745}
25746impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25747    pub fn as_str(self) -> &'static str {
25748        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
25749        match self {
25750            Company => "company",
25751            Individual => "individual",
25752        }
25753    }
25754}
25755
25756impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25757    type Err = stripe_types::StripeParseError;
25758    fn from_str(s: &str) -> Result<Self, Self::Err> {
25759        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
25760        match s {
25761            "company" => Ok(Company),
25762            "individual" => Ok(Individual),
25763            _ => Err(stripe_types::StripeParseError),
25764        }
25765    }
25766}
25767impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25768    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25769        f.write_str(self.as_str())
25770    }
25771}
25772
25773impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25774    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25775        f.write_str(self.as_str())
25776    }
25777}
25778impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25779    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25780    where
25781        S: serde::Serializer,
25782    {
25783        serializer.serialize_str(self.as_str())
25784    }
25785}
25786#[cfg(feature = "deserialize")]
25787impl<'de> serde::Deserialize<'de>
25788    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
25789{
25790    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25791        use std::str::FromStr;
25792        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25793        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
25794    }
25795}
25796/// Account type: checkings or savings. Defaults to checking if omitted.
25797#[derive(Copy, Clone, Eq, PartialEq)]
25798pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25799    Checking,
25800    Savings,
25801}
25802impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25803    pub fn as_str(self) -> &'static str {
25804        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
25805        match self {
25806            Checking => "checking",
25807            Savings => "savings",
25808        }
25809    }
25810}
25811
25812impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25813    type Err = stripe_types::StripeParseError;
25814    fn from_str(s: &str) -> Result<Self, Self::Err> {
25815        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
25816        match s {
25817            "checking" => Ok(Checking),
25818            "savings" => Ok(Savings),
25819            _ => Err(stripe_types::StripeParseError),
25820        }
25821    }
25822}
25823impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25824    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25825        f.write_str(self.as_str())
25826    }
25827}
25828
25829impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25831        f.write_str(self.as_str())
25832    }
25833}
25834impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25835    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25836    where
25837        S: serde::Serializer,
25838    {
25839        serializer.serialize_str(self.as_str())
25840    }
25841}
25842#[cfg(feature = "deserialize")]
25843impl<'de> serde::Deserialize<'de>
25844    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType
25845{
25846    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25847        use std::str::FromStr;
25848        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25849        Self::from_str(&s).map_err(|_| {
25850            serde::de::Error::custom(
25851                "Unknown value for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType",
25852            )
25853        })
25854    }
25855}
25856/// Payment method-specific configuration for this PaymentIntent.
25857#[derive(Clone, Debug, serde::Serialize)]
25858pub struct ConfirmPaymentIntentPaymentMethodOptions {
25859    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
25860    #[serde(skip_serializing_if = "Option::is_none")]
25861    pub acss_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebit>,
25862    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
25863    #[serde(skip_serializing_if = "Option::is_none")]
25864    pub affirm: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirm>,
25865    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
25866    #[serde(skip_serializing_if = "Option::is_none")]
25867    pub afterpay_clearpay: Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay>,
25868    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
25869    #[serde(skip_serializing_if = "Option::is_none")]
25870    pub alipay: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipay>,
25871    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
25872    #[serde(skip_serializing_if = "Option::is_none")]
25873    pub alma: Option<ConfirmPaymentIntentPaymentMethodOptionsAlma>,
25874    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
25875    #[serde(skip_serializing_if = "Option::is_none")]
25876    pub amazon_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPay>,
25877    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
25878    #[serde(skip_serializing_if = "Option::is_none")]
25879    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit>,
25880    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
25881    #[serde(skip_serializing_if = "Option::is_none")]
25882    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebit>,
25883    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
25884    #[serde(skip_serializing_if = "Option::is_none")]
25885    pub bancontact: Option<ConfirmPaymentIntentPaymentMethodOptionsBancontact>,
25886    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
25887    #[serde(skip_serializing_if = "Option::is_none")]
25888    pub billie: Option<ConfirmPaymentIntentPaymentMethodOptionsBillie>,
25889    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
25890    #[serde(skip_serializing_if = "Option::is_none")]
25891    pub blik: Option<ConfirmPaymentIntentPaymentMethodOptionsBlik>,
25892    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
25893    #[serde(skip_serializing_if = "Option::is_none")]
25894    pub boleto: Option<ConfirmPaymentIntentPaymentMethodOptionsBoleto>,
25895    /// Configuration for any card payments attempted on this PaymentIntent.
25896    #[serde(skip_serializing_if = "Option::is_none")]
25897    pub card: Option<ConfirmPaymentIntentPaymentMethodOptionsCard>,
25898    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
25899    #[serde(skip_serializing_if = "Option::is_none")]
25900    pub card_present: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresent>,
25901    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
25902    #[serde(skip_serializing_if = "Option::is_none")]
25903    pub cashapp: Option<ConfirmPaymentIntentPaymentMethodOptionsCashapp>,
25904    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
25905    #[serde(skip_serializing_if = "Option::is_none")]
25906    pub crypto: Option<ConfirmPaymentIntentPaymentMethodOptionsCrypto>,
25907    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
25908    #[serde(skip_serializing_if = "Option::is_none")]
25909    pub customer_balance: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance>,
25910    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
25911    #[serde(skip_serializing_if = "Option::is_none")]
25912    pub eps: Option<ConfirmPaymentIntentPaymentMethodOptionsEps>,
25913    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
25914    #[serde(skip_serializing_if = "Option::is_none")]
25915    pub fpx: Option<ConfirmPaymentIntentPaymentMethodOptionsFpx>,
25916    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
25917    #[serde(skip_serializing_if = "Option::is_none")]
25918    pub giropay: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropay>,
25919    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
25920    #[serde(skip_serializing_if = "Option::is_none")]
25921    pub grabpay: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpay>,
25922    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
25923    #[serde(skip_serializing_if = "Option::is_none")]
25924    pub ideal: Option<ConfirmPaymentIntentPaymentMethodOptionsIdeal>,
25925    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
25926    #[serde(skip_serializing_if = "Option::is_none")]
25927    #[serde(with = "stripe_types::with_serde_json_opt")]
25928    pub interac_present: Option<miniserde::json::Value>,
25929    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
25930    #[serde(skip_serializing_if = "Option::is_none")]
25931    pub kakao_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPay>,
25932    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
25933    #[serde(skip_serializing_if = "Option::is_none")]
25934    pub klarna: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarna>,
25935    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
25936    #[serde(skip_serializing_if = "Option::is_none")]
25937    pub konbini: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbini>,
25938    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
25939    #[serde(skip_serializing_if = "Option::is_none")]
25940    pub kr_card: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCard>,
25941    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
25942    #[serde(skip_serializing_if = "Option::is_none")]
25943    pub link: Option<ConfirmPaymentIntentPaymentMethodOptionsLink>,
25944    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
25945    #[serde(skip_serializing_if = "Option::is_none")]
25946    pub mb_way: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWay>,
25947    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
25948    #[serde(skip_serializing_if = "Option::is_none")]
25949    pub mobilepay: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepay>,
25950    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
25951    #[serde(skip_serializing_if = "Option::is_none")]
25952    pub multibanco: Option<ConfirmPaymentIntentPaymentMethodOptionsMultibanco>,
25953    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
25954    #[serde(skip_serializing_if = "Option::is_none")]
25955    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPay>,
25956    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
25957    #[serde(skip_serializing_if = "Option::is_none")]
25958    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount>,
25959    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
25960    #[serde(skip_serializing_if = "Option::is_none")]
25961    pub oxxo: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxo>,
25962    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
25963    #[serde(skip_serializing_if = "Option::is_none")]
25964    pub p24: Option<ConfirmPaymentIntentPaymentMethodOptionsP24>,
25965    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
25966    #[serde(skip_serializing_if = "Option::is_none")]
25967    #[serde(with = "stripe_types::with_serde_json_opt")]
25968    pub pay_by_bank: Option<miniserde::json::Value>,
25969    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
25970    #[serde(skip_serializing_if = "Option::is_none")]
25971    pub payco: Option<ConfirmPaymentIntentPaymentMethodOptionsPayco>,
25972    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
25973    #[serde(skip_serializing_if = "Option::is_none")]
25974    pub paynow: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynow>,
25975    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
25976    #[serde(skip_serializing_if = "Option::is_none")]
25977    pub paypal: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypal>,
25978    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
25979    #[serde(skip_serializing_if = "Option::is_none")]
25980    pub pix: Option<ConfirmPaymentIntentPaymentMethodOptionsPix>,
25981    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
25982    #[serde(skip_serializing_if = "Option::is_none")]
25983    pub promptpay: Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpay>,
25984    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
25985    #[serde(skip_serializing_if = "Option::is_none")]
25986    pub revolut_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPay>,
25987    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
25988    #[serde(skip_serializing_if = "Option::is_none")]
25989    pub samsung_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPay>,
25990    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
25991    #[serde(skip_serializing_if = "Option::is_none")]
25992    pub satispay: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispay>,
25993    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
25994    #[serde(skip_serializing_if = "Option::is_none")]
25995    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebit>,
25996    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
25997    #[serde(skip_serializing_if = "Option::is_none")]
25998    pub sofort: Option<ConfirmPaymentIntentPaymentMethodOptionsSofort>,
25999    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
26000    #[serde(skip_serializing_if = "Option::is_none")]
26001    pub swish: Option<ConfirmPaymentIntentPaymentMethodOptionsSwish>,
26002    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
26003    #[serde(skip_serializing_if = "Option::is_none")]
26004    pub twint: Option<ConfirmPaymentIntentPaymentMethodOptionsTwint>,
26005    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
26006    #[serde(skip_serializing_if = "Option::is_none")]
26007    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount>,
26008    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
26009    #[serde(skip_serializing_if = "Option::is_none")]
26010    pub wechat_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPay>,
26011    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
26012    #[serde(skip_serializing_if = "Option::is_none")]
26013    pub zip: Option<ConfirmPaymentIntentPaymentMethodOptionsZip>,
26014}
26015impl ConfirmPaymentIntentPaymentMethodOptions {
26016    pub fn new() -> Self {
26017        Self {
26018            acss_debit: None,
26019            affirm: None,
26020            afterpay_clearpay: None,
26021            alipay: None,
26022            alma: None,
26023            amazon_pay: None,
26024            au_becs_debit: None,
26025            bacs_debit: None,
26026            bancontact: None,
26027            billie: None,
26028            blik: None,
26029            boleto: None,
26030            card: None,
26031            card_present: None,
26032            cashapp: None,
26033            crypto: None,
26034            customer_balance: None,
26035            eps: None,
26036            fpx: None,
26037            giropay: None,
26038            grabpay: None,
26039            ideal: None,
26040            interac_present: None,
26041            kakao_pay: None,
26042            klarna: None,
26043            konbini: None,
26044            kr_card: None,
26045            link: None,
26046            mb_way: None,
26047            mobilepay: None,
26048            multibanco: None,
26049            naver_pay: None,
26050            nz_bank_account: None,
26051            oxxo: None,
26052            p24: None,
26053            pay_by_bank: None,
26054            payco: None,
26055            paynow: None,
26056            paypal: None,
26057            pix: None,
26058            promptpay: None,
26059            revolut_pay: None,
26060            samsung_pay: None,
26061            satispay: None,
26062            sepa_debit: None,
26063            sofort: None,
26064            swish: None,
26065            twint: None,
26066            us_bank_account: None,
26067            wechat_pay: None,
26068            zip: None,
26069        }
26070    }
26071}
26072impl Default for ConfirmPaymentIntentPaymentMethodOptions {
26073    fn default() -> Self {
26074        Self::new()
26075    }
26076}
26077/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
26078#[derive(Clone, Debug, serde::Serialize)]
26079pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
26080    /// Additional fields for Mandate creation
26081    #[serde(skip_serializing_if = "Option::is_none")]
26082    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
26083    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26084    ///
26085    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26086    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26087    ///
26088    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26089    ///
26090    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26091    ///
26092    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26093    #[serde(skip_serializing_if = "Option::is_none")]
26094    pub setup_future_usage:
26095        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
26096    /// Controls when Stripe will attempt to debit the funds from the customer's account.
26097    /// The date must be a string in YYYY-MM-DD format.
26098    /// The date must be in the future and between 3 and 15 calendar days from now.
26099    #[serde(skip_serializing_if = "Option::is_none")]
26100    pub target_date: Option<String>,
26101    /// Bank account verification method.
26102    #[serde(skip_serializing_if = "Option::is_none")]
26103    pub verification_method:
26104        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
26105}
26106impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
26107    pub fn new() -> Self {
26108        Self {
26109            mandate_options: None,
26110            setup_future_usage: None,
26111            target_date: None,
26112            verification_method: None,
26113        }
26114    }
26115}
26116impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
26117    fn default() -> Self {
26118        Self::new()
26119    }
26120}
26121/// Additional fields for Mandate creation
26122#[derive(Clone, Debug, serde::Serialize)]
26123pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
26124    /// A URL for custom mandate text to render during confirmation step.
26125    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
26126    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
26127    #[serde(skip_serializing_if = "Option::is_none")]
26128    pub custom_mandate_url: Option<String>,
26129    /// Description of the mandate interval.
26130    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
26131    #[serde(skip_serializing_if = "Option::is_none")]
26132    pub interval_description: Option<String>,
26133    /// Payment schedule for the mandate.
26134    #[serde(skip_serializing_if = "Option::is_none")]
26135    pub payment_schedule:
26136        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
26137    /// Transaction type of the mandate.
26138    #[serde(skip_serializing_if = "Option::is_none")]
26139    pub transaction_type:
26140        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
26141}
26142impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
26143    pub fn new() -> Self {
26144        Self {
26145            custom_mandate_url: None,
26146            interval_description: None,
26147            payment_schedule: None,
26148            transaction_type: None,
26149        }
26150    }
26151}
26152impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
26153    fn default() -> Self {
26154        Self::new()
26155    }
26156}
26157/// Payment schedule for the mandate.
26158#[derive(Copy, Clone, Eq, PartialEq)]
26159pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
26160    Combined,
26161    Interval,
26162    Sporadic,
26163}
26164impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
26165    pub fn as_str(self) -> &'static str {
26166        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
26167        match self {
26168            Combined => "combined",
26169            Interval => "interval",
26170            Sporadic => "sporadic",
26171        }
26172    }
26173}
26174
26175impl std::str::FromStr
26176    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26177{
26178    type Err = stripe_types::StripeParseError;
26179    fn from_str(s: &str) -> Result<Self, Self::Err> {
26180        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
26181        match s {
26182            "combined" => Ok(Combined),
26183            "interval" => Ok(Interval),
26184            "sporadic" => Ok(Sporadic),
26185            _ => Err(stripe_types::StripeParseError),
26186        }
26187    }
26188}
26189impl std::fmt::Display
26190    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26191{
26192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26193        f.write_str(self.as_str())
26194    }
26195}
26196
26197impl std::fmt::Debug
26198    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26199{
26200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26201        f.write_str(self.as_str())
26202    }
26203}
26204impl serde::Serialize
26205    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26206{
26207    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26208    where
26209        S: serde::Serializer,
26210    {
26211        serializer.serialize_str(self.as_str())
26212    }
26213}
26214#[cfg(feature = "deserialize")]
26215impl<'de> serde::Deserialize<'de>
26216    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26217{
26218    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26219        use std::str::FromStr;
26220        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26221        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
26222    }
26223}
26224/// Transaction type of the mandate.
26225#[derive(Copy, Clone, Eq, PartialEq)]
26226pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
26227    Business,
26228    Personal,
26229}
26230impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
26231    pub fn as_str(self) -> &'static str {
26232        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
26233        match self {
26234            Business => "business",
26235            Personal => "personal",
26236        }
26237    }
26238}
26239
26240impl std::str::FromStr
26241    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26242{
26243    type Err = stripe_types::StripeParseError;
26244    fn from_str(s: &str) -> Result<Self, Self::Err> {
26245        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
26246        match s {
26247            "business" => Ok(Business),
26248            "personal" => Ok(Personal),
26249            _ => Err(stripe_types::StripeParseError),
26250        }
26251    }
26252}
26253impl std::fmt::Display
26254    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26255{
26256    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26257        f.write_str(self.as_str())
26258    }
26259}
26260
26261impl std::fmt::Debug
26262    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26263{
26264    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26265        f.write_str(self.as_str())
26266    }
26267}
26268impl serde::Serialize
26269    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26270{
26271    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26272    where
26273        S: serde::Serializer,
26274    {
26275        serializer.serialize_str(self.as_str())
26276    }
26277}
26278#[cfg(feature = "deserialize")]
26279impl<'de> serde::Deserialize<'de>
26280    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26281{
26282    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26283        use std::str::FromStr;
26284        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26285        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
26286    }
26287}
26288/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26289///
26290/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26291/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26292///
26293/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26294///
26295/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26296///
26297/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26298#[derive(Copy, Clone, Eq, PartialEq)]
26299pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26300    None,
26301    OffSession,
26302    OnSession,
26303}
26304impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26305    pub fn as_str(self) -> &'static str {
26306        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
26307        match self {
26308            None => "none",
26309            OffSession => "off_session",
26310            OnSession => "on_session",
26311        }
26312    }
26313}
26314
26315impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26316    type Err = stripe_types::StripeParseError;
26317    fn from_str(s: &str) -> Result<Self, Self::Err> {
26318        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
26319        match s {
26320            "none" => Ok(None),
26321            "off_session" => Ok(OffSession),
26322            "on_session" => Ok(OnSession),
26323            _ => Err(stripe_types::StripeParseError),
26324        }
26325    }
26326}
26327impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26328    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26329        f.write_str(self.as_str())
26330    }
26331}
26332
26333impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26334    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26335        f.write_str(self.as_str())
26336    }
26337}
26338impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26339    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26340    where
26341        S: serde::Serializer,
26342    {
26343        serializer.serialize_str(self.as_str())
26344    }
26345}
26346#[cfg(feature = "deserialize")]
26347impl<'de> serde::Deserialize<'de>
26348    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
26349{
26350    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26351        use std::str::FromStr;
26352        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26353        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
26354    }
26355}
26356/// Bank account verification method.
26357#[derive(Copy, Clone, Eq, PartialEq)]
26358pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26359    Automatic,
26360    Instant,
26361    Microdeposits,
26362}
26363impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26364    pub fn as_str(self) -> &'static str {
26365        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
26366        match self {
26367            Automatic => "automatic",
26368            Instant => "instant",
26369            Microdeposits => "microdeposits",
26370        }
26371    }
26372}
26373
26374impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26375    type Err = stripe_types::StripeParseError;
26376    fn from_str(s: &str) -> Result<Self, Self::Err> {
26377        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
26378        match s {
26379            "automatic" => Ok(Automatic),
26380            "instant" => Ok(Instant),
26381            "microdeposits" => Ok(Microdeposits),
26382            _ => Err(stripe_types::StripeParseError),
26383        }
26384    }
26385}
26386impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26388        f.write_str(self.as_str())
26389    }
26390}
26391
26392impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26394        f.write_str(self.as_str())
26395    }
26396}
26397impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26398    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26399    where
26400        S: serde::Serializer,
26401    {
26402        serializer.serialize_str(self.as_str())
26403    }
26404}
26405#[cfg(feature = "deserialize")]
26406impl<'de> serde::Deserialize<'de>
26407    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
26408{
26409    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26410        use std::str::FromStr;
26411        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26412        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
26413    }
26414}
26415/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
26416#[derive(Clone, Debug, serde::Serialize)]
26417pub struct ConfirmPaymentIntentPaymentMethodOptionsAffirm {
26418    /// Controls when the funds are captured from the customer's account.
26419    ///
26420    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26421    ///
26422    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26423    #[serde(skip_serializing_if = "Option::is_none")]
26424    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
26425    /// Preferred language of the Affirm authorization page that the customer is redirected to.
26426    #[serde(skip_serializing_if = "Option::is_none")]
26427    pub preferred_locale: Option<String>,
26428    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26429    ///
26430    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26431    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26432    ///
26433    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26434    ///
26435    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26436    ///
26437    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26438    #[serde(skip_serializing_if = "Option::is_none")]
26439    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
26440}
26441impl ConfirmPaymentIntentPaymentMethodOptionsAffirm {
26442    pub fn new() -> Self {
26443        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
26444    }
26445}
26446impl Default for ConfirmPaymentIntentPaymentMethodOptionsAffirm {
26447    fn default() -> Self {
26448        Self::new()
26449    }
26450}
26451/// Controls when the funds are captured from the customer's account.
26452///
26453/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26454///
26455/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26456#[derive(Copy, Clone, Eq, PartialEq)]
26457pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26458    Manual,
26459}
26460impl ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26461    pub fn as_str(self) -> &'static str {
26462        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
26463        match self {
26464            Manual => "manual",
26465        }
26466    }
26467}
26468
26469impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26470    type Err = stripe_types::StripeParseError;
26471    fn from_str(s: &str) -> Result<Self, Self::Err> {
26472        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
26473        match s {
26474            "manual" => Ok(Manual),
26475            _ => Err(stripe_types::StripeParseError),
26476        }
26477    }
26478}
26479impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26480    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26481        f.write_str(self.as_str())
26482    }
26483}
26484
26485impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26486    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26487        f.write_str(self.as_str())
26488    }
26489}
26490impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26491    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26492    where
26493        S: serde::Serializer,
26494    {
26495        serializer.serialize_str(self.as_str())
26496    }
26497}
26498#[cfg(feature = "deserialize")]
26499impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26500    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26501        use std::str::FromStr;
26502        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26503        Self::from_str(&s).map_err(|_| {
26504            serde::de::Error::custom(
26505                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
26506            )
26507        })
26508    }
26509}
26510/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26511///
26512/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26513/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26514///
26515/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26516///
26517/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26518///
26519/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26520#[derive(Copy, Clone, Eq, PartialEq)]
26521pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26522    None,
26523}
26524impl ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26525    pub fn as_str(self) -> &'static str {
26526        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
26527        match self {
26528            None => "none",
26529        }
26530    }
26531}
26532
26533impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26534    type Err = stripe_types::StripeParseError;
26535    fn from_str(s: &str) -> Result<Self, Self::Err> {
26536        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
26537        match s {
26538            "none" => Ok(None),
26539            _ => Err(stripe_types::StripeParseError),
26540        }
26541    }
26542}
26543impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26544    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26545        f.write_str(self.as_str())
26546    }
26547}
26548
26549impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26550    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26551        f.write_str(self.as_str())
26552    }
26553}
26554impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26555    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26556    where
26557        S: serde::Serializer,
26558    {
26559        serializer.serialize_str(self.as_str())
26560    }
26561}
26562#[cfg(feature = "deserialize")]
26563impl<'de> serde::Deserialize<'de>
26564    for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
26565{
26566    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26567        use std::str::FromStr;
26568        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26569        Self::from_str(&s).map_err(|_| {
26570            serde::de::Error::custom(
26571                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
26572            )
26573        })
26574    }
26575}
26576/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
26577#[derive(Clone, Debug, serde::Serialize)]
26578pub struct ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
26579    /// Controls when the funds are captured from the customer's account.
26580    ///
26581    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26582    ///
26583    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26584    #[serde(skip_serializing_if = "Option::is_none")]
26585    pub capture_method:
26586        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
26587    /// An internal identifier or reference that this payment corresponds to.
26588    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
26589    /// This field differs from the statement descriptor and item name.
26590    #[serde(skip_serializing_if = "Option::is_none")]
26591    pub reference: Option<String>,
26592    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26593    ///
26594    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26595    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26596    ///
26597    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26598    ///
26599    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26600    ///
26601    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26602    #[serde(skip_serializing_if = "Option::is_none")]
26603    pub setup_future_usage:
26604        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
26605}
26606impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
26607    pub fn new() -> Self {
26608        Self { capture_method: None, reference: None, setup_future_usage: None }
26609    }
26610}
26611impl Default for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
26612    fn default() -> Self {
26613        Self::new()
26614    }
26615}
26616/// Controls when the funds are captured from the customer's account.
26617///
26618/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26619///
26620/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26621#[derive(Copy, Clone, Eq, PartialEq)]
26622pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26623    Manual,
26624}
26625impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26626    pub fn as_str(self) -> &'static str {
26627        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
26628        match self {
26629            Manual => "manual",
26630        }
26631    }
26632}
26633
26634impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26635    type Err = stripe_types::StripeParseError;
26636    fn from_str(s: &str) -> Result<Self, Self::Err> {
26637        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
26638        match s {
26639            "manual" => Ok(Manual),
26640            _ => Err(stripe_types::StripeParseError),
26641        }
26642    }
26643}
26644impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26645    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26646        f.write_str(self.as_str())
26647    }
26648}
26649
26650impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26651    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26652        f.write_str(self.as_str())
26653    }
26654}
26655impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26656    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26657    where
26658        S: serde::Serializer,
26659    {
26660        serializer.serialize_str(self.as_str())
26661    }
26662}
26663#[cfg(feature = "deserialize")]
26664impl<'de> serde::Deserialize<'de>
26665    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
26666{
26667    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26668        use std::str::FromStr;
26669        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26670        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
26671    }
26672}
26673/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26674///
26675/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26676/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26677///
26678/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26679///
26680/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26681///
26682/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26683#[derive(Copy, Clone, Eq, PartialEq)]
26684pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26685    None,
26686}
26687impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26688    pub fn as_str(self) -> &'static str {
26689        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
26690        match self {
26691            None => "none",
26692        }
26693    }
26694}
26695
26696impl std::str::FromStr
26697    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
26698{
26699    type Err = stripe_types::StripeParseError;
26700    fn from_str(s: &str) -> Result<Self, Self::Err> {
26701        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
26702        match s {
26703            "none" => Ok(None),
26704            _ => Err(stripe_types::StripeParseError),
26705        }
26706    }
26707}
26708impl std::fmt::Display
26709    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
26710{
26711    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26712        f.write_str(self.as_str())
26713    }
26714}
26715
26716impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26717    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26718        f.write_str(self.as_str())
26719    }
26720}
26721impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26722    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26723    where
26724        S: serde::Serializer,
26725    {
26726        serializer.serialize_str(self.as_str())
26727    }
26728}
26729#[cfg(feature = "deserialize")]
26730impl<'de> serde::Deserialize<'de>
26731    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
26732{
26733    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26734        use std::str::FromStr;
26735        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26736        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
26737    }
26738}
26739/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
26740#[derive(Copy, Clone, Debug, serde::Serialize)]
26741pub struct ConfirmPaymentIntentPaymentMethodOptionsAlipay {
26742    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26743    ///
26744    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26745    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26746    ///
26747    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26748    ///
26749    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26750    ///
26751    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26752    #[serde(skip_serializing_if = "Option::is_none")]
26753    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
26754}
26755impl ConfirmPaymentIntentPaymentMethodOptionsAlipay {
26756    pub fn new() -> Self {
26757        Self { setup_future_usage: None }
26758    }
26759}
26760impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlipay {
26761    fn default() -> Self {
26762        Self::new()
26763    }
26764}
26765/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26766///
26767/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26768/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26769///
26770/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26771///
26772/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26773///
26774/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26775#[derive(Copy, Clone, Eq, PartialEq)]
26776pub enum ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26777    None,
26778    OffSession,
26779}
26780impl ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26781    pub fn as_str(self) -> &'static str {
26782        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
26783        match self {
26784            None => "none",
26785            OffSession => "off_session",
26786        }
26787    }
26788}
26789
26790impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26791    type Err = stripe_types::StripeParseError;
26792    fn from_str(s: &str) -> Result<Self, Self::Err> {
26793        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
26794        match s {
26795            "none" => Ok(None),
26796            "off_session" => Ok(OffSession),
26797            _ => Err(stripe_types::StripeParseError),
26798        }
26799    }
26800}
26801impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26803        f.write_str(self.as_str())
26804    }
26805}
26806
26807impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26808    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26809        f.write_str(self.as_str())
26810    }
26811}
26812impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26813    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26814    where
26815        S: serde::Serializer,
26816    {
26817        serializer.serialize_str(self.as_str())
26818    }
26819}
26820#[cfg(feature = "deserialize")]
26821impl<'de> serde::Deserialize<'de>
26822    for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
26823{
26824    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26825        use std::str::FromStr;
26826        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26827        Self::from_str(&s).map_err(|_| {
26828            serde::de::Error::custom(
26829                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
26830            )
26831        })
26832    }
26833}
26834/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
26835#[derive(Copy, Clone, Debug, serde::Serialize)]
26836pub struct ConfirmPaymentIntentPaymentMethodOptionsAlma {
26837    /// Controls when the funds are captured from the customer's account.
26838    ///
26839    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26840    ///
26841    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26842    #[serde(skip_serializing_if = "Option::is_none")]
26843    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
26844}
26845impl ConfirmPaymentIntentPaymentMethodOptionsAlma {
26846    pub fn new() -> Self {
26847        Self { capture_method: None }
26848    }
26849}
26850impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlma {
26851    fn default() -> Self {
26852        Self::new()
26853    }
26854}
26855/// Controls when the funds are captured from the customer's account.
26856///
26857/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26858///
26859/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26860#[derive(Copy, Clone, Eq, PartialEq)]
26861pub enum ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26862    Manual,
26863}
26864impl ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26865    pub fn as_str(self) -> &'static str {
26866        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
26867        match self {
26868            Manual => "manual",
26869        }
26870    }
26871}
26872
26873impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26874    type Err = stripe_types::StripeParseError;
26875    fn from_str(s: &str) -> Result<Self, Self::Err> {
26876        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
26877        match s {
26878            "manual" => Ok(Manual),
26879            _ => Err(stripe_types::StripeParseError),
26880        }
26881    }
26882}
26883impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26884    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26885        f.write_str(self.as_str())
26886    }
26887}
26888
26889impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26890    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26891        f.write_str(self.as_str())
26892    }
26893}
26894impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26895    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26896    where
26897        S: serde::Serializer,
26898    {
26899        serializer.serialize_str(self.as_str())
26900    }
26901}
26902#[cfg(feature = "deserialize")]
26903impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26904    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26905        use std::str::FromStr;
26906        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26907        Self::from_str(&s).map_err(|_| {
26908            serde::de::Error::custom(
26909                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
26910            )
26911        })
26912    }
26913}
26914/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
26915#[derive(Copy, Clone, Debug, serde::Serialize)]
26916pub struct ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
26917    /// Controls when the funds are captured from the customer's account.
26918    ///
26919    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26920    ///
26921    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26922    #[serde(skip_serializing_if = "Option::is_none")]
26923    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
26924    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26925    ///
26926    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26927    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26928    ///
26929    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26930    ///
26931    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26932    #[serde(skip_serializing_if = "Option::is_none")]
26933    pub setup_future_usage:
26934        Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
26935}
26936impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
26937    pub fn new() -> Self {
26938        Self { capture_method: None, setup_future_usage: None }
26939    }
26940}
26941impl Default for ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
26942    fn default() -> Self {
26943        Self::new()
26944    }
26945}
26946/// Controls when the funds are captured from the customer's account.
26947///
26948/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
26949///
26950/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
26951#[derive(Copy, Clone, Eq, PartialEq)]
26952pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26953    Manual,
26954}
26955impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26956    pub fn as_str(self) -> &'static str {
26957        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
26958        match self {
26959            Manual => "manual",
26960        }
26961    }
26962}
26963
26964impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26965    type Err = stripe_types::StripeParseError;
26966    fn from_str(s: &str) -> Result<Self, Self::Err> {
26967        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
26968        match s {
26969            "manual" => Ok(Manual),
26970            _ => Err(stripe_types::StripeParseError),
26971        }
26972    }
26973}
26974impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26975    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26976        f.write_str(self.as_str())
26977    }
26978}
26979
26980impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26981    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26982        f.write_str(self.as_str())
26983    }
26984}
26985impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26986    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26987    where
26988        S: serde::Serializer,
26989    {
26990        serializer.serialize_str(self.as_str())
26991    }
26992}
26993#[cfg(feature = "deserialize")]
26994impl<'de> serde::Deserialize<'de>
26995    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
26996{
26997    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26998        use std::str::FromStr;
26999        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27000        Self::from_str(&s).map_err(|_| {
27001            serde::de::Error::custom(
27002                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
27003            )
27004        })
27005    }
27006}
27007/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27008///
27009/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27010/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27011///
27012/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27013///
27014/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27015#[derive(Copy, Clone, Eq, PartialEq)]
27016pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
27017    None,
27018    OffSession,
27019}
27020impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
27021    pub fn as_str(self) -> &'static str {
27022        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
27023        match self {
27024            None => "none",
27025            OffSession => "off_session",
27026        }
27027    }
27028}
27029
27030impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
27031    type Err = stripe_types::StripeParseError;
27032    fn from_str(s: &str) -> Result<Self, Self::Err> {
27033        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
27034        match s {
27035            "none" => Ok(None),
27036            "off_session" => Ok(OffSession),
27037            _ => Err(stripe_types::StripeParseError),
27038        }
27039    }
27040}
27041impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
27042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27043        f.write_str(self.as_str())
27044    }
27045}
27046
27047impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
27048    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27049        f.write_str(self.as_str())
27050    }
27051}
27052impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
27053    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27054    where
27055        S: serde::Serializer,
27056    {
27057        serializer.serialize_str(self.as_str())
27058    }
27059}
27060#[cfg(feature = "deserialize")]
27061impl<'de> serde::Deserialize<'de>
27062    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
27063{
27064    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27065        use std::str::FromStr;
27066        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27067        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
27068    }
27069}
27070/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
27071#[derive(Clone, Debug, serde::Serialize)]
27072pub struct ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
27073    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27074    ///
27075    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27076    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27077    ///
27078    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27079    ///
27080    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27081    ///
27082    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27083    #[serde(skip_serializing_if = "Option::is_none")]
27084    pub setup_future_usage:
27085        Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
27086    /// Controls when Stripe will attempt to debit the funds from the customer's account.
27087    /// The date must be a string in YYYY-MM-DD format.
27088    /// The date must be in the future and between 3 and 15 calendar days from now.
27089    #[serde(skip_serializing_if = "Option::is_none")]
27090    pub target_date: Option<String>,
27091}
27092impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
27093    pub fn new() -> Self {
27094        Self { setup_future_usage: None, target_date: None }
27095    }
27096}
27097impl Default for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
27098    fn default() -> Self {
27099        Self::new()
27100    }
27101}
27102/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27103///
27104/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27105/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27106///
27107/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27108///
27109/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27110///
27111/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27112#[derive(Copy, Clone, Eq, PartialEq)]
27113pub enum ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
27114    None,
27115    OffSession,
27116    OnSession,
27117}
27118impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
27119    pub fn as_str(self) -> &'static str {
27120        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
27121        match self {
27122            None => "none",
27123            OffSession => "off_session",
27124            OnSession => "on_session",
27125        }
27126    }
27127}
27128
27129impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
27130    type Err = stripe_types::StripeParseError;
27131    fn from_str(s: &str) -> Result<Self, Self::Err> {
27132        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
27133        match s {
27134            "none" => Ok(None),
27135            "off_session" => Ok(OffSession),
27136            "on_session" => Ok(OnSession),
27137            _ => Err(stripe_types::StripeParseError),
27138        }
27139    }
27140}
27141impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
27142    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27143        f.write_str(self.as_str())
27144    }
27145}
27146
27147impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
27148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27149        f.write_str(self.as_str())
27150    }
27151}
27152impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
27153    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27154    where
27155        S: serde::Serializer,
27156    {
27157        serializer.serialize_str(self.as_str())
27158    }
27159}
27160#[cfg(feature = "deserialize")]
27161impl<'de> serde::Deserialize<'de>
27162    for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
27163{
27164    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27165        use std::str::FromStr;
27166        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27167        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
27168    }
27169}
27170/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
27171#[derive(Clone, Debug, serde::Serialize)]
27172pub struct ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
27173    /// Additional fields for Mandate creation
27174    #[serde(skip_serializing_if = "Option::is_none")]
27175    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
27176    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27177    ///
27178    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27179    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27180    ///
27181    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27182    ///
27183    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27184    ///
27185    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27186    #[serde(skip_serializing_if = "Option::is_none")]
27187    pub setup_future_usage:
27188        Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
27189    /// Controls when Stripe will attempt to debit the funds from the customer's account.
27190    /// The date must be a string in YYYY-MM-DD format.
27191    /// The date must be in the future and between 3 and 15 calendar days from now.
27192    #[serde(skip_serializing_if = "Option::is_none")]
27193    pub target_date: Option<String>,
27194}
27195impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
27196    pub fn new() -> Self {
27197        Self { mandate_options: None, setup_future_usage: None, target_date: None }
27198    }
27199}
27200impl Default for ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
27201    fn default() -> Self {
27202        Self::new()
27203    }
27204}
27205/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27206///
27207/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27208/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27209///
27210/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27211///
27212/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27213///
27214/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27215#[derive(Copy, Clone, Eq, PartialEq)]
27216pub enum ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27217    None,
27218    OffSession,
27219    OnSession,
27220}
27221impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27222    pub fn as_str(self) -> &'static str {
27223        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
27224        match self {
27225            None => "none",
27226            OffSession => "off_session",
27227            OnSession => "on_session",
27228        }
27229    }
27230}
27231
27232impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27233    type Err = stripe_types::StripeParseError;
27234    fn from_str(s: &str) -> Result<Self, Self::Err> {
27235        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
27236        match s {
27237            "none" => Ok(None),
27238            "off_session" => Ok(OffSession),
27239            "on_session" => Ok(OnSession),
27240            _ => Err(stripe_types::StripeParseError),
27241        }
27242    }
27243}
27244impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27245    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27246        f.write_str(self.as_str())
27247    }
27248}
27249
27250impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27252        f.write_str(self.as_str())
27253    }
27254}
27255impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27256    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27257    where
27258        S: serde::Serializer,
27259    {
27260        serializer.serialize_str(self.as_str())
27261    }
27262}
27263#[cfg(feature = "deserialize")]
27264impl<'de> serde::Deserialize<'de>
27265    for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
27266{
27267    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27268        use std::str::FromStr;
27269        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27270        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
27271    }
27272}
27273/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
27274#[derive(Copy, Clone, Debug, serde::Serialize)]
27275pub struct ConfirmPaymentIntentPaymentMethodOptionsBancontact {
27276    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
27277    #[serde(skip_serializing_if = "Option::is_none")]
27278    pub preferred_language:
27279        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
27280    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27281    ///
27282    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27283    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27284    ///
27285    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27286    ///
27287    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27288    ///
27289    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27290    #[serde(skip_serializing_if = "Option::is_none")]
27291    pub setup_future_usage:
27292        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
27293}
27294impl ConfirmPaymentIntentPaymentMethodOptionsBancontact {
27295    pub fn new() -> Self {
27296        Self { preferred_language: None, setup_future_usage: None }
27297    }
27298}
27299impl Default for ConfirmPaymentIntentPaymentMethodOptionsBancontact {
27300    fn default() -> Self {
27301        Self::new()
27302    }
27303}
27304/// Preferred language of the Bancontact authorization page that the customer is redirected to.
27305#[derive(Copy, Clone, Eq, PartialEq)]
27306pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27307    De,
27308    En,
27309    Fr,
27310    Nl,
27311}
27312impl ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27313    pub fn as_str(self) -> &'static str {
27314        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
27315        match self {
27316            De => "de",
27317            En => "en",
27318            Fr => "fr",
27319            Nl => "nl",
27320        }
27321    }
27322}
27323
27324impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27325    type Err = stripe_types::StripeParseError;
27326    fn from_str(s: &str) -> Result<Self, Self::Err> {
27327        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
27328        match s {
27329            "de" => Ok(De),
27330            "en" => Ok(En),
27331            "fr" => Ok(Fr),
27332            "nl" => Ok(Nl),
27333            _ => Err(stripe_types::StripeParseError),
27334        }
27335    }
27336}
27337impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27339        f.write_str(self.as_str())
27340    }
27341}
27342
27343impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27345        f.write_str(self.as_str())
27346    }
27347}
27348impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27349    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27350    where
27351        S: serde::Serializer,
27352    {
27353        serializer.serialize_str(self.as_str())
27354    }
27355}
27356#[cfg(feature = "deserialize")]
27357impl<'de> serde::Deserialize<'de>
27358    for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
27359{
27360    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27361        use std::str::FromStr;
27362        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27363        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
27364    }
27365}
27366/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27367///
27368/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27369/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27370///
27371/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27372///
27373/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27374///
27375/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27376#[derive(Copy, Clone, Eq, PartialEq)]
27377pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27378    None,
27379    OffSession,
27380}
27381impl ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27382    pub fn as_str(self) -> &'static str {
27383        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
27384        match self {
27385            None => "none",
27386            OffSession => "off_session",
27387        }
27388    }
27389}
27390
27391impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27392    type Err = stripe_types::StripeParseError;
27393    fn from_str(s: &str) -> Result<Self, Self::Err> {
27394        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
27395        match s {
27396            "none" => Ok(None),
27397            "off_session" => Ok(OffSession),
27398            _ => Err(stripe_types::StripeParseError),
27399        }
27400    }
27401}
27402impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27403    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27404        f.write_str(self.as_str())
27405    }
27406}
27407
27408impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27409    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27410        f.write_str(self.as_str())
27411    }
27412}
27413impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27414    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27415    where
27416        S: serde::Serializer,
27417    {
27418        serializer.serialize_str(self.as_str())
27419    }
27420}
27421#[cfg(feature = "deserialize")]
27422impl<'de> serde::Deserialize<'de>
27423    for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
27424{
27425    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27426        use std::str::FromStr;
27427        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27428        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
27429    }
27430}
27431/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
27432#[derive(Copy, Clone, Debug, serde::Serialize)]
27433pub struct ConfirmPaymentIntentPaymentMethodOptionsBillie {
27434    /// Controls when the funds are captured from the customer's account.
27435    ///
27436    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
27437    ///
27438    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
27439    #[serde(skip_serializing_if = "Option::is_none")]
27440    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
27441}
27442impl ConfirmPaymentIntentPaymentMethodOptionsBillie {
27443    pub fn new() -> Self {
27444        Self { capture_method: None }
27445    }
27446}
27447impl Default for ConfirmPaymentIntentPaymentMethodOptionsBillie {
27448    fn default() -> Self {
27449        Self::new()
27450    }
27451}
27452/// Controls when the funds are captured from the customer's account.
27453///
27454/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
27455///
27456/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
27457#[derive(Copy, Clone, Eq, PartialEq)]
27458pub enum ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27459    Manual,
27460}
27461impl ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27462    pub fn as_str(self) -> &'static str {
27463        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
27464        match self {
27465            Manual => "manual",
27466        }
27467    }
27468}
27469
27470impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27471    type Err = stripe_types::StripeParseError;
27472    fn from_str(s: &str) -> Result<Self, Self::Err> {
27473        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
27474        match s {
27475            "manual" => Ok(Manual),
27476            _ => Err(stripe_types::StripeParseError),
27477        }
27478    }
27479}
27480impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27481    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27482        f.write_str(self.as_str())
27483    }
27484}
27485
27486impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27487    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27488        f.write_str(self.as_str())
27489    }
27490}
27491impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27492    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27493    where
27494        S: serde::Serializer,
27495    {
27496        serializer.serialize_str(self.as_str())
27497    }
27498}
27499#[cfg(feature = "deserialize")]
27500impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27501    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27502        use std::str::FromStr;
27503        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27504        Self::from_str(&s).map_err(|_| {
27505            serde::de::Error::custom(
27506                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod",
27507            )
27508        })
27509    }
27510}
27511/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
27512#[derive(Clone, Debug, serde::Serialize)]
27513pub struct ConfirmPaymentIntentPaymentMethodOptionsBlik {
27514    /// The 6-digit BLIK code that a customer has generated using their banking application.
27515    /// Can only be set on confirmation.
27516    #[serde(skip_serializing_if = "Option::is_none")]
27517    pub code: Option<String>,
27518    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27519    ///
27520    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27521    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27522    ///
27523    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27524    ///
27525    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27526    ///
27527    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27528    #[serde(skip_serializing_if = "Option::is_none")]
27529    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
27530}
27531impl ConfirmPaymentIntentPaymentMethodOptionsBlik {
27532    pub fn new() -> Self {
27533        Self { code: None, setup_future_usage: None }
27534    }
27535}
27536impl Default for ConfirmPaymentIntentPaymentMethodOptionsBlik {
27537    fn default() -> Self {
27538        Self::new()
27539    }
27540}
27541/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27542///
27543/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27544/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27545///
27546/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27547///
27548/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27549///
27550/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27551#[derive(Copy, Clone, Eq, PartialEq)]
27552pub enum ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27553    None,
27554}
27555impl ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27556    pub fn as_str(self) -> &'static str {
27557        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
27558        match self {
27559            None => "none",
27560        }
27561    }
27562}
27563
27564impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27565    type Err = stripe_types::StripeParseError;
27566    fn from_str(s: &str) -> Result<Self, Self::Err> {
27567        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
27568        match s {
27569            "none" => Ok(None),
27570            _ => Err(stripe_types::StripeParseError),
27571        }
27572    }
27573}
27574impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27575    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27576        f.write_str(self.as_str())
27577    }
27578}
27579
27580impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27581    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27582        f.write_str(self.as_str())
27583    }
27584}
27585impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27586    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27587    where
27588        S: serde::Serializer,
27589    {
27590        serializer.serialize_str(self.as_str())
27591    }
27592}
27593#[cfg(feature = "deserialize")]
27594impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27595    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27596        use std::str::FromStr;
27597        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27598        Self::from_str(&s).map_err(|_| {
27599            serde::de::Error::custom(
27600                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
27601            )
27602        })
27603    }
27604}
27605/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
27606#[derive(Copy, Clone, Debug, serde::Serialize)]
27607pub struct ConfirmPaymentIntentPaymentMethodOptionsBoleto {
27608    /// The number of calendar days before a Boleto voucher expires.
27609    /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
27610    #[serde(skip_serializing_if = "Option::is_none")]
27611    pub expires_after_days: Option<u32>,
27612    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27613    ///
27614    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27615    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27616    ///
27617    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27618    ///
27619    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27620    ///
27621    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27622    #[serde(skip_serializing_if = "Option::is_none")]
27623    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
27624}
27625impl ConfirmPaymentIntentPaymentMethodOptionsBoleto {
27626    pub fn new() -> Self {
27627        Self { expires_after_days: None, setup_future_usage: None }
27628    }
27629}
27630impl Default for ConfirmPaymentIntentPaymentMethodOptionsBoleto {
27631    fn default() -> Self {
27632        Self::new()
27633    }
27634}
27635/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27636///
27637/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27638/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27639///
27640/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27641///
27642/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27643///
27644/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27645#[derive(Copy, Clone, Eq, PartialEq)]
27646pub enum ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27647    None,
27648    OffSession,
27649    OnSession,
27650}
27651impl ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27652    pub fn as_str(self) -> &'static str {
27653        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
27654        match self {
27655            None => "none",
27656            OffSession => "off_session",
27657            OnSession => "on_session",
27658        }
27659    }
27660}
27661
27662impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27663    type Err = stripe_types::StripeParseError;
27664    fn from_str(s: &str) -> Result<Self, Self::Err> {
27665        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
27666        match s {
27667            "none" => Ok(None),
27668            "off_session" => Ok(OffSession),
27669            "on_session" => Ok(OnSession),
27670            _ => Err(stripe_types::StripeParseError),
27671        }
27672    }
27673}
27674impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27675    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27676        f.write_str(self.as_str())
27677    }
27678}
27679
27680impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27681    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27682        f.write_str(self.as_str())
27683    }
27684}
27685impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27686    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27687    where
27688        S: serde::Serializer,
27689    {
27690        serializer.serialize_str(self.as_str())
27691    }
27692}
27693#[cfg(feature = "deserialize")]
27694impl<'de> serde::Deserialize<'de>
27695    for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
27696{
27697    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27698        use std::str::FromStr;
27699        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27700        Self::from_str(&s).map_err(|_| {
27701            serde::de::Error::custom(
27702                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
27703            )
27704        })
27705    }
27706}
27707/// Configuration for any card payments attempted on this PaymentIntent.
27708#[derive(Clone, Debug, serde::Serialize)]
27709pub struct ConfirmPaymentIntentPaymentMethodOptionsCard {
27710    /// Controls when the funds are captured from the customer's account.
27711    ///
27712    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
27713    ///
27714    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
27715    #[serde(skip_serializing_if = "Option::is_none")]
27716    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod>,
27717    /// A single-use `cvc_update` Token that represents a card CVC value.
27718    /// When provided, the CVC value will be verified during the card payment attempt.
27719    /// This parameter can only be provided during confirmation.
27720    #[serde(skip_serializing_if = "Option::is_none")]
27721    pub cvc_token: Option<String>,
27722    /// Installment configuration for payments attempted on this PaymentIntent.
27723    ///
27724    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
27725    #[serde(skip_serializing_if = "Option::is_none")]
27726    pub installments: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallments>,
27727    /// Configuration options for setting up an eMandate for cards issued in India.
27728    #[serde(skip_serializing_if = "Option::is_none")]
27729    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions>,
27730    /// When specified, this parameter indicates that a transaction will be marked
27731    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
27732    /// parameter can only be provided during confirmation.
27733    #[serde(skip_serializing_if = "Option::is_none")]
27734    pub moto: Option<bool>,
27735    /// Selected network to process this PaymentIntent on.
27736    /// Depends on the available networks of the card attached to the PaymentIntent.
27737    /// Can be only set confirm-time.
27738    #[serde(skip_serializing_if = "Option::is_none")]
27739    pub network: Option<ConfirmPaymentIntentPaymentMethodOptionsCardNetwork>,
27740    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
27741    #[serde(skip_serializing_if = "Option::is_none")]
27742    pub request_extended_authorization:
27743        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
27744    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
27745    #[serde(skip_serializing_if = "Option::is_none")]
27746    pub request_incremental_authorization:
27747        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
27748    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
27749    #[serde(skip_serializing_if = "Option::is_none")]
27750    pub request_multicapture:
27751        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
27752    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
27753    #[serde(skip_serializing_if = "Option::is_none")]
27754    pub request_overcapture: Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
27755    /// 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).
27756    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
27757    /// If not provided, this value defaults to `automatic`.
27758    /// 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.
27759    #[serde(skip_serializing_if = "Option::is_none")]
27760    pub request_three_d_secure:
27761        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
27762    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
27763    /// using the cvc_token parameter).
27764    #[serde(skip_serializing_if = "Option::is_none")]
27765    pub require_cvc_recollection: Option<bool>,
27766    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27767    ///
27768    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27769    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27770    ///
27771    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27772    ///
27773    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27774    ///
27775    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27776    #[serde(skip_serializing_if = "Option::is_none")]
27777    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
27778    /// Provides information about a card payment that customers see on their statements.
27779    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
27780    /// Maximum 22 characters.
27781    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
27782    #[serde(skip_serializing_if = "Option::is_none")]
27783    pub statement_descriptor_suffix_kana: Option<String>,
27784    /// Provides information about a card payment that customers see on their statements.
27785    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
27786    /// Maximum 17 characters.
27787    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
27788    #[serde(skip_serializing_if = "Option::is_none")]
27789    pub statement_descriptor_suffix_kanji: Option<String>,
27790    /// If 3D Secure authentication was performed with a third-party provider,
27791    /// the authentication details to use for this payment.
27792    #[serde(skip_serializing_if = "Option::is_none")]
27793    pub three_d_secure: Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure>,
27794}
27795impl ConfirmPaymentIntentPaymentMethodOptionsCard {
27796    pub fn new() -> Self {
27797        Self {
27798            capture_method: None,
27799            cvc_token: None,
27800            installments: None,
27801            mandate_options: None,
27802            moto: None,
27803            network: None,
27804            request_extended_authorization: None,
27805            request_incremental_authorization: None,
27806            request_multicapture: None,
27807            request_overcapture: None,
27808            request_three_d_secure: None,
27809            require_cvc_recollection: None,
27810            setup_future_usage: None,
27811            statement_descriptor_suffix_kana: None,
27812            statement_descriptor_suffix_kanji: None,
27813            three_d_secure: None,
27814        }
27815    }
27816}
27817impl Default for ConfirmPaymentIntentPaymentMethodOptionsCard {
27818    fn default() -> Self {
27819        Self::new()
27820    }
27821}
27822/// Controls when the funds are captured from the customer's account.
27823///
27824/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
27825///
27826/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
27827#[derive(Copy, Clone, Eq, PartialEq)]
27828pub enum ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27829    Manual,
27830}
27831impl ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27832    pub fn as_str(self) -> &'static str {
27833        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
27834        match self {
27835            Manual => "manual",
27836        }
27837    }
27838}
27839
27840impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27841    type Err = stripe_types::StripeParseError;
27842    fn from_str(s: &str) -> Result<Self, Self::Err> {
27843        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
27844        match s {
27845            "manual" => Ok(Manual),
27846            _ => Err(stripe_types::StripeParseError),
27847        }
27848    }
27849}
27850impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27852        f.write_str(self.as_str())
27853    }
27854}
27855
27856impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27858        f.write_str(self.as_str())
27859    }
27860}
27861impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27862    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27863    where
27864        S: serde::Serializer,
27865    {
27866        serializer.serialize_str(self.as_str())
27867    }
27868}
27869#[cfg(feature = "deserialize")]
27870impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27871    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27872        use std::str::FromStr;
27873        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27874        Self::from_str(&s).map_err(|_| {
27875            serde::de::Error::custom(
27876                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod",
27877            )
27878        })
27879    }
27880}
27881/// Installment configuration for payments attempted on this PaymentIntent.
27882///
27883/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
27884#[derive(Copy, Clone, Debug, serde::Serialize)]
27885pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
27886    /// Setting to true enables installments for this PaymentIntent.
27887    /// This will cause the response to contain a list of available installment plans.
27888    /// Setting to false will prevent any selected plan from applying to a charge.
27889    #[serde(skip_serializing_if = "Option::is_none")]
27890    pub enabled: Option<bool>,
27891    /// The selected installment plan to use for this payment attempt.
27892    /// This parameter can only be provided during confirmation.
27893    #[serde(skip_serializing_if = "Option::is_none")]
27894    pub plan: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
27895}
27896impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
27897    pub fn new() -> Self {
27898        Self { enabled: None, plan: None }
27899    }
27900}
27901impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
27902    fn default() -> Self {
27903        Self::new()
27904    }
27905}
27906/// The selected installment plan to use for this payment attempt.
27907/// This parameter can only be provided during confirmation.
27908#[derive(Copy, Clone, Debug, serde::Serialize)]
27909pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
27910    /// For `fixed_count` installment plans, this is required.
27911    /// It represents the number of installment payments your customer will make to their credit card.
27912    #[serde(skip_serializing_if = "Option::is_none")]
27913    pub count: Option<u64>,
27914    /// For `fixed_count` installment plans, this is required.
27915    /// It represents the interval between installment payments your customer will make to their credit card.
27916    /// One of `month`.
27917    #[serde(skip_serializing_if = "Option::is_none")]
27918    pub interval: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
27919    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
27920    #[serde(rename = "type")]
27921    pub type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
27922}
27923impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
27924    pub fn new(
27925        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
27926    ) -> Self {
27927        Self { count: None, interval: None, type_: type_.into() }
27928    }
27929}
27930/// For `fixed_count` installment plans, this is required.
27931/// It represents the interval between installment payments your customer will make to their credit card.
27932/// One of `month`.
27933#[derive(Copy, Clone, Eq, PartialEq)]
27934pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27935    Month,
27936}
27937impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27938    pub fn as_str(self) -> &'static str {
27939        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
27940        match self {
27941            Month => "month",
27942        }
27943    }
27944}
27945
27946impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27947    type Err = stripe_types::StripeParseError;
27948    fn from_str(s: &str) -> Result<Self, Self::Err> {
27949        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
27950        match s {
27951            "month" => Ok(Month),
27952            _ => Err(stripe_types::StripeParseError),
27953        }
27954    }
27955}
27956impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27958        f.write_str(self.as_str())
27959    }
27960}
27961
27962impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27964        f.write_str(self.as_str())
27965    }
27966}
27967impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27968    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27969    where
27970        S: serde::Serializer,
27971    {
27972        serializer.serialize_str(self.as_str())
27973    }
27974}
27975#[cfg(feature = "deserialize")]
27976impl<'de> serde::Deserialize<'de>
27977    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
27978{
27979    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27980        use std::str::FromStr;
27981        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27982        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
27983    }
27984}
27985/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
27986#[derive(Copy, Clone, Eq, PartialEq)]
27987pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27988    Bonus,
27989    FixedCount,
27990    Revolving,
27991}
27992impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27993    pub fn as_str(self) -> &'static str {
27994        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
27995        match self {
27996            Bonus => "bonus",
27997            FixedCount => "fixed_count",
27998            Revolving => "revolving",
27999        }
28000    }
28001}
28002
28003impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
28004    type Err = stripe_types::StripeParseError;
28005    fn from_str(s: &str) -> Result<Self, Self::Err> {
28006        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
28007        match s {
28008            "bonus" => Ok(Bonus),
28009            "fixed_count" => Ok(FixedCount),
28010            "revolving" => Ok(Revolving),
28011            _ => Err(stripe_types::StripeParseError),
28012        }
28013    }
28014}
28015impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
28016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28017        f.write_str(self.as_str())
28018    }
28019}
28020
28021impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
28022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28023        f.write_str(self.as_str())
28024    }
28025}
28026impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
28027    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28028    where
28029        S: serde::Serializer,
28030    {
28031        serializer.serialize_str(self.as_str())
28032    }
28033}
28034#[cfg(feature = "deserialize")]
28035impl<'de> serde::Deserialize<'de>
28036    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
28037{
28038    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28039        use std::str::FromStr;
28040        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28041        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType"))
28042    }
28043}
28044/// Configuration options for setting up an eMandate for cards issued in India.
28045#[derive(Clone, Debug, serde::Serialize)]
28046pub struct ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
28047    /// Amount to be charged for future payments.
28048    pub amount: i64,
28049    /// One of `fixed` or `maximum`.
28050    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
28051    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
28052    pub amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
28053    /// A description of the mandate or subscription that is meant to be displayed to the customer.
28054    #[serde(skip_serializing_if = "Option::is_none")]
28055    pub description: Option<String>,
28056    /// End date of the mandate or subscription.
28057    /// If not provided, the mandate will be active until canceled.
28058    /// If provided, end date should be after start date.
28059    #[serde(skip_serializing_if = "Option::is_none")]
28060    pub end_date: Option<stripe_types::Timestamp>,
28061    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
28062    pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
28063    /// The number of intervals between payments.
28064    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
28065    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
28066    /// This parameter is optional when `interval=sporadic`.
28067    #[serde(skip_serializing_if = "Option::is_none")]
28068    pub interval_count: Option<u64>,
28069    /// Unique identifier for the mandate or subscription.
28070    pub reference: String,
28071    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
28072    pub start_date: stripe_types::Timestamp,
28073    /// Specifies the type of mandates supported. Possible values are `india`.
28074    #[serde(skip_serializing_if = "Option::is_none")]
28075    pub supported_types:
28076        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
28077}
28078impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
28079    pub fn new(
28080        amount: impl Into<i64>,
28081        amount_type: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
28082        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
28083        reference: impl Into<String>,
28084        start_date: impl Into<stripe_types::Timestamp>,
28085    ) -> Self {
28086        Self {
28087            amount: amount.into(),
28088            amount_type: amount_type.into(),
28089            description: None,
28090            end_date: None,
28091            interval: interval.into(),
28092            interval_count: None,
28093            reference: reference.into(),
28094            start_date: start_date.into(),
28095            supported_types: None,
28096        }
28097    }
28098}
28099/// One of `fixed` or `maximum`.
28100/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
28101/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
28102#[derive(Copy, Clone, Eq, PartialEq)]
28103pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
28104    Fixed,
28105    Maximum,
28106}
28107impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
28108    pub fn as_str(self) -> &'static str {
28109        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
28110        match self {
28111            Fixed => "fixed",
28112            Maximum => "maximum",
28113        }
28114    }
28115}
28116
28117impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
28118    type Err = stripe_types::StripeParseError;
28119    fn from_str(s: &str) -> Result<Self, Self::Err> {
28120        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
28121        match s {
28122            "fixed" => Ok(Fixed),
28123            "maximum" => Ok(Maximum),
28124            _ => Err(stripe_types::StripeParseError),
28125        }
28126    }
28127}
28128impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
28129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28130        f.write_str(self.as_str())
28131    }
28132}
28133
28134impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
28135    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28136        f.write_str(self.as_str())
28137    }
28138}
28139impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
28140    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28141    where
28142        S: serde::Serializer,
28143    {
28144        serializer.serialize_str(self.as_str())
28145    }
28146}
28147#[cfg(feature = "deserialize")]
28148impl<'de> serde::Deserialize<'de>
28149    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
28150{
28151    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28152        use std::str::FromStr;
28153        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28154        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
28155    }
28156}
28157/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
28158#[derive(Copy, Clone, Eq, PartialEq)]
28159pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28160    Day,
28161    Month,
28162    Sporadic,
28163    Week,
28164    Year,
28165}
28166impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28167    pub fn as_str(self) -> &'static str {
28168        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
28169        match self {
28170            Day => "day",
28171            Month => "month",
28172            Sporadic => "sporadic",
28173            Week => "week",
28174            Year => "year",
28175        }
28176    }
28177}
28178
28179impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28180    type Err = stripe_types::StripeParseError;
28181    fn from_str(s: &str) -> Result<Self, Self::Err> {
28182        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
28183        match s {
28184            "day" => Ok(Day),
28185            "month" => Ok(Month),
28186            "sporadic" => Ok(Sporadic),
28187            "week" => Ok(Week),
28188            "year" => Ok(Year),
28189            _ => Err(stripe_types::StripeParseError),
28190        }
28191    }
28192}
28193impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28194    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28195        f.write_str(self.as_str())
28196    }
28197}
28198
28199impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28201        f.write_str(self.as_str())
28202    }
28203}
28204impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28205    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28206    where
28207        S: serde::Serializer,
28208    {
28209        serializer.serialize_str(self.as_str())
28210    }
28211}
28212#[cfg(feature = "deserialize")]
28213impl<'de> serde::Deserialize<'de>
28214    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
28215{
28216    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28217        use std::str::FromStr;
28218        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28219        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
28220    }
28221}
28222/// Specifies the type of mandates supported. Possible values are `india`.
28223#[derive(Copy, Clone, Eq, PartialEq)]
28224pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28225    India,
28226}
28227impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28228    pub fn as_str(self) -> &'static str {
28229        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
28230        match self {
28231            India => "india",
28232        }
28233    }
28234}
28235
28236impl std::str::FromStr
28237    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
28238{
28239    type Err = stripe_types::StripeParseError;
28240    fn from_str(s: &str) -> Result<Self, Self::Err> {
28241        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
28242        match s {
28243            "india" => Ok(India),
28244            _ => Err(stripe_types::StripeParseError),
28245        }
28246    }
28247}
28248impl std::fmt::Display
28249    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
28250{
28251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28252        f.write_str(self.as_str())
28253    }
28254}
28255
28256impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28257    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28258        f.write_str(self.as_str())
28259    }
28260}
28261impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28262    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28263    where
28264        S: serde::Serializer,
28265    {
28266        serializer.serialize_str(self.as_str())
28267    }
28268}
28269#[cfg(feature = "deserialize")]
28270impl<'de> serde::Deserialize<'de>
28271    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
28272{
28273    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28274        use std::str::FromStr;
28275        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28276        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
28277    }
28278}
28279/// Selected network to process this PaymentIntent on.
28280/// Depends on the available networks of the card attached to the PaymentIntent.
28281/// Can be only set confirm-time.
28282#[derive(Copy, Clone, Eq, PartialEq)]
28283pub enum ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28284    Amex,
28285    CartesBancaires,
28286    Diners,
28287    Discover,
28288    EftposAu,
28289    Girocard,
28290    Interac,
28291    Jcb,
28292    Link,
28293    Mastercard,
28294    Unionpay,
28295    Unknown,
28296    Visa,
28297}
28298impl ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28299    pub fn as_str(self) -> &'static str {
28300        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
28301        match self {
28302            Amex => "amex",
28303            CartesBancaires => "cartes_bancaires",
28304            Diners => "diners",
28305            Discover => "discover",
28306            EftposAu => "eftpos_au",
28307            Girocard => "girocard",
28308            Interac => "interac",
28309            Jcb => "jcb",
28310            Link => "link",
28311            Mastercard => "mastercard",
28312            Unionpay => "unionpay",
28313            Unknown => "unknown",
28314            Visa => "visa",
28315        }
28316    }
28317}
28318
28319impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28320    type Err = stripe_types::StripeParseError;
28321    fn from_str(s: &str) -> Result<Self, Self::Err> {
28322        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
28323        match s {
28324            "amex" => Ok(Amex),
28325            "cartes_bancaires" => Ok(CartesBancaires),
28326            "diners" => Ok(Diners),
28327            "discover" => Ok(Discover),
28328            "eftpos_au" => Ok(EftposAu),
28329            "girocard" => Ok(Girocard),
28330            "interac" => Ok(Interac),
28331            "jcb" => Ok(Jcb),
28332            "link" => Ok(Link),
28333            "mastercard" => Ok(Mastercard),
28334            "unionpay" => Ok(Unionpay),
28335            "unknown" => Ok(Unknown),
28336            "visa" => Ok(Visa),
28337            _ => Err(stripe_types::StripeParseError),
28338        }
28339    }
28340}
28341impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28343        f.write_str(self.as_str())
28344    }
28345}
28346
28347impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28349        f.write_str(self.as_str())
28350    }
28351}
28352impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28353    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28354    where
28355        S: serde::Serializer,
28356    {
28357        serializer.serialize_str(self.as_str())
28358    }
28359}
28360#[cfg(feature = "deserialize")]
28361impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28362    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28363        use std::str::FromStr;
28364        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28365        Self::from_str(&s).map_err(|_| {
28366            serde::de::Error::custom(
28367                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork",
28368            )
28369        })
28370    }
28371}
28372/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
28373#[derive(Copy, Clone, Eq, PartialEq)]
28374pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28375    IfAvailable,
28376    Never,
28377}
28378impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28379    pub fn as_str(self) -> &'static str {
28380        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
28381        match self {
28382            IfAvailable => "if_available",
28383            Never => "never",
28384        }
28385    }
28386}
28387
28388impl std::str::FromStr
28389    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
28390{
28391    type Err = stripe_types::StripeParseError;
28392    fn from_str(s: &str) -> Result<Self, Self::Err> {
28393        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
28394        match s {
28395            "if_available" => Ok(IfAvailable),
28396            "never" => Ok(Never),
28397            _ => Err(stripe_types::StripeParseError),
28398        }
28399    }
28400}
28401impl std::fmt::Display
28402    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
28403{
28404    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28405        f.write_str(self.as_str())
28406    }
28407}
28408
28409impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28411        f.write_str(self.as_str())
28412    }
28413}
28414impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28415    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28416    where
28417        S: serde::Serializer,
28418    {
28419        serializer.serialize_str(self.as_str())
28420    }
28421}
28422#[cfg(feature = "deserialize")]
28423impl<'de> serde::Deserialize<'de>
28424    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
28425{
28426    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28427        use std::str::FromStr;
28428        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28429        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
28430    }
28431}
28432/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
28433#[derive(Copy, Clone, Eq, PartialEq)]
28434pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
28435    IfAvailable,
28436    Never,
28437}
28438impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
28439    pub fn as_str(self) -> &'static str {
28440        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
28441        match self {
28442            IfAvailable => "if_available",
28443            Never => "never",
28444        }
28445    }
28446}
28447
28448impl std::str::FromStr
28449    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28450{
28451    type Err = stripe_types::StripeParseError;
28452    fn from_str(s: &str) -> Result<Self, Self::Err> {
28453        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
28454        match s {
28455            "if_available" => Ok(IfAvailable),
28456            "never" => Ok(Never),
28457            _ => Err(stripe_types::StripeParseError),
28458        }
28459    }
28460}
28461impl std::fmt::Display
28462    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28463{
28464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28465        f.write_str(self.as_str())
28466    }
28467}
28468
28469impl std::fmt::Debug
28470    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28471{
28472    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28473        f.write_str(self.as_str())
28474    }
28475}
28476impl serde::Serialize
28477    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28478{
28479    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28480    where
28481        S: serde::Serializer,
28482    {
28483        serializer.serialize_str(self.as_str())
28484    }
28485}
28486#[cfg(feature = "deserialize")]
28487impl<'de> serde::Deserialize<'de>
28488    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28489{
28490    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28491        use std::str::FromStr;
28492        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28493        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
28494    }
28495}
28496/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
28497#[derive(Copy, Clone, Eq, PartialEq)]
28498pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28499    IfAvailable,
28500    Never,
28501}
28502impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28503    pub fn as_str(self) -> &'static str {
28504        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
28505        match self {
28506            IfAvailable => "if_available",
28507            Never => "never",
28508        }
28509    }
28510}
28511
28512impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28513    type Err = stripe_types::StripeParseError;
28514    fn from_str(s: &str) -> Result<Self, Self::Err> {
28515        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
28516        match s {
28517            "if_available" => Ok(IfAvailable),
28518            "never" => Ok(Never),
28519            _ => Err(stripe_types::StripeParseError),
28520        }
28521    }
28522}
28523impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28524    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28525        f.write_str(self.as_str())
28526    }
28527}
28528
28529impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28530    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28531        f.write_str(self.as_str())
28532    }
28533}
28534impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28535    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28536    where
28537        S: serde::Serializer,
28538    {
28539        serializer.serialize_str(self.as_str())
28540    }
28541}
28542#[cfg(feature = "deserialize")]
28543impl<'de> serde::Deserialize<'de>
28544    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture
28545{
28546    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28547        use std::str::FromStr;
28548        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28549        Self::from_str(&s).map_err(|_| {
28550            serde::de::Error::custom(
28551                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture",
28552            )
28553        })
28554    }
28555}
28556/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
28557#[derive(Copy, Clone, Eq, PartialEq)]
28558pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28559    IfAvailable,
28560    Never,
28561}
28562impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28563    pub fn as_str(self) -> &'static str {
28564        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
28565        match self {
28566            IfAvailable => "if_available",
28567            Never => "never",
28568        }
28569    }
28570}
28571
28572impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28573    type Err = stripe_types::StripeParseError;
28574    fn from_str(s: &str) -> Result<Self, Self::Err> {
28575        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
28576        match s {
28577            "if_available" => Ok(IfAvailable),
28578            "never" => Ok(Never),
28579            _ => Err(stripe_types::StripeParseError),
28580        }
28581    }
28582}
28583impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28584    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28585        f.write_str(self.as_str())
28586    }
28587}
28588
28589impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28590    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28591        f.write_str(self.as_str())
28592    }
28593}
28594impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28595    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28596    where
28597        S: serde::Serializer,
28598    {
28599        serializer.serialize_str(self.as_str())
28600    }
28601}
28602#[cfg(feature = "deserialize")]
28603impl<'de> serde::Deserialize<'de>
28604    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture
28605{
28606    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28607        use std::str::FromStr;
28608        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28609        Self::from_str(&s).map_err(|_| {
28610            serde::de::Error::custom(
28611                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture",
28612            )
28613        })
28614    }
28615}
28616/// 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).
28617/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
28618/// If not provided, this value defaults to `automatic`.
28619/// 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.
28620#[derive(Copy, Clone, Eq, PartialEq)]
28621pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28622    Any,
28623    Automatic,
28624    Challenge,
28625}
28626impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28627    pub fn as_str(self) -> &'static str {
28628        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
28629        match self {
28630            Any => "any",
28631            Automatic => "automatic",
28632            Challenge => "challenge",
28633        }
28634    }
28635}
28636
28637impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28638    type Err = stripe_types::StripeParseError;
28639    fn from_str(s: &str) -> Result<Self, Self::Err> {
28640        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
28641        match s {
28642            "any" => Ok(Any),
28643            "automatic" => Ok(Automatic),
28644            "challenge" => Ok(Challenge),
28645            _ => Err(stripe_types::StripeParseError),
28646        }
28647    }
28648}
28649impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28650    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28651        f.write_str(self.as_str())
28652    }
28653}
28654
28655impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28656    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28657        f.write_str(self.as_str())
28658    }
28659}
28660impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28661    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28662    where
28663        S: serde::Serializer,
28664    {
28665        serializer.serialize_str(self.as_str())
28666    }
28667}
28668#[cfg(feature = "deserialize")]
28669impl<'de> serde::Deserialize<'de>
28670    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
28671{
28672    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28673        use std::str::FromStr;
28674        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28675        Self::from_str(&s).map_err(|_| {
28676            serde::de::Error::custom(
28677                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
28678            )
28679        })
28680    }
28681}
28682/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28683///
28684/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28685/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28686///
28687/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28688///
28689/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28690///
28691/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28692#[derive(Copy, Clone, Eq, PartialEq)]
28693pub enum ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28694    None,
28695    OffSession,
28696    OnSession,
28697}
28698impl ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28699    pub fn as_str(self) -> &'static str {
28700        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
28701        match self {
28702            None => "none",
28703            OffSession => "off_session",
28704            OnSession => "on_session",
28705        }
28706    }
28707}
28708
28709impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28710    type Err = stripe_types::StripeParseError;
28711    fn from_str(s: &str) -> Result<Self, Self::Err> {
28712        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
28713        match s {
28714            "none" => Ok(None),
28715            "off_session" => Ok(OffSession),
28716            "on_session" => Ok(OnSession),
28717            _ => Err(stripe_types::StripeParseError),
28718        }
28719    }
28720}
28721impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28723        f.write_str(self.as_str())
28724    }
28725}
28726
28727impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28728    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28729        f.write_str(self.as_str())
28730    }
28731}
28732impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28733    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28734    where
28735        S: serde::Serializer,
28736    {
28737        serializer.serialize_str(self.as_str())
28738    }
28739}
28740#[cfg(feature = "deserialize")]
28741impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28742    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28743        use std::str::FromStr;
28744        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28745        Self::from_str(&s).map_err(|_| {
28746            serde::de::Error::custom(
28747                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
28748            )
28749        })
28750    }
28751}
28752/// If 3D Secure authentication was performed with a third-party provider,
28753/// the authentication details to use for this payment.
28754#[derive(Clone, Debug, serde::Serialize)]
28755pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
28756    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
28757    #[serde(skip_serializing_if = "Option::is_none")]
28758    pub ares_trans_status:
28759        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
28760    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
28761    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
28762    /// (Most 3D Secure providers will return the base64-encoded version, which
28763    /// is what you should specify here.)
28764    pub cryptogram: String,
28765    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
28766    /// provider and indicates what degree of authentication was performed.
28767    #[serde(skip_serializing_if = "Option::is_none")]
28768    pub electronic_commerce_indicator:
28769        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
28770    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
28771    #[serde(skip_serializing_if = "Option::is_none")]
28772    pub exemption_indicator:
28773        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
28774    /// Network specific 3DS fields. Network specific arguments require an
28775    /// explicit card brand choice. The parameter `payment_method_options.card.network``
28776    /// must be populated accordingly
28777    #[serde(skip_serializing_if = "Option::is_none")]
28778    pub network_options:
28779        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
28780    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
28781    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
28782    #[serde(skip_serializing_if = "Option::is_none")]
28783    pub requestor_challenge_indicator: Option<String>,
28784    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
28785    /// Transaction ID (dsTransID).
28786    pub transaction_id: String,
28787    /// The version of 3D Secure that was performed.
28788    pub version: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
28789}
28790impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
28791    pub fn new(
28792        cryptogram: impl Into<String>,
28793        transaction_id: impl Into<String>,
28794        version: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
28795    ) -> Self {
28796        Self {
28797            ares_trans_status: None,
28798            cryptogram: cryptogram.into(),
28799            electronic_commerce_indicator: None,
28800            exemption_indicator: None,
28801            network_options: None,
28802            requestor_challenge_indicator: None,
28803            transaction_id: transaction_id.into(),
28804            version: version.into(),
28805        }
28806    }
28807}
28808/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
28809#[derive(Copy, Clone, Eq, PartialEq)]
28810pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28811    A,
28812    C,
28813    I,
28814    N,
28815    R,
28816    U,
28817    Y,
28818}
28819impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28820    pub fn as_str(self) -> &'static str {
28821        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
28822        match self {
28823            A => "A",
28824            C => "C",
28825            I => "I",
28826            N => "N",
28827            R => "R",
28828            U => "U",
28829            Y => "Y",
28830        }
28831    }
28832}
28833
28834impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28835    type Err = stripe_types::StripeParseError;
28836    fn from_str(s: &str) -> Result<Self, Self::Err> {
28837        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
28838        match s {
28839            "A" => Ok(A),
28840            "C" => Ok(C),
28841            "I" => Ok(I),
28842            "N" => Ok(N),
28843            "R" => Ok(R),
28844            "U" => Ok(U),
28845            "Y" => Ok(Y),
28846            _ => Err(stripe_types::StripeParseError),
28847        }
28848    }
28849}
28850impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28852        f.write_str(self.as_str())
28853    }
28854}
28855
28856impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28858        f.write_str(self.as_str())
28859    }
28860}
28861impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28862    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28863    where
28864        S: serde::Serializer,
28865    {
28866        serializer.serialize_str(self.as_str())
28867    }
28868}
28869#[cfg(feature = "deserialize")]
28870impl<'de> serde::Deserialize<'de>
28871    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
28872{
28873    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28874        use std::str::FromStr;
28875        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28876        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
28877    }
28878}
28879/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
28880/// provider and indicates what degree of authentication was performed.
28881#[derive(Copy, Clone, Eq, PartialEq)]
28882pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
28883    V01,
28884    V02,
28885    V05,
28886    V06,
28887    V07,
28888}
28889impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
28890    pub fn as_str(self) -> &'static str {
28891        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
28892        match self {
28893            V01 => "01",
28894            V02 => "02",
28895            V05 => "05",
28896            V06 => "06",
28897            V07 => "07",
28898        }
28899    }
28900}
28901
28902impl std::str::FromStr
28903    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28904{
28905    type Err = stripe_types::StripeParseError;
28906    fn from_str(s: &str) -> Result<Self, Self::Err> {
28907        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
28908        match s {
28909            "01" => Ok(V01),
28910            "02" => Ok(V02),
28911            "05" => Ok(V05),
28912            "06" => Ok(V06),
28913            "07" => Ok(V07),
28914            _ => Err(stripe_types::StripeParseError),
28915        }
28916    }
28917}
28918impl std::fmt::Display
28919    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28920{
28921    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28922        f.write_str(self.as_str())
28923    }
28924}
28925
28926impl std::fmt::Debug
28927    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28928{
28929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28930        f.write_str(self.as_str())
28931    }
28932}
28933impl serde::Serialize
28934    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28935{
28936    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28937    where
28938        S: serde::Serializer,
28939    {
28940        serializer.serialize_str(self.as_str())
28941    }
28942}
28943#[cfg(feature = "deserialize")]
28944impl<'de> serde::Deserialize<'de>
28945    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28946{
28947    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28948        use std::str::FromStr;
28949        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28950        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
28951    }
28952}
28953/// The exemption requested via 3DS and accepted by the issuer at authentication time.
28954#[derive(Copy, Clone, Eq, PartialEq)]
28955pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
28956    LowRisk,
28957    None,
28958}
28959impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
28960    pub fn as_str(self) -> &'static str {
28961        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
28962        match self {
28963            LowRisk => "low_risk",
28964            None => "none",
28965        }
28966    }
28967}
28968
28969impl std::str::FromStr
28970    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28971{
28972    type Err = stripe_types::StripeParseError;
28973    fn from_str(s: &str) -> Result<Self, Self::Err> {
28974        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
28975        match s {
28976            "low_risk" => Ok(LowRisk),
28977            "none" => Ok(None),
28978            _ => Err(stripe_types::StripeParseError),
28979        }
28980    }
28981}
28982impl std::fmt::Display
28983    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28984{
28985    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28986        f.write_str(self.as_str())
28987    }
28988}
28989
28990impl std::fmt::Debug
28991    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28992{
28993    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28994        f.write_str(self.as_str())
28995    }
28996}
28997impl serde::Serialize
28998    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28999{
29000    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29001    where
29002        S: serde::Serializer,
29003    {
29004        serializer.serialize_str(self.as_str())
29005    }
29006}
29007#[cfg(feature = "deserialize")]
29008impl<'de> serde::Deserialize<'de>
29009    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
29010{
29011    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29012        use std::str::FromStr;
29013        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29014        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
29015    }
29016}
29017/// Network specific 3DS fields. Network specific arguments require an
29018/// explicit card brand choice. The parameter `payment_method_options.card.network``
29019/// must be populated accordingly
29020#[derive(Clone, Debug, serde::Serialize)]
29021pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
29022    /// Cartes Bancaires-specific 3DS fields.
29023    #[serde(skip_serializing_if = "Option::is_none")]
29024    pub cartes_bancaires: Option<
29025        ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
29026    >,
29027}
29028impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
29029    pub fn new() -> Self {
29030        Self { cartes_bancaires: None }
29031    }
29032}
29033impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
29034    fn default() -> Self {
29035        Self::new()
29036    }
29037}
29038/// Cartes Bancaires-specific 3DS fields.
29039#[derive(Clone, Debug, serde::Serialize)]
29040pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
29041    /// The cryptogram calculation algorithm used by the card Issuer's ACS
29042    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
29043    /// messageExtension: CB-AVALGO
29044pub cb_avalgo: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
29045    /// The exemption indicator returned from Cartes Bancaires in the ARes.
29046    /// message extension: CB-EXEMPTION; string (4 characters)
29047    /// This is a 3 byte bitmap (low significant byte first and most significant
29048    /// bit first) that has been Base64 encoded
29049#[serde(skip_serializing_if = "Option::is_none")]
29050pub cb_exemption: Option<String>,
29051    /// The risk score returned from Cartes Bancaires in the ARes.
29052    /// message extension: CB-SCORE; numeric value 0-99
29053#[serde(skip_serializing_if = "Option::is_none")]
29054pub cb_score: Option<i64>,
29055
29056}
29057impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
29058    pub fn new(
29059        cb_avalgo: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
29060    ) -> Self {
29061        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
29062    }
29063}
29064/// The cryptogram calculation algorithm used by the card Issuer's ACS
29065/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
29066/// messageExtension: CB-AVALGO
29067#[derive(Copy, Clone, Eq, PartialEq)]
29068pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
29069{
29070    V0,
29071    V1,
29072    V2,
29073    V3,
29074    V4,
29075    A,
29076}
29077impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
29078    pub fn as_str(self) -> &'static str {
29079        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
29080        match self {
29081            V0 => "0",
29082            V1 => "1",
29083            V2 => "2",
29084            V3 => "3",
29085            V4 => "4",
29086            A => "A",
29087        }
29088    }
29089}
29090
29091impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
29092    type Err = stripe_types::StripeParseError;
29093    fn from_str(s: &str) -> Result<Self, Self::Err> {
29094        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
29095        match s {
29096    "0" => Ok(V0),
29097"1" => Ok(V1),
29098"2" => Ok(V2),
29099"3" => Ok(V3),
29100"4" => Ok(V4),
29101"A" => Ok(A),
29102_ => Err(stripe_types::StripeParseError)
29103
29104        }
29105    }
29106}
29107impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
29108    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29109        f.write_str(self.as_str())
29110    }
29111}
29112
29113impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
29114    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29115        f.write_str(self.as_str())
29116    }
29117}
29118impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
29119    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
29120        serializer.serialize_str(self.as_str())
29121    }
29122}
29123#[cfg(feature = "deserialize")]
29124impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
29125    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29126        use std::str::FromStr;
29127        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29128        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
29129    }
29130}
29131/// The version of 3D Secure that was performed.
29132#[derive(Copy, Clone, Eq, PartialEq)]
29133pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
29134    V1_0_2,
29135    V2_1_0,
29136    V2_2_0,
29137}
29138impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
29139    pub fn as_str(self) -> &'static str {
29140        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
29141        match self {
29142            V1_0_2 => "1.0.2",
29143            V2_1_0 => "2.1.0",
29144            V2_2_0 => "2.2.0",
29145        }
29146    }
29147}
29148
29149impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
29150    type Err = stripe_types::StripeParseError;
29151    fn from_str(s: &str) -> Result<Self, Self::Err> {
29152        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
29153        match s {
29154            "1.0.2" => Ok(V1_0_2),
29155            "2.1.0" => Ok(V2_1_0),
29156            "2.2.0" => Ok(V2_2_0),
29157            _ => Err(stripe_types::StripeParseError),
29158        }
29159    }
29160}
29161impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
29162    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29163        f.write_str(self.as_str())
29164    }
29165}
29166
29167impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
29168    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29169        f.write_str(self.as_str())
29170    }
29171}
29172impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
29173    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29174    where
29175        S: serde::Serializer,
29176    {
29177        serializer.serialize_str(self.as_str())
29178    }
29179}
29180#[cfg(feature = "deserialize")]
29181impl<'de> serde::Deserialize<'de>
29182    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
29183{
29184    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29185        use std::str::FromStr;
29186        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29187        Self::from_str(&s).map_err(|_| {
29188            serde::de::Error::custom(
29189                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
29190            )
29191        })
29192    }
29193}
29194/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
29195#[derive(Copy, Clone, Debug, serde::Serialize)]
29196pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
29197    /// Controls when the funds are captured from the customer's account.
29198    ///
29199    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29200    ///
29201    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29202    #[serde(skip_serializing_if = "Option::is_none")]
29203    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod>,
29204    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
29205    #[serde(skip_serializing_if = "Option::is_none")]
29206    pub request_extended_authorization: Option<bool>,
29207    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
29208    /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
29209    #[serde(skip_serializing_if = "Option::is_none")]
29210    pub request_incremental_authorization_support: Option<bool>,
29211    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
29212    #[serde(skip_serializing_if = "Option::is_none")]
29213    pub routing: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting>,
29214}
29215impl ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
29216    pub fn new() -> Self {
29217        Self {
29218            capture_method: None,
29219            request_extended_authorization: None,
29220            request_incremental_authorization_support: None,
29221            routing: None,
29222        }
29223    }
29224}
29225impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
29226    fn default() -> Self {
29227        Self::new()
29228    }
29229}
29230/// Controls when the funds are captured from the customer's account.
29231///
29232/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29233///
29234/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29235#[derive(Copy, Clone, Eq, PartialEq)]
29236pub enum ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
29237    Manual,
29238    ManualPreferred,
29239}
29240impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
29241    pub fn as_str(self) -> &'static str {
29242        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
29243        match self {
29244            Manual => "manual",
29245            ManualPreferred => "manual_preferred",
29246        }
29247    }
29248}
29249
29250impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
29251    type Err = stripe_types::StripeParseError;
29252    fn from_str(s: &str) -> Result<Self, Self::Err> {
29253        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
29254        match s {
29255            "manual" => Ok(Manual),
29256            "manual_preferred" => Ok(ManualPreferred),
29257            _ => Err(stripe_types::StripeParseError),
29258        }
29259    }
29260}
29261impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
29262    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29263        f.write_str(self.as_str())
29264    }
29265}
29266
29267impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
29268    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29269        f.write_str(self.as_str())
29270    }
29271}
29272impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
29273    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29274    where
29275        S: serde::Serializer,
29276    {
29277        serializer.serialize_str(self.as_str())
29278    }
29279}
29280#[cfg(feature = "deserialize")]
29281impl<'de> serde::Deserialize<'de>
29282    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod
29283{
29284    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29285        use std::str::FromStr;
29286        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29287        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod"))
29288    }
29289}
29290/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
29291#[derive(Copy, Clone, Debug, serde::Serialize)]
29292pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
29293    /// Routing requested priority
29294    #[serde(skip_serializing_if = "Option::is_none")]
29295    pub requested_priority:
29296        Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
29297}
29298impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
29299    pub fn new() -> Self {
29300        Self { requested_priority: None }
29301    }
29302}
29303impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
29304    fn default() -> Self {
29305        Self::new()
29306    }
29307}
29308/// Routing requested priority
29309#[derive(Copy, Clone, Eq, PartialEq)]
29310pub enum ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
29311    Domestic,
29312    International,
29313}
29314impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
29315    pub fn as_str(self) -> &'static str {
29316        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
29317        match self {
29318            Domestic => "domestic",
29319            International => "international",
29320        }
29321    }
29322}
29323
29324impl std::str::FromStr
29325    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29326{
29327    type Err = stripe_types::StripeParseError;
29328    fn from_str(s: &str) -> Result<Self, Self::Err> {
29329        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
29330        match s {
29331            "domestic" => Ok(Domestic),
29332            "international" => Ok(International),
29333            _ => Err(stripe_types::StripeParseError),
29334        }
29335    }
29336}
29337impl std::fmt::Display
29338    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29339{
29340    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29341        f.write_str(self.as_str())
29342    }
29343}
29344
29345impl std::fmt::Debug
29346    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29347{
29348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29349        f.write_str(self.as_str())
29350    }
29351}
29352impl serde::Serialize
29353    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29354{
29355    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29356    where
29357        S: serde::Serializer,
29358    {
29359        serializer.serialize_str(self.as_str())
29360    }
29361}
29362#[cfg(feature = "deserialize")]
29363impl<'de> serde::Deserialize<'de>
29364    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29365{
29366    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29367        use std::str::FromStr;
29368        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29369        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
29370    }
29371}
29372/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
29373#[derive(Copy, Clone, Debug, serde::Serialize)]
29374pub struct ConfirmPaymentIntentPaymentMethodOptionsCashapp {
29375    /// Controls when the funds are captured from the customer's account.
29376    ///
29377    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29378    ///
29379    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29380    #[serde(skip_serializing_if = "Option::is_none")]
29381    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
29382    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29383    ///
29384    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29385    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29386    ///
29387    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29388    ///
29389    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29390    ///
29391    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29392    #[serde(skip_serializing_if = "Option::is_none")]
29393    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
29394}
29395impl ConfirmPaymentIntentPaymentMethodOptionsCashapp {
29396    pub fn new() -> Self {
29397        Self { capture_method: None, setup_future_usage: None }
29398    }
29399}
29400impl Default for ConfirmPaymentIntentPaymentMethodOptionsCashapp {
29401    fn default() -> Self {
29402        Self::new()
29403    }
29404}
29405/// Controls when the funds are captured from the customer's account.
29406///
29407/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
29408///
29409/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
29410#[derive(Copy, Clone, Eq, PartialEq)]
29411pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29412    Manual,
29413}
29414impl ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29415    pub fn as_str(self) -> &'static str {
29416        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
29417        match self {
29418            Manual => "manual",
29419        }
29420    }
29421}
29422
29423impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29424    type Err = stripe_types::StripeParseError;
29425    fn from_str(s: &str) -> Result<Self, Self::Err> {
29426        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
29427        match s {
29428            "manual" => Ok(Manual),
29429            _ => Err(stripe_types::StripeParseError),
29430        }
29431    }
29432}
29433impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29434    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29435        f.write_str(self.as_str())
29436    }
29437}
29438
29439impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29440    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29441        f.write_str(self.as_str())
29442    }
29443}
29444impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29445    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29446    where
29447        S: serde::Serializer,
29448    {
29449        serializer.serialize_str(self.as_str())
29450    }
29451}
29452#[cfg(feature = "deserialize")]
29453impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29454    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29455        use std::str::FromStr;
29456        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29457        Self::from_str(&s).map_err(|_| {
29458            serde::de::Error::custom(
29459                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod",
29460            )
29461        })
29462    }
29463}
29464/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29465///
29466/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29467/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29468///
29469/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29470///
29471/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29472///
29473/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29474#[derive(Copy, Clone, Eq, PartialEq)]
29475pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29476    None,
29477    OffSession,
29478    OnSession,
29479}
29480impl ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29481    pub fn as_str(self) -> &'static str {
29482        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
29483        match self {
29484            None => "none",
29485            OffSession => "off_session",
29486            OnSession => "on_session",
29487        }
29488    }
29489}
29490
29491impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29492    type Err = stripe_types::StripeParseError;
29493    fn from_str(s: &str) -> Result<Self, Self::Err> {
29494        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
29495        match s {
29496            "none" => Ok(None),
29497            "off_session" => Ok(OffSession),
29498            "on_session" => Ok(OnSession),
29499            _ => Err(stripe_types::StripeParseError),
29500        }
29501    }
29502}
29503impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29505        f.write_str(self.as_str())
29506    }
29507}
29508
29509impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29510    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29511        f.write_str(self.as_str())
29512    }
29513}
29514impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29515    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29516    where
29517        S: serde::Serializer,
29518    {
29519        serializer.serialize_str(self.as_str())
29520    }
29521}
29522#[cfg(feature = "deserialize")]
29523impl<'de> serde::Deserialize<'de>
29524    for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
29525{
29526    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29527        use std::str::FromStr;
29528        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29529        Self::from_str(&s).map_err(|_| {
29530            serde::de::Error::custom(
29531                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
29532            )
29533        })
29534    }
29535}
29536/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
29537#[derive(Copy, Clone, Debug, serde::Serialize)]
29538pub struct ConfirmPaymentIntentPaymentMethodOptionsCrypto {
29539    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29540    ///
29541    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29542    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29543    ///
29544    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29545    ///
29546    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29547    ///
29548    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29549    #[serde(skip_serializing_if = "Option::is_none")]
29550    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
29551}
29552impl ConfirmPaymentIntentPaymentMethodOptionsCrypto {
29553    pub fn new() -> Self {
29554        Self { setup_future_usage: None }
29555    }
29556}
29557impl Default for ConfirmPaymentIntentPaymentMethodOptionsCrypto {
29558    fn default() -> Self {
29559        Self::new()
29560    }
29561}
29562/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29563///
29564/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29565/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29566///
29567/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29568///
29569/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29570///
29571/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29572#[derive(Copy, Clone, Eq, PartialEq)]
29573pub enum ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29574    None,
29575}
29576impl ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29577    pub fn as_str(self) -> &'static str {
29578        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
29579        match self {
29580            None => "none",
29581        }
29582    }
29583}
29584
29585impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29586    type Err = stripe_types::StripeParseError;
29587    fn from_str(s: &str) -> Result<Self, Self::Err> {
29588        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
29589        match s {
29590            "none" => Ok(None),
29591            _ => Err(stripe_types::StripeParseError),
29592        }
29593    }
29594}
29595impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29596    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29597        f.write_str(self.as_str())
29598    }
29599}
29600
29601impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29602    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29603        f.write_str(self.as_str())
29604    }
29605}
29606impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29607    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29608    where
29609        S: serde::Serializer,
29610    {
29611        serializer.serialize_str(self.as_str())
29612    }
29613}
29614#[cfg(feature = "deserialize")]
29615impl<'de> serde::Deserialize<'de>
29616    for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
29617{
29618    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29619        use std::str::FromStr;
29620        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29621        Self::from_str(&s).map_err(|_| {
29622            serde::de::Error::custom(
29623                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
29624            )
29625        })
29626    }
29627}
29628/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
29629#[derive(Clone, Debug, serde::Serialize)]
29630pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
29631    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
29632    #[serde(skip_serializing_if = "Option::is_none")]
29633    pub bank_transfer: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
29634    /// The funding method type to be used when there are not enough funds in the customer balance.
29635    /// Permitted values include: `bank_transfer`.
29636    #[serde(skip_serializing_if = "Option::is_none")]
29637    pub funding_type: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
29638    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29639    ///
29640    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29641    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29642    ///
29643    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29644    ///
29645    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29646    ///
29647    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29648    #[serde(skip_serializing_if = "Option::is_none")]
29649    pub setup_future_usage:
29650        Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
29651}
29652impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
29653    pub fn new() -> Self {
29654        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
29655    }
29656}
29657impl Default for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
29658    fn default() -> Self {
29659        Self::new()
29660    }
29661}
29662/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
29663#[derive(Clone, Debug, serde::Serialize)]
29664pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
29665    /// Configuration for the eu_bank_transfer funding type.
29666#[serde(skip_serializing_if = "Option::is_none")]
29667pub eu_bank_transfer: Option<EuBankTransferParams>,
29668        /// List of address types that should be returned in the financial_addresses response.
29669    /// If not specified, all valid types will be returned.
29670    ///
29671    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
29672#[serde(skip_serializing_if = "Option::is_none")]
29673pub requested_address_types: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,
29674        /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
29675#[serde(rename = "type")]
29676pub type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
29677
29678}
29679impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
29680    pub fn new(
29681        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
29682    ) -> Self {
29683        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
29684    }
29685}
29686/// List of address types that should be returned in the financial_addresses response.
29687/// If not specified, all valid types will be returned.
29688///
29689/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
29690#[derive(Copy, Clone, Eq, PartialEq)]
29691pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
29692    Aba,
29693    Iban,
29694    Sepa,
29695    SortCode,
29696    Spei,
29697    Swift,
29698    Zengin,
29699}
29700impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
29701    pub fn as_str(self) -> &'static str {
29702        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
29703        match self {
29704            Aba => "aba",
29705            Iban => "iban",
29706            Sepa => "sepa",
29707            SortCode => "sort_code",
29708            Spei => "spei",
29709            Swift => "swift",
29710            Zengin => "zengin",
29711        }
29712    }
29713}
29714
29715impl std::str::FromStr
29716    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29717{
29718    type Err = stripe_types::StripeParseError;
29719    fn from_str(s: &str) -> Result<Self, Self::Err> {
29720        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
29721        match s {
29722            "aba" => Ok(Aba),
29723            "iban" => Ok(Iban),
29724            "sepa" => Ok(Sepa),
29725            "sort_code" => Ok(SortCode),
29726            "spei" => Ok(Spei),
29727            "swift" => Ok(Swift),
29728            "zengin" => Ok(Zengin),
29729            _ => Err(stripe_types::StripeParseError),
29730        }
29731    }
29732}
29733impl std::fmt::Display
29734    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29735{
29736    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29737        f.write_str(self.as_str())
29738    }
29739}
29740
29741impl std::fmt::Debug
29742    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29743{
29744    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29745        f.write_str(self.as_str())
29746    }
29747}
29748impl serde::Serialize
29749    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29750{
29751    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29752    where
29753        S: serde::Serializer,
29754    {
29755        serializer.serialize_str(self.as_str())
29756    }
29757}
29758#[cfg(feature = "deserialize")]
29759impl<'de> serde::Deserialize<'de>
29760    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29761{
29762    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29763        use std::str::FromStr;
29764        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29765        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
29766    }
29767}
29768/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
29769#[derive(Copy, Clone, Eq, PartialEq)]
29770pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29771    EuBankTransfer,
29772    GbBankTransfer,
29773    JpBankTransfer,
29774    MxBankTransfer,
29775    UsBankTransfer,
29776}
29777impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29778    pub fn as_str(self) -> &'static str {
29779        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
29780        match self {
29781            EuBankTransfer => "eu_bank_transfer",
29782            GbBankTransfer => "gb_bank_transfer",
29783            JpBankTransfer => "jp_bank_transfer",
29784            MxBankTransfer => "mx_bank_transfer",
29785            UsBankTransfer => "us_bank_transfer",
29786        }
29787    }
29788}
29789
29790impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29791    type Err = stripe_types::StripeParseError;
29792    fn from_str(s: &str) -> Result<Self, Self::Err> {
29793        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
29794        match s {
29795            "eu_bank_transfer" => Ok(EuBankTransfer),
29796            "gb_bank_transfer" => Ok(GbBankTransfer),
29797            "jp_bank_transfer" => Ok(JpBankTransfer),
29798            "mx_bank_transfer" => Ok(MxBankTransfer),
29799            "us_bank_transfer" => Ok(UsBankTransfer),
29800            _ => Err(stripe_types::StripeParseError),
29801        }
29802    }
29803}
29804impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29806        f.write_str(self.as_str())
29807    }
29808}
29809
29810impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29812        f.write_str(self.as_str())
29813    }
29814}
29815impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29817    where
29818        S: serde::Serializer,
29819    {
29820        serializer.serialize_str(self.as_str())
29821    }
29822}
29823#[cfg(feature = "deserialize")]
29824impl<'de> serde::Deserialize<'de>
29825    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
29826{
29827    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29828        use std::str::FromStr;
29829        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29830        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
29831    }
29832}
29833/// The funding method type to be used when there are not enough funds in the customer balance.
29834/// Permitted values include: `bank_transfer`.
29835#[derive(Copy, Clone, Eq, PartialEq)]
29836pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29837    BankTransfer,
29838}
29839impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29840    pub fn as_str(self) -> &'static str {
29841        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
29842        match self {
29843            BankTransfer => "bank_transfer",
29844        }
29845    }
29846}
29847
29848impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29849    type Err = stripe_types::StripeParseError;
29850    fn from_str(s: &str) -> Result<Self, Self::Err> {
29851        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
29852        match s {
29853            "bank_transfer" => Ok(BankTransfer),
29854            _ => Err(stripe_types::StripeParseError),
29855        }
29856    }
29857}
29858impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29859    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29860        f.write_str(self.as_str())
29861    }
29862}
29863
29864impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29865    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29866        f.write_str(self.as_str())
29867    }
29868}
29869impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29870    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29871    where
29872        S: serde::Serializer,
29873    {
29874        serializer.serialize_str(self.as_str())
29875    }
29876}
29877#[cfg(feature = "deserialize")]
29878impl<'de> serde::Deserialize<'de>
29879    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
29880{
29881    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29882        use std::str::FromStr;
29883        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29884        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
29885    }
29886}
29887/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29888///
29889/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29890/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29891///
29892/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29893///
29894/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29895///
29896/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29897#[derive(Copy, Clone, Eq, PartialEq)]
29898pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29899    None,
29900}
29901impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29902    pub fn as_str(self) -> &'static str {
29903        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
29904        match self {
29905            None => "none",
29906        }
29907    }
29908}
29909
29910impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29911    type Err = stripe_types::StripeParseError;
29912    fn from_str(s: &str) -> Result<Self, Self::Err> {
29913        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
29914        match s {
29915            "none" => Ok(None),
29916            _ => Err(stripe_types::StripeParseError),
29917        }
29918    }
29919}
29920impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29921    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29922        f.write_str(self.as_str())
29923    }
29924}
29925
29926impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29927    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29928        f.write_str(self.as_str())
29929    }
29930}
29931impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29932    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29933    where
29934        S: serde::Serializer,
29935    {
29936        serializer.serialize_str(self.as_str())
29937    }
29938}
29939#[cfg(feature = "deserialize")]
29940impl<'de> serde::Deserialize<'de>
29941    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
29942{
29943    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29944        use std::str::FromStr;
29945        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29946        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
29947    }
29948}
29949/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
29950#[derive(Copy, Clone, Debug, serde::Serialize)]
29951pub struct ConfirmPaymentIntentPaymentMethodOptionsEps {
29952    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29953    ///
29954    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29955    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29956    ///
29957    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29958    ///
29959    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29960    ///
29961    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29962    #[serde(skip_serializing_if = "Option::is_none")]
29963    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
29964}
29965impl ConfirmPaymentIntentPaymentMethodOptionsEps {
29966    pub fn new() -> Self {
29967        Self { setup_future_usage: None }
29968    }
29969}
29970impl Default for ConfirmPaymentIntentPaymentMethodOptionsEps {
29971    fn default() -> Self {
29972        Self::new()
29973    }
29974}
29975/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29976///
29977/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29978/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29979///
29980/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29981///
29982/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29983///
29984/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29985#[derive(Copy, Clone, Eq, PartialEq)]
29986pub enum ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29987    None,
29988}
29989impl ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29990    pub fn as_str(self) -> &'static str {
29991        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
29992        match self {
29993            None => "none",
29994        }
29995    }
29996}
29997
29998impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29999    type Err = stripe_types::StripeParseError;
30000    fn from_str(s: &str) -> Result<Self, Self::Err> {
30001        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
30002        match s {
30003            "none" => Ok(None),
30004            _ => Err(stripe_types::StripeParseError),
30005        }
30006    }
30007}
30008impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
30009    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30010        f.write_str(self.as_str())
30011    }
30012}
30013
30014impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
30015    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30016        f.write_str(self.as_str())
30017    }
30018}
30019impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
30020    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30021    where
30022        S: serde::Serializer,
30023    {
30024        serializer.serialize_str(self.as_str())
30025    }
30026}
30027#[cfg(feature = "deserialize")]
30028impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
30029    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30030        use std::str::FromStr;
30031        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30032        Self::from_str(&s).map_err(|_| {
30033            serde::de::Error::custom(
30034                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
30035            )
30036        })
30037    }
30038}
30039/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
30040#[derive(Copy, Clone, Debug, serde::Serialize)]
30041pub struct ConfirmPaymentIntentPaymentMethodOptionsFpx {
30042    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30043    ///
30044    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30045    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30046    ///
30047    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30048    ///
30049    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30050    ///
30051    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30052    #[serde(skip_serializing_if = "Option::is_none")]
30053    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
30054}
30055impl ConfirmPaymentIntentPaymentMethodOptionsFpx {
30056    pub fn new() -> Self {
30057        Self { setup_future_usage: None }
30058    }
30059}
30060impl Default for ConfirmPaymentIntentPaymentMethodOptionsFpx {
30061    fn default() -> Self {
30062        Self::new()
30063    }
30064}
30065/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30066///
30067/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30068/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30069///
30070/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30071///
30072/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30073///
30074/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30075#[derive(Copy, Clone, Eq, PartialEq)]
30076pub enum ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30077    None,
30078}
30079impl ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30080    pub fn as_str(self) -> &'static str {
30081        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
30082        match self {
30083            None => "none",
30084        }
30085    }
30086}
30087
30088impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30089    type Err = stripe_types::StripeParseError;
30090    fn from_str(s: &str) -> Result<Self, Self::Err> {
30091        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
30092        match s {
30093            "none" => Ok(None),
30094            _ => Err(stripe_types::StripeParseError),
30095        }
30096    }
30097}
30098impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30099    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30100        f.write_str(self.as_str())
30101    }
30102}
30103
30104impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30106        f.write_str(self.as_str())
30107    }
30108}
30109impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30110    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30111    where
30112        S: serde::Serializer,
30113    {
30114        serializer.serialize_str(self.as_str())
30115    }
30116}
30117#[cfg(feature = "deserialize")]
30118impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
30119    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30120        use std::str::FromStr;
30121        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30122        Self::from_str(&s).map_err(|_| {
30123            serde::de::Error::custom(
30124                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
30125            )
30126        })
30127    }
30128}
30129/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
30130#[derive(Copy, Clone, Debug, serde::Serialize)]
30131pub struct ConfirmPaymentIntentPaymentMethodOptionsGiropay {
30132    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30133    ///
30134    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30135    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30136    ///
30137    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30138    ///
30139    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30140    ///
30141    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30142    #[serde(skip_serializing_if = "Option::is_none")]
30143    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
30144}
30145impl ConfirmPaymentIntentPaymentMethodOptionsGiropay {
30146    pub fn new() -> Self {
30147        Self { setup_future_usage: None }
30148    }
30149}
30150impl Default for ConfirmPaymentIntentPaymentMethodOptionsGiropay {
30151    fn default() -> Self {
30152        Self::new()
30153    }
30154}
30155/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30156///
30157/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30158/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30159///
30160/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30161///
30162/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30163///
30164/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30165#[derive(Copy, Clone, Eq, PartialEq)]
30166pub enum ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
30167    None,
30168}
30169impl ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
30170    pub fn as_str(self) -> &'static str {
30171        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
30172        match self {
30173            None => "none",
30174        }
30175    }
30176}
30177
30178impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
30179    type Err = stripe_types::StripeParseError;
30180    fn from_str(s: &str) -> Result<Self, Self::Err> {
30181        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
30182        match s {
30183            "none" => Ok(None),
30184            _ => Err(stripe_types::StripeParseError),
30185        }
30186    }
30187}
30188impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
30189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30190        f.write_str(self.as_str())
30191    }
30192}
30193
30194impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
30195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30196        f.write_str(self.as_str())
30197    }
30198}
30199impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
30200    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30201    where
30202        S: serde::Serializer,
30203    {
30204        serializer.serialize_str(self.as_str())
30205    }
30206}
30207#[cfg(feature = "deserialize")]
30208impl<'de> serde::Deserialize<'de>
30209    for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
30210{
30211    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30212        use std::str::FromStr;
30213        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30214        Self::from_str(&s).map_err(|_| {
30215            serde::de::Error::custom(
30216                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
30217            )
30218        })
30219    }
30220}
30221/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
30222#[derive(Copy, Clone, Debug, serde::Serialize)]
30223pub struct ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
30224    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30225    ///
30226    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30227    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30228    ///
30229    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30230    ///
30231    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30232    ///
30233    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30234    #[serde(skip_serializing_if = "Option::is_none")]
30235    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
30236}
30237impl ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
30238    pub fn new() -> Self {
30239        Self { setup_future_usage: None }
30240    }
30241}
30242impl Default for ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
30243    fn default() -> Self {
30244        Self::new()
30245    }
30246}
30247/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30248///
30249/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30250/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30251///
30252/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30253///
30254/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30255///
30256/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30257#[derive(Copy, Clone, Eq, PartialEq)]
30258pub enum ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30259    None,
30260}
30261impl ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30262    pub fn as_str(self) -> &'static str {
30263        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
30264        match self {
30265            None => "none",
30266        }
30267    }
30268}
30269
30270impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30271    type Err = stripe_types::StripeParseError;
30272    fn from_str(s: &str) -> Result<Self, Self::Err> {
30273        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
30274        match s {
30275            "none" => Ok(None),
30276            _ => Err(stripe_types::StripeParseError),
30277        }
30278    }
30279}
30280impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30281    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30282        f.write_str(self.as_str())
30283    }
30284}
30285
30286impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30287    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30288        f.write_str(self.as_str())
30289    }
30290}
30291impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30292    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30293    where
30294        S: serde::Serializer,
30295    {
30296        serializer.serialize_str(self.as_str())
30297    }
30298}
30299#[cfg(feature = "deserialize")]
30300impl<'de> serde::Deserialize<'de>
30301    for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
30302{
30303    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30304        use std::str::FromStr;
30305        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30306        Self::from_str(&s).map_err(|_| {
30307            serde::de::Error::custom(
30308                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
30309            )
30310        })
30311    }
30312}
30313/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
30314#[derive(Copy, Clone, Debug, serde::Serialize)]
30315pub struct ConfirmPaymentIntentPaymentMethodOptionsIdeal {
30316    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30317    ///
30318    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30319    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30320    ///
30321    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30322    ///
30323    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30324    ///
30325    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30326    #[serde(skip_serializing_if = "Option::is_none")]
30327    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
30328}
30329impl ConfirmPaymentIntentPaymentMethodOptionsIdeal {
30330    pub fn new() -> Self {
30331        Self { setup_future_usage: None }
30332    }
30333}
30334impl Default for ConfirmPaymentIntentPaymentMethodOptionsIdeal {
30335    fn default() -> Self {
30336        Self::new()
30337    }
30338}
30339/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30340///
30341/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30342/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30343///
30344/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30345///
30346/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30347///
30348/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30349#[derive(Copy, Clone, Eq, PartialEq)]
30350pub enum ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30351    None,
30352    OffSession,
30353}
30354impl ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30355    pub fn as_str(self) -> &'static str {
30356        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
30357        match self {
30358            None => "none",
30359            OffSession => "off_session",
30360        }
30361    }
30362}
30363
30364impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30365    type Err = stripe_types::StripeParseError;
30366    fn from_str(s: &str) -> Result<Self, Self::Err> {
30367        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
30368        match s {
30369            "none" => Ok(None),
30370            "off_session" => Ok(OffSession),
30371            _ => Err(stripe_types::StripeParseError),
30372        }
30373    }
30374}
30375impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30376    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30377        f.write_str(self.as_str())
30378    }
30379}
30380
30381impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30382    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30383        f.write_str(self.as_str())
30384    }
30385}
30386impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30387    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30388    where
30389        S: serde::Serializer,
30390    {
30391        serializer.serialize_str(self.as_str())
30392    }
30393}
30394#[cfg(feature = "deserialize")]
30395impl<'de> serde::Deserialize<'de>
30396    for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage
30397{
30398    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30399        use std::str::FromStr;
30400        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30401        Self::from_str(&s).map_err(|_| {
30402            serde::de::Error::custom(
30403                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
30404            )
30405        })
30406    }
30407}
30408/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
30409#[derive(Copy, Clone, Debug, serde::Serialize)]
30410pub struct ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
30411    /// Controls when the funds are captured from the customer's account.
30412    ///
30413    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30414    ///
30415    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30416    #[serde(skip_serializing_if = "Option::is_none")]
30417    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
30418    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30419    ///
30420    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30421    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30422    ///
30423    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30424    ///
30425    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30426    #[serde(skip_serializing_if = "Option::is_none")]
30427    pub setup_future_usage:
30428        Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
30429}
30430impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
30431    pub fn new() -> Self {
30432        Self { capture_method: None, setup_future_usage: None }
30433    }
30434}
30435impl Default for ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
30436    fn default() -> Self {
30437        Self::new()
30438    }
30439}
30440/// Controls when the funds are captured from the customer's account.
30441///
30442/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30443///
30444/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30445#[derive(Copy, Clone, Eq, PartialEq)]
30446pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30447    Manual,
30448}
30449impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30450    pub fn as_str(self) -> &'static str {
30451        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
30452        match self {
30453            Manual => "manual",
30454        }
30455    }
30456}
30457
30458impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30459    type Err = stripe_types::StripeParseError;
30460    fn from_str(s: &str) -> Result<Self, Self::Err> {
30461        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
30462        match s {
30463            "manual" => Ok(Manual),
30464            _ => Err(stripe_types::StripeParseError),
30465        }
30466    }
30467}
30468impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30469    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30470        f.write_str(self.as_str())
30471    }
30472}
30473
30474impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30475    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30476        f.write_str(self.as_str())
30477    }
30478}
30479impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30480    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30481    where
30482        S: serde::Serializer,
30483    {
30484        serializer.serialize_str(self.as_str())
30485    }
30486}
30487#[cfg(feature = "deserialize")]
30488impl<'de> serde::Deserialize<'de>
30489    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod
30490{
30491    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30492        use std::str::FromStr;
30493        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30494        Self::from_str(&s).map_err(|_| {
30495            serde::de::Error::custom(
30496                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
30497            )
30498        })
30499    }
30500}
30501/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30502///
30503/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30504/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30505///
30506/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30507///
30508/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30509#[derive(Copy, Clone, Eq, PartialEq)]
30510pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30511    None,
30512    OffSession,
30513}
30514impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30515    pub fn as_str(self) -> &'static str {
30516        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
30517        match self {
30518            None => "none",
30519            OffSession => "off_session",
30520        }
30521    }
30522}
30523
30524impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30525    type Err = stripe_types::StripeParseError;
30526    fn from_str(s: &str) -> Result<Self, Self::Err> {
30527        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
30528        match s {
30529            "none" => Ok(None),
30530            "off_session" => Ok(OffSession),
30531            _ => Err(stripe_types::StripeParseError),
30532        }
30533    }
30534}
30535impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30536    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30537        f.write_str(self.as_str())
30538    }
30539}
30540
30541impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30542    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30543        f.write_str(self.as_str())
30544    }
30545}
30546impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30547    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30548    where
30549        S: serde::Serializer,
30550    {
30551        serializer.serialize_str(self.as_str())
30552    }
30553}
30554#[cfg(feature = "deserialize")]
30555impl<'de> serde::Deserialize<'de>
30556    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
30557{
30558    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30559        use std::str::FromStr;
30560        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30561        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage"))
30562    }
30563}
30564/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
30565#[derive(Clone, Debug, serde::Serialize)]
30566pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarna {
30567    /// Controls when the funds are captured from the customer's account.
30568    ///
30569    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30570    ///
30571    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30572    #[serde(skip_serializing_if = "Option::is_none")]
30573    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
30574    /// On-demand details if setting up or charging an on-demand payment.
30575    #[serde(skip_serializing_if = "Option::is_none")]
30576    pub on_demand: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
30577    /// Preferred language of the Klarna authorization page that the customer is redirected to
30578    #[serde(skip_serializing_if = "Option::is_none")]
30579    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
30580    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30581    ///
30582    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30583    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30584    ///
30585    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30586    ///
30587    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30588    ///
30589    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30590    #[serde(skip_serializing_if = "Option::is_none")]
30591    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
30592    /// Subscription details if setting up or charging a subscription.
30593    #[serde(skip_serializing_if = "Option::is_none")]
30594    pub subscriptions: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
30595}
30596impl ConfirmPaymentIntentPaymentMethodOptionsKlarna {
30597    pub fn new() -> Self {
30598        Self {
30599            capture_method: None,
30600            on_demand: None,
30601            preferred_locale: None,
30602            setup_future_usage: None,
30603            subscriptions: None,
30604        }
30605    }
30606}
30607impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarna {
30608    fn default() -> Self {
30609        Self::new()
30610    }
30611}
30612/// Controls when the funds are captured from the customer's account.
30613///
30614/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
30615///
30616/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
30617#[derive(Copy, Clone, Eq, PartialEq)]
30618pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30619    Manual,
30620}
30621impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30622    pub fn as_str(self) -> &'static str {
30623        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
30624        match self {
30625            Manual => "manual",
30626        }
30627    }
30628}
30629
30630impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30631    type Err = stripe_types::StripeParseError;
30632    fn from_str(s: &str) -> Result<Self, Self::Err> {
30633        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
30634        match s {
30635            "manual" => Ok(Manual),
30636            _ => Err(stripe_types::StripeParseError),
30637        }
30638    }
30639}
30640impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30641    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30642        f.write_str(self.as_str())
30643    }
30644}
30645
30646impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30648        f.write_str(self.as_str())
30649    }
30650}
30651impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30652    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30653    where
30654        S: serde::Serializer,
30655    {
30656        serializer.serialize_str(self.as_str())
30657    }
30658}
30659#[cfg(feature = "deserialize")]
30660impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30661    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30662        use std::str::FromStr;
30663        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30664        Self::from_str(&s).map_err(|_| {
30665            serde::de::Error::custom(
30666                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
30667            )
30668        })
30669    }
30670}
30671/// On-demand details if setting up or charging an on-demand payment.
30672#[derive(Copy, Clone, Debug, serde::Serialize)]
30673pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
30674    /// Your average amount value.
30675    /// You can use a value across your customer base, or segment based on customer type, country, etc.
30676    #[serde(skip_serializing_if = "Option::is_none")]
30677    pub average_amount: Option<i64>,
30678    /// The maximum value you may charge a customer per purchase.
30679    /// You can use a value across your customer base, or segment based on customer type, country, etc.
30680    #[serde(skip_serializing_if = "Option::is_none")]
30681    pub maximum_amount: Option<i64>,
30682    /// The lowest or minimum value you may charge a customer per purchase.
30683    /// You can use a value across your customer base, or segment based on customer type, country, etc.
30684    #[serde(skip_serializing_if = "Option::is_none")]
30685    pub minimum_amount: Option<i64>,
30686    /// Interval at which the customer is making purchases
30687    #[serde(skip_serializing_if = "Option::is_none")]
30688    pub purchase_interval:
30689        Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
30690    /// The number of `purchase_interval` between charges
30691    #[serde(skip_serializing_if = "Option::is_none")]
30692    pub purchase_interval_count: Option<u64>,
30693}
30694impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
30695    pub fn new() -> Self {
30696        Self {
30697            average_amount: None,
30698            maximum_amount: None,
30699            minimum_amount: None,
30700            purchase_interval: None,
30701            purchase_interval_count: None,
30702        }
30703    }
30704}
30705impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
30706    fn default() -> Self {
30707        Self::new()
30708    }
30709}
30710/// Interval at which the customer is making purchases
30711#[derive(Copy, Clone, Eq, PartialEq)]
30712pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30713    Day,
30714    Month,
30715    Week,
30716    Year,
30717}
30718impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30719    pub fn as_str(self) -> &'static str {
30720        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
30721        match self {
30722            Day => "day",
30723            Month => "month",
30724            Week => "week",
30725            Year => "year",
30726        }
30727    }
30728}
30729
30730impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30731    type Err = stripe_types::StripeParseError;
30732    fn from_str(s: &str) -> Result<Self, Self::Err> {
30733        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
30734        match s {
30735            "day" => Ok(Day),
30736            "month" => Ok(Month),
30737            "week" => Ok(Week),
30738            "year" => Ok(Year),
30739            _ => Err(stripe_types::StripeParseError),
30740        }
30741    }
30742}
30743impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30744    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30745        f.write_str(self.as_str())
30746    }
30747}
30748
30749impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30750    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30751        f.write_str(self.as_str())
30752    }
30753}
30754impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30755    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30756    where
30757        S: serde::Serializer,
30758    {
30759        serializer.serialize_str(self.as_str())
30760    }
30761}
30762#[cfg(feature = "deserialize")]
30763impl<'de> serde::Deserialize<'de>
30764    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
30765{
30766    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30767        use std::str::FromStr;
30768        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30769        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
30770    }
30771}
30772/// Preferred language of the Klarna authorization page that the customer is redirected to
30773#[derive(Clone, Eq, PartialEq)]
30774#[non_exhaustive]
30775pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30776    CsMinusCz,
30777    DaMinusDk,
30778    DeMinusAt,
30779    DeMinusCh,
30780    DeMinusDe,
30781    ElMinusGr,
30782    EnMinusAt,
30783    EnMinusAu,
30784    EnMinusBe,
30785    EnMinusCa,
30786    EnMinusCh,
30787    EnMinusCz,
30788    EnMinusDe,
30789    EnMinusDk,
30790    EnMinusEs,
30791    EnMinusFi,
30792    EnMinusFr,
30793    EnMinusGb,
30794    EnMinusGr,
30795    EnMinusIe,
30796    EnMinusIt,
30797    EnMinusNl,
30798    EnMinusNo,
30799    EnMinusNz,
30800    EnMinusPl,
30801    EnMinusPt,
30802    EnMinusRo,
30803    EnMinusSe,
30804    EnMinusUs,
30805    EsMinusEs,
30806    EsMinusUs,
30807    FiMinusFi,
30808    FrMinusBe,
30809    FrMinusCa,
30810    FrMinusCh,
30811    FrMinusFr,
30812    ItMinusCh,
30813    ItMinusIt,
30814    NbMinusNo,
30815    NlMinusBe,
30816    NlMinusNl,
30817    PlMinusPl,
30818    PtMinusPt,
30819    RoMinusRo,
30820    SvMinusFi,
30821    SvMinusSe,
30822    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30823    Unknown(String),
30824}
30825impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30826    pub fn as_str(&self) -> &str {
30827        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
30828        match self {
30829            CsMinusCz => "cs-CZ",
30830            DaMinusDk => "da-DK",
30831            DeMinusAt => "de-AT",
30832            DeMinusCh => "de-CH",
30833            DeMinusDe => "de-DE",
30834            ElMinusGr => "el-GR",
30835            EnMinusAt => "en-AT",
30836            EnMinusAu => "en-AU",
30837            EnMinusBe => "en-BE",
30838            EnMinusCa => "en-CA",
30839            EnMinusCh => "en-CH",
30840            EnMinusCz => "en-CZ",
30841            EnMinusDe => "en-DE",
30842            EnMinusDk => "en-DK",
30843            EnMinusEs => "en-ES",
30844            EnMinusFi => "en-FI",
30845            EnMinusFr => "en-FR",
30846            EnMinusGb => "en-GB",
30847            EnMinusGr => "en-GR",
30848            EnMinusIe => "en-IE",
30849            EnMinusIt => "en-IT",
30850            EnMinusNl => "en-NL",
30851            EnMinusNo => "en-NO",
30852            EnMinusNz => "en-NZ",
30853            EnMinusPl => "en-PL",
30854            EnMinusPt => "en-PT",
30855            EnMinusRo => "en-RO",
30856            EnMinusSe => "en-SE",
30857            EnMinusUs => "en-US",
30858            EsMinusEs => "es-ES",
30859            EsMinusUs => "es-US",
30860            FiMinusFi => "fi-FI",
30861            FrMinusBe => "fr-BE",
30862            FrMinusCa => "fr-CA",
30863            FrMinusCh => "fr-CH",
30864            FrMinusFr => "fr-FR",
30865            ItMinusCh => "it-CH",
30866            ItMinusIt => "it-IT",
30867            NbMinusNo => "nb-NO",
30868            NlMinusBe => "nl-BE",
30869            NlMinusNl => "nl-NL",
30870            PlMinusPl => "pl-PL",
30871            PtMinusPt => "pt-PT",
30872            RoMinusRo => "ro-RO",
30873            SvMinusFi => "sv-FI",
30874            SvMinusSe => "sv-SE",
30875            Unknown(v) => v,
30876        }
30877    }
30878}
30879
30880impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30881    type Err = std::convert::Infallible;
30882    fn from_str(s: &str) -> Result<Self, Self::Err> {
30883        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
30884        match s {
30885            "cs-CZ" => Ok(CsMinusCz),
30886            "da-DK" => Ok(DaMinusDk),
30887            "de-AT" => Ok(DeMinusAt),
30888            "de-CH" => Ok(DeMinusCh),
30889            "de-DE" => Ok(DeMinusDe),
30890            "el-GR" => Ok(ElMinusGr),
30891            "en-AT" => Ok(EnMinusAt),
30892            "en-AU" => Ok(EnMinusAu),
30893            "en-BE" => Ok(EnMinusBe),
30894            "en-CA" => Ok(EnMinusCa),
30895            "en-CH" => Ok(EnMinusCh),
30896            "en-CZ" => Ok(EnMinusCz),
30897            "en-DE" => Ok(EnMinusDe),
30898            "en-DK" => Ok(EnMinusDk),
30899            "en-ES" => Ok(EnMinusEs),
30900            "en-FI" => Ok(EnMinusFi),
30901            "en-FR" => Ok(EnMinusFr),
30902            "en-GB" => Ok(EnMinusGb),
30903            "en-GR" => Ok(EnMinusGr),
30904            "en-IE" => Ok(EnMinusIe),
30905            "en-IT" => Ok(EnMinusIt),
30906            "en-NL" => Ok(EnMinusNl),
30907            "en-NO" => Ok(EnMinusNo),
30908            "en-NZ" => Ok(EnMinusNz),
30909            "en-PL" => Ok(EnMinusPl),
30910            "en-PT" => Ok(EnMinusPt),
30911            "en-RO" => Ok(EnMinusRo),
30912            "en-SE" => Ok(EnMinusSe),
30913            "en-US" => Ok(EnMinusUs),
30914            "es-ES" => Ok(EsMinusEs),
30915            "es-US" => Ok(EsMinusUs),
30916            "fi-FI" => Ok(FiMinusFi),
30917            "fr-BE" => Ok(FrMinusBe),
30918            "fr-CA" => Ok(FrMinusCa),
30919            "fr-CH" => Ok(FrMinusCh),
30920            "fr-FR" => Ok(FrMinusFr),
30921            "it-CH" => Ok(ItMinusCh),
30922            "it-IT" => Ok(ItMinusIt),
30923            "nb-NO" => Ok(NbMinusNo),
30924            "nl-BE" => Ok(NlMinusBe),
30925            "nl-NL" => Ok(NlMinusNl),
30926            "pl-PL" => Ok(PlMinusPl),
30927            "pt-PT" => Ok(PtMinusPt),
30928            "ro-RO" => Ok(RoMinusRo),
30929            "sv-FI" => Ok(SvMinusFi),
30930            "sv-SE" => Ok(SvMinusSe),
30931            v => Ok(Unknown(v.to_owned())),
30932        }
30933    }
30934}
30935impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30936    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30937        f.write_str(self.as_str())
30938    }
30939}
30940
30941impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30942    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30943        f.write_str(self.as_str())
30944    }
30945}
30946impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30947    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30948    where
30949        S: serde::Serializer,
30950    {
30951        serializer.serialize_str(self.as_str())
30952    }
30953}
30954#[cfg(feature = "deserialize")]
30955impl<'de> serde::Deserialize<'de>
30956    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale
30957{
30958    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30959        use std::str::FromStr;
30960        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30961        Ok(Self::from_str(&s).unwrap())
30962    }
30963}
30964/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30965///
30966/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30967/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30968///
30969/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30970///
30971/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30972///
30973/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30974#[derive(Copy, Clone, Eq, PartialEq)]
30975pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30976    None,
30977    OffSession,
30978    OnSession,
30979}
30980impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30981    pub fn as_str(self) -> &'static str {
30982        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
30983        match self {
30984            None => "none",
30985            OffSession => "off_session",
30986            OnSession => "on_session",
30987        }
30988    }
30989}
30990
30991impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30992    type Err = stripe_types::StripeParseError;
30993    fn from_str(s: &str) -> Result<Self, Self::Err> {
30994        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
30995        match s {
30996            "none" => Ok(None),
30997            "off_session" => Ok(OffSession),
30998            "on_session" => Ok(OnSession),
30999            _ => Err(stripe_types::StripeParseError),
31000        }
31001    }
31002}
31003impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
31004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31005        f.write_str(self.as_str())
31006    }
31007}
31008
31009impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
31010    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31011        f.write_str(self.as_str())
31012    }
31013}
31014impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
31015    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31016    where
31017        S: serde::Serializer,
31018    {
31019        serializer.serialize_str(self.as_str())
31020    }
31021}
31022#[cfg(feature = "deserialize")]
31023impl<'de> serde::Deserialize<'de>
31024    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
31025{
31026    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31027        use std::str::FromStr;
31028        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31029        Self::from_str(&s).map_err(|_| {
31030            serde::de::Error::custom(
31031                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
31032            )
31033        })
31034    }
31035}
31036/// Subscription details if setting up or charging a subscription.
31037#[derive(Clone, Debug, serde::Serialize)]
31038pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
31039    /// Unit of time between subscription charges.
31040    pub interval: ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
31041    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
31042    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
31043    #[serde(skip_serializing_if = "Option::is_none")]
31044    pub interval_count: Option<u64>,
31045    /// Name for subscription.
31046    #[serde(skip_serializing_if = "Option::is_none")]
31047    pub name: Option<String>,
31048    /// Describes the upcoming charge for this subscription.
31049    #[serde(skip_serializing_if = "Option::is_none")]
31050    pub next_billing: Option<SubscriptionNextBillingParam>,
31051    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
31052    /// Use a value that persists across subscription charges.
31053    pub reference: String,
31054}
31055impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
31056    pub fn new(
31057        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
31058        reference: impl Into<String>,
31059    ) -> Self {
31060        Self {
31061            interval: interval.into(),
31062            interval_count: None,
31063            name: None,
31064            next_billing: None,
31065            reference: reference.into(),
31066        }
31067    }
31068}
31069/// Unit of time between subscription charges.
31070#[derive(Copy, Clone, Eq, PartialEq)]
31071pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
31072    Day,
31073    Month,
31074    Week,
31075    Year,
31076}
31077impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
31078    pub fn as_str(self) -> &'static str {
31079        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
31080        match self {
31081            Day => "day",
31082            Month => "month",
31083            Week => "week",
31084            Year => "year",
31085        }
31086    }
31087}
31088
31089impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
31090    type Err = stripe_types::StripeParseError;
31091    fn from_str(s: &str) -> Result<Self, Self::Err> {
31092        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
31093        match s {
31094            "day" => Ok(Day),
31095            "month" => Ok(Month),
31096            "week" => Ok(Week),
31097            "year" => Ok(Year),
31098            _ => Err(stripe_types::StripeParseError),
31099        }
31100    }
31101}
31102impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
31103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31104        f.write_str(self.as_str())
31105    }
31106}
31107
31108impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
31109    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31110        f.write_str(self.as_str())
31111    }
31112}
31113impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
31114    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31115    where
31116        S: serde::Serializer,
31117    {
31118        serializer.serialize_str(self.as_str())
31119    }
31120}
31121#[cfg(feature = "deserialize")]
31122impl<'de> serde::Deserialize<'de>
31123    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
31124{
31125    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31126        use std::str::FromStr;
31127        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31128        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
31129    }
31130}
31131/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
31132#[derive(Clone, Debug, serde::Serialize)]
31133pub struct ConfirmPaymentIntentPaymentMethodOptionsKonbini {
31134    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
31135    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
31136    /// We recommend to use the customer's phone number.
31137    #[serde(skip_serializing_if = "Option::is_none")]
31138    pub confirmation_number: Option<String>,
31139    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
31140    /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST.
31141    /// Defaults to 3 days.
31142    #[serde(skip_serializing_if = "Option::is_none")]
31143    pub expires_after_days: Option<u32>,
31144    /// The timestamp at which the Konbini payment instructions will expire.
31145    /// Only one of `expires_after_days` or `expires_at` may be set.
31146    #[serde(skip_serializing_if = "Option::is_none")]
31147    pub expires_at: Option<stripe_types::Timestamp>,
31148    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
31149    #[serde(skip_serializing_if = "Option::is_none")]
31150    pub product_description: Option<String>,
31151    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31152    ///
31153    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31154    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31155    ///
31156    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31157    ///
31158    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31159    ///
31160    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31161    #[serde(skip_serializing_if = "Option::is_none")]
31162    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
31163}
31164impl ConfirmPaymentIntentPaymentMethodOptionsKonbini {
31165    pub fn new() -> Self {
31166        Self {
31167            confirmation_number: None,
31168            expires_after_days: None,
31169            expires_at: None,
31170            product_description: None,
31171            setup_future_usage: None,
31172        }
31173    }
31174}
31175impl Default for ConfirmPaymentIntentPaymentMethodOptionsKonbini {
31176    fn default() -> Self {
31177        Self::new()
31178    }
31179}
31180/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31181///
31182/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31183/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31184///
31185/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31186///
31187/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31188///
31189/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31190#[derive(Copy, Clone, Eq, PartialEq)]
31191pub enum ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
31192    None,
31193}
31194impl ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
31195    pub fn as_str(self) -> &'static str {
31196        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
31197        match self {
31198            None => "none",
31199        }
31200    }
31201}
31202
31203impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
31204    type Err = stripe_types::StripeParseError;
31205    fn from_str(s: &str) -> Result<Self, Self::Err> {
31206        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
31207        match s {
31208            "none" => Ok(None),
31209            _ => Err(stripe_types::StripeParseError),
31210        }
31211    }
31212}
31213impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
31214    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31215        f.write_str(self.as_str())
31216    }
31217}
31218
31219impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
31220    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31221        f.write_str(self.as_str())
31222    }
31223}
31224impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
31225    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31226    where
31227        S: serde::Serializer,
31228    {
31229        serializer.serialize_str(self.as_str())
31230    }
31231}
31232#[cfg(feature = "deserialize")]
31233impl<'de> serde::Deserialize<'de>
31234    for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
31235{
31236    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31237        use std::str::FromStr;
31238        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31239        Self::from_str(&s).map_err(|_| {
31240            serde::de::Error::custom(
31241                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
31242            )
31243        })
31244    }
31245}
31246/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
31247#[derive(Copy, Clone, Debug, serde::Serialize)]
31248pub struct ConfirmPaymentIntentPaymentMethodOptionsKrCard {
31249    /// Controls when the funds are captured from the customer's account.
31250    ///
31251    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31252    ///
31253    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31254    #[serde(skip_serializing_if = "Option::is_none")]
31255    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
31256    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31257    ///
31258    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31259    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31260    ///
31261    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31262    ///
31263    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31264    #[serde(skip_serializing_if = "Option::is_none")]
31265    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
31266}
31267impl ConfirmPaymentIntentPaymentMethodOptionsKrCard {
31268    pub fn new() -> Self {
31269        Self { capture_method: None, setup_future_usage: None }
31270    }
31271}
31272impl Default for ConfirmPaymentIntentPaymentMethodOptionsKrCard {
31273    fn default() -> Self {
31274        Self::new()
31275    }
31276}
31277/// Controls when the funds are captured from the customer's account.
31278///
31279/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31280///
31281/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31282#[derive(Copy, Clone, Eq, PartialEq)]
31283pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31284    Manual,
31285}
31286impl ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31287    pub fn as_str(self) -> &'static str {
31288        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
31289        match self {
31290            Manual => "manual",
31291        }
31292    }
31293}
31294
31295impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31296    type Err = stripe_types::StripeParseError;
31297    fn from_str(s: &str) -> Result<Self, Self::Err> {
31298        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
31299        match s {
31300            "manual" => Ok(Manual),
31301            _ => Err(stripe_types::StripeParseError),
31302        }
31303    }
31304}
31305impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31306    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31307        f.write_str(self.as_str())
31308    }
31309}
31310
31311impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31312    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31313        f.write_str(self.as_str())
31314    }
31315}
31316impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31317    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31318    where
31319        S: serde::Serializer,
31320    {
31321        serializer.serialize_str(self.as_str())
31322    }
31323}
31324#[cfg(feature = "deserialize")]
31325impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31326    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31327        use std::str::FromStr;
31328        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31329        Self::from_str(&s).map_err(|_| {
31330            serde::de::Error::custom(
31331                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
31332            )
31333        })
31334    }
31335}
31336/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31337///
31338/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31339/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31340///
31341/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31342///
31343/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31344#[derive(Copy, Clone, Eq, PartialEq)]
31345pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31346    None,
31347    OffSession,
31348}
31349impl ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31350    pub fn as_str(self) -> &'static str {
31351        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
31352        match self {
31353            None => "none",
31354            OffSession => "off_session",
31355        }
31356    }
31357}
31358
31359impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31360    type Err = stripe_types::StripeParseError;
31361    fn from_str(s: &str) -> Result<Self, Self::Err> {
31362        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
31363        match s {
31364            "none" => Ok(None),
31365            "off_session" => Ok(OffSession),
31366            _ => Err(stripe_types::StripeParseError),
31367        }
31368    }
31369}
31370impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31371    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31372        f.write_str(self.as_str())
31373    }
31374}
31375
31376impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31377    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31378        f.write_str(self.as_str())
31379    }
31380}
31381impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31382    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31383    where
31384        S: serde::Serializer,
31385    {
31386        serializer.serialize_str(self.as_str())
31387    }
31388}
31389#[cfg(feature = "deserialize")]
31390impl<'de> serde::Deserialize<'de>
31391    for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
31392{
31393    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31394        use std::str::FromStr;
31395        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31396        Self::from_str(&s).map_err(|_| {
31397            serde::de::Error::custom(
31398                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
31399            )
31400        })
31401    }
31402}
31403/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
31404#[derive(Clone, Debug, serde::Serialize)]
31405pub struct ConfirmPaymentIntentPaymentMethodOptionsLink {
31406    /// Controls when the funds are captured from the customer's account.
31407    ///
31408    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31409    ///
31410    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31411    #[serde(skip_serializing_if = "Option::is_none")]
31412    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
31413    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
31414    #[serde(skip_serializing_if = "Option::is_none")]
31415    pub persistent_token: Option<String>,
31416    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31417    ///
31418    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31419    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31420    ///
31421    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31422    ///
31423    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31424    ///
31425    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31426    #[serde(skip_serializing_if = "Option::is_none")]
31427    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
31428}
31429impl ConfirmPaymentIntentPaymentMethodOptionsLink {
31430    pub fn new() -> Self {
31431        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
31432    }
31433}
31434impl Default for ConfirmPaymentIntentPaymentMethodOptionsLink {
31435    fn default() -> Self {
31436        Self::new()
31437    }
31438}
31439/// Controls when the funds are captured from the customer's account.
31440///
31441/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31442///
31443/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31444#[derive(Copy, Clone, Eq, PartialEq)]
31445pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31446    Manual,
31447}
31448impl ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31449    pub fn as_str(self) -> &'static str {
31450        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
31451        match self {
31452            Manual => "manual",
31453        }
31454    }
31455}
31456
31457impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31458    type Err = stripe_types::StripeParseError;
31459    fn from_str(s: &str) -> Result<Self, Self::Err> {
31460        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
31461        match s {
31462            "manual" => Ok(Manual),
31463            _ => Err(stripe_types::StripeParseError),
31464        }
31465    }
31466}
31467impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31468    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31469        f.write_str(self.as_str())
31470    }
31471}
31472
31473impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31474    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31475        f.write_str(self.as_str())
31476    }
31477}
31478impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31479    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31480    where
31481        S: serde::Serializer,
31482    {
31483        serializer.serialize_str(self.as_str())
31484    }
31485}
31486#[cfg(feature = "deserialize")]
31487impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31488    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31489        use std::str::FromStr;
31490        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31491        Self::from_str(&s).map_err(|_| {
31492            serde::de::Error::custom(
31493                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod",
31494            )
31495        })
31496    }
31497}
31498/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31499///
31500/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31501/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31502///
31503/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31504///
31505/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31506///
31507/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31508#[derive(Copy, Clone, Eq, PartialEq)]
31509pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31510    None,
31511    OffSession,
31512}
31513impl ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31514    pub fn as_str(self) -> &'static str {
31515        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
31516        match self {
31517            None => "none",
31518            OffSession => "off_session",
31519        }
31520    }
31521}
31522
31523impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31524    type Err = stripe_types::StripeParseError;
31525    fn from_str(s: &str) -> Result<Self, Self::Err> {
31526        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
31527        match s {
31528            "none" => Ok(None),
31529            "off_session" => Ok(OffSession),
31530            _ => Err(stripe_types::StripeParseError),
31531        }
31532    }
31533}
31534impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31535    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31536        f.write_str(self.as_str())
31537    }
31538}
31539
31540impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31541    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31542        f.write_str(self.as_str())
31543    }
31544}
31545impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31546    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31547    where
31548        S: serde::Serializer,
31549    {
31550        serializer.serialize_str(self.as_str())
31551    }
31552}
31553#[cfg(feature = "deserialize")]
31554impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31555    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31556        use std::str::FromStr;
31557        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31558        Self::from_str(&s).map_err(|_| {
31559            serde::de::Error::custom(
31560                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
31561            )
31562        })
31563    }
31564}
31565/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
31566#[derive(Copy, Clone, Debug, serde::Serialize)]
31567pub struct ConfirmPaymentIntentPaymentMethodOptionsMbWay {
31568    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31569    ///
31570    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31571    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31572    ///
31573    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31574    ///
31575    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31576    ///
31577    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31578    #[serde(skip_serializing_if = "Option::is_none")]
31579    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
31580}
31581impl ConfirmPaymentIntentPaymentMethodOptionsMbWay {
31582    pub fn new() -> Self {
31583        Self { setup_future_usage: None }
31584    }
31585}
31586impl Default for ConfirmPaymentIntentPaymentMethodOptionsMbWay {
31587    fn default() -> Self {
31588        Self::new()
31589    }
31590}
31591/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31592///
31593/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31594/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31595///
31596/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31597///
31598/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31599///
31600/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31601#[derive(Copy, Clone, Eq, PartialEq)]
31602pub enum ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31603    None,
31604}
31605impl ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31606    pub fn as_str(self) -> &'static str {
31607        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
31608        match self {
31609            None => "none",
31610        }
31611    }
31612}
31613
31614impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31615    type Err = stripe_types::StripeParseError;
31616    fn from_str(s: &str) -> Result<Self, Self::Err> {
31617        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
31618        match s {
31619            "none" => Ok(None),
31620            _ => Err(stripe_types::StripeParseError),
31621        }
31622    }
31623}
31624impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31625    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31626        f.write_str(self.as_str())
31627    }
31628}
31629
31630impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31631    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31632        f.write_str(self.as_str())
31633    }
31634}
31635impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31636    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31637    where
31638        S: serde::Serializer,
31639    {
31640        serializer.serialize_str(self.as_str())
31641    }
31642}
31643#[cfg(feature = "deserialize")]
31644impl<'de> serde::Deserialize<'de>
31645    for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage
31646{
31647    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31648        use std::str::FromStr;
31649        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31650        Self::from_str(&s).map_err(|_| {
31651            serde::de::Error::custom(
31652                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
31653            )
31654        })
31655    }
31656}
31657/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
31658#[derive(Copy, Clone, Debug, serde::Serialize)]
31659pub struct ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
31660    /// Controls when the funds are captured from the customer's account.
31661    ///
31662    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31663    ///
31664    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31665    #[serde(skip_serializing_if = "Option::is_none")]
31666    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
31667    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31668    ///
31669    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31670    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31671    ///
31672    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31673    ///
31674    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31675    ///
31676    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31677    #[serde(skip_serializing_if = "Option::is_none")]
31678    pub setup_future_usage:
31679        Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
31680}
31681impl ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
31682    pub fn new() -> Self {
31683        Self { capture_method: None, setup_future_usage: None }
31684    }
31685}
31686impl Default for ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
31687    fn default() -> Self {
31688        Self::new()
31689    }
31690}
31691/// Controls when the funds are captured from the customer's account.
31692///
31693/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31694///
31695/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31696#[derive(Copy, Clone, Eq, PartialEq)]
31697pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31698    Manual,
31699}
31700impl ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31701    pub fn as_str(self) -> &'static str {
31702        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
31703        match self {
31704            Manual => "manual",
31705        }
31706    }
31707}
31708
31709impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31710    type Err = stripe_types::StripeParseError;
31711    fn from_str(s: &str) -> Result<Self, Self::Err> {
31712        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
31713        match s {
31714            "manual" => Ok(Manual),
31715            _ => Err(stripe_types::StripeParseError),
31716        }
31717    }
31718}
31719impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31720    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31721        f.write_str(self.as_str())
31722    }
31723}
31724
31725impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31727        f.write_str(self.as_str())
31728    }
31729}
31730impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31731    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31732    where
31733        S: serde::Serializer,
31734    {
31735        serializer.serialize_str(self.as_str())
31736    }
31737}
31738#[cfg(feature = "deserialize")]
31739impl<'de> serde::Deserialize<'de>
31740    for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
31741{
31742    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31743        use std::str::FromStr;
31744        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31745        Self::from_str(&s).map_err(|_| {
31746            serde::de::Error::custom(
31747                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
31748            )
31749        })
31750    }
31751}
31752/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31753///
31754/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31755/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31756///
31757/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31758///
31759/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31760///
31761/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31762#[derive(Copy, Clone, Eq, PartialEq)]
31763pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31764    None,
31765}
31766impl ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31767    pub fn as_str(self) -> &'static str {
31768        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
31769        match self {
31770            None => "none",
31771        }
31772    }
31773}
31774
31775impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31776    type Err = stripe_types::StripeParseError;
31777    fn from_str(s: &str) -> Result<Self, Self::Err> {
31778        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
31779        match s {
31780            "none" => Ok(None),
31781            _ => Err(stripe_types::StripeParseError),
31782        }
31783    }
31784}
31785impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31786    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31787        f.write_str(self.as_str())
31788    }
31789}
31790
31791impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31792    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31793        f.write_str(self.as_str())
31794    }
31795}
31796impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31797    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31798    where
31799        S: serde::Serializer,
31800    {
31801        serializer.serialize_str(self.as_str())
31802    }
31803}
31804#[cfg(feature = "deserialize")]
31805impl<'de> serde::Deserialize<'de>
31806    for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
31807{
31808    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31809        use std::str::FromStr;
31810        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31811        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
31812    }
31813}
31814/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
31815#[derive(Copy, Clone, Debug, serde::Serialize)]
31816pub struct ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
31817    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31818    ///
31819    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31820    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31821    ///
31822    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31823    ///
31824    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31825    ///
31826    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31827    #[serde(skip_serializing_if = "Option::is_none")]
31828    pub setup_future_usage:
31829        Option<ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
31830}
31831impl ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
31832    pub fn new() -> Self {
31833        Self { setup_future_usage: None }
31834    }
31835}
31836impl Default for ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
31837    fn default() -> Self {
31838        Self::new()
31839    }
31840}
31841/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31842///
31843/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31844/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31845///
31846/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31847///
31848/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31849///
31850/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31851#[derive(Copy, Clone, Eq, PartialEq)]
31852pub enum ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31853    None,
31854}
31855impl ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31856    pub fn as_str(self) -> &'static str {
31857        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
31858        match self {
31859            None => "none",
31860        }
31861    }
31862}
31863
31864impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31865    type Err = stripe_types::StripeParseError;
31866    fn from_str(s: &str) -> Result<Self, Self::Err> {
31867        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
31868        match s {
31869            "none" => Ok(None),
31870            _ => Err(stripe_types::StripeParseError),
31871        }
31872    }
31873}
31874impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31875    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31876        f.write_str(self.as_str())
31877    }
31878}
31879
31880impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31881    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31882        f.write_str(self.as_str())
31883    }
31884}
31885impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31886    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31887    where
31888        S: serde::Serializer,
31889    {
31890        serializer.serialize_str(self.as_str())
31891    }
31892}
31893#[cfg(feature = "deserialize")]
31894impl<'de> serde::Deserialize<'de>
31895    for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
31896{
31897    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31898        use std::str::FromStr;
31899        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31900        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
31901    }
31902}
31903/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
31904#[derive(Copy, Clone, Debug, serde::Serialize)]
31905pub struct ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
31906    /// Controls when the funds are captured from the customer's account.
31907    ///
31908    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31909    ///
31910    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31911    #[serde(skip_serializing_if = "Option::is_none")]
31912    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
31913    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31914    ///
31915    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31916    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31917    ///
31918    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31919    ///
31920    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31921    #[serde(skip_serializing_if = "Option::is_none")]
31922    pub setup_future_usage:
31923        Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
31924}
31925impl ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
31926    pub fn new() -> Self {
31927        Self { capture_method: None, setup_future_usage: None }
31928    }
31929}
31930impl Default for ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
31931    fn default() -> Self {
31932        Self::new()
31933    }
31934}
31935/// Controls when the funds are captured from the customer's account.
31936///
31937/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
31938///
31939/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
31940#[derive(Copy, Clone, Eq, PartialEq)]
31941pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31942    Manual,
31943}
31944impl ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31945    pub fn as_str(self) -> &'static str {
31946        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
31947        match self {
31948            Manual => "manual",
31949        }
31950    }
31951}
31952
31953impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31954    type Err = stripe_types::StripeParseError;
31955    fn from_str(s: &str) -> Result<Self, Self::Err> {
31956        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
31957        match s {
31958            "manual" => Ok(Manual),
31959            _ => Err(stripe_types::StripeParseError),
31960        }
31961    }
31962}
31963impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31965        f.write_str(self.as_str())
31966    }
31967}
31968
31969impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31970    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31971        f.write_str(self.as_str())
31972    }
31973}
31974impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31975    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31976    where
31977        S: serde::Serializer,
31978    {
31979        serializer.serialize_str(self.as_str())
31980    }
31981}
31982#[cfg(feature = "deserialize")]
31983impl<'de> serde::Deserialize<'de>
31984    for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod
31985{
31986    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31987        use std::str::FromStr;
31988        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31989        Self::from_str(&s).map_err(|_| {
31990            serde::de::Error::custom(
31991                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
31992            )
31993        })
31994    }
31995}
31996/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31997///
31998/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31999/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32000///
32001/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32002///
32003/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32004#[derive(Copy, Clone, Eq, PartialEq)]
32005pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
32006    None,
32007    OffSession,
32008}
32009impl ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
32010    pub fn as_str(self) -> &'static str {
32011        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
32012        match self {
32013            None => "none",
32014            OffSession => "off_session",
32015        }
32016    }
32017}
32018
32019impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
32020    type Err = stripe_types::StripeParseError;
32021    fn from_str(s: &str) -> Result<Self, Self::Err> {
32022        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
32023        match s {
32024            "none" => Ok(None),
32025            "off_session" => Ok(OffSession),
32026            _ => Err(stripe_types::StripeParseError),
32027        }
32028    }
32029}
32030impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
32031    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32032        f.write_str(self.as_str())
32033    }
32034}
32035
32036impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
32037    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32038        f.write_str(self.as_str())
32039    }
32040}
32041impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
32042    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32043    where
32044        S: serde::Serializer,
32045    {
32046        serializer.serialize_str(self.as_str())
32047    }
32048}
32049#[cfg(feature = "deserialize")]
32050impl<'de> serde::Deserialize<'de>
32051    for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
32052{
32053    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32054        use std::str::FromStr;
32055        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32056        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage"))
32057    }
32058}
32059/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
32060#[derive(Clone, Debug, serde::Serialize)]
32061pub struct ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
32062    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32063    ///
32064    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32065    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32066    ///
32067    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32068    ///
32069    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32070    ///
32071    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32072    #[serde(skip_serializing_if = "Option::is_none")]
32073    pub setup_future_usage:
32074        Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
32075    /// Controls when Stripe will attempt to debit the funds from the customer's account.
32076    /// The date must be a string in YYYY-MM-DD format.
32077    /// The date must be in the future and between 3 and 15 calendar days from now.
32078    #[serde(skip_serializing_if = "Option::is_none")]
32079    pub target_date: Option<String>,
32080}
32081impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
32082    pub fn new() -> Self {
32083        Self { setup_future_usage: None, target_date: None }
32084    }
32085}
32086impl Default for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
32087    fn default() -> Self {
32088        Self::new()
32089    }
32090}
32091/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32092///
32093/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32094/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32095///
32096/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32097///
32098/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32099///
32100/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32101#[derive(Copy, Clone, Eq, PartialEq)]
32102pub enum ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
32103    None,
32104    OffSession,
32105    OnSession,
32106}
32107impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
32108    pub fn as_str(self) -> &'static str {
32109        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
32110        match self {
32111            None => "none",
32112            OffSession => "off_session",
32113            OnSession => "on_session",
32114        }
32115    }
32116}
32117
32118impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
32119    type Err = stripe_types::StripeParseError;
32120    fn from_str(s: &str) -> Result<Self, Self::Err> {
32121        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
32122        match s {
32123            "none" => Ok(None),
32124            "off_session" => Ok(OffSession),
32125            "on_session" => Ok(OnSession),
32126            _ => Err(stripe_types::StripeParseError),
32127        }
32128    }
32129}
32130impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
32131    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32132        f.write_str(self.as_str())
32133    }
32134}
32135
32136impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
32137    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32138        f.write_str(self.as_str())
32139    }
32140}
32141impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
32142    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32143    where
32144        S: serde::Serializer,
32145    {
32146        serializer.serialize_str(self.as_str())
32147    }
32148}
32149#[cfg(feature = "deserialize")]
32150impl<'de> serde::Deserialize<'de>
32151    for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
32152{
32153    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32154        use std::str::FromStr;
32155        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32156        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
32157    }
32158}
32159/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
32160#[derive(Copy, Clone, Debug, serde::Serialize)]
32161pub struct ConfirmPaymentIntentPaymentMethodOptionsOxxo {
32162    /// The number of calendar days before an OXXO voucher expires.
32163    /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
32164    #[serde(skip_serializing_if = "Option::is_none")]
32165    pub expires_after_days: Option<u32>,
32166    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32167    ///
32168    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32169    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32170    ///
32171    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32172    ///
32173    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32174    ///
32175    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32176    #[serde(skip_serializing_if = "Option::is_none")]
32177    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
32178}
32179impl ConfirmPaymentIntentPaymentMethodOptionsOxxo {
32180    pub fn new() -> Self {
32181        Self { expires_after_days: None, setup_future_usage: None }
32182    }
32183}
32184impl Default for ConfirmPaymentIntentPaymentMethodOptionsOxxo {
32185    fn default() -> Self {
32186        Self::new()
32187    }
32188}
32189/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32190///
32191/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32192/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32193///
32194/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32195///
32196/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32197///
32198/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32199#[derive(Copy, Clone, Eq, PartialEq)]
32200pub enum ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32201    None,
32202}
32203impl ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32204    pub fn as_str(self) -> &'static str {
32205        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
32206        match self {
32207            None => "none",
32208        }
32209    }
32210}
32211
32212impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32213    type Err = stripe_types::StripeParseError;
32214    fn from_str(s: &str) -> Result<Self, Self::Err> {
32215        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
32216        match s {
32217            "none" => Ok(None),
32218            _ => Err(stripe_types::StripeParseError),
32219        }
32220    }
32221}
32222impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32223    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32224        f.write_str(self.as_str())
32225    }
32226}
32227
32228impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32229    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32230        f.write_str(self.as_str())
32231    }
32232}
32233impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32234    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32235    where
32236        S: serde::Serializer,
32237    {
32238        serializer.serialize_str(self.as_str())
32239    }
32240}
32241#[cfg(feature = "deserialize")]
32242impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
32243    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32244        use std::str::FromStr;
32245        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32246        Self::from_str(&s).map_err(|_| {
32247            serde::de::Error::custom(
32248                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
32249            )
32250        })
32251    }
32252}
32253/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
32254#[derive(Copy, Clone, Debug, serde::Serialize)]
32255pub struct ConfirmPaymentIntentPaymentMethodOptionsP24 {
32256    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32257    ///
32258    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32259    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32260    ///
32261    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32262    ///
32263    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32264    ///
32265    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32266    #[serde(skip_serializing_if = "Option::is_none")]
32267    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
32268    /// Confirm that the payer has accepted the P24 terms and conditions.
32269    #[serde(skip_serializing_if = "Option::is_none")]
32270    pub tos_shown_and_accepted: Option<bool>,
32271}
32272impl ConfirmPaymentIntentPaymentMethodOptionsP24 {
32273    pub fn new() -> Self {
32274        Self { setup_future_usage: None, tos_shown_and_accepted: None }
32275    }
32276}
32277impl Default for ConfirmPaymentIntentPaymentMethodOptionsP24 {
32278    fn default() -> Self {
32279        Self::new()
32280    }
32281}
32282/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32283///
32284/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32285/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32286///
32287/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32288///
32289/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32290///
32291/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32292#[derive(Copy, Clone, Eq, PartialEq)]
32293pub enum ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32294    None,
32295}
32296impl ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32297    pub fn as_str(self) -> &'static str {
32298        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
32299        match self {
32300            None => "none",
32301        }
32302    }
32303}
32304
32305impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32306    type Err = stripe_types::StripeParseError;
32307    fn from_str(s: &str) -> Result<Self, Self::Err> {
32308        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
32309        match s {
32310            "none" => Ok(None),
32311            _ => Err(stripe_types::StripeParseError),
32312        }
32313    }
32314}
32315impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32316    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32317        f.write_str(self.as_str())
32318    }
32319}
32320
32321impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32323        f.write_str(self.as_str())
32324    }
32325}
32326impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32327    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32328    where
32329        S: serde::Serializer,
32330    {
32331        serializer.serialize_str(self.as_str())
32332    }
32333}
32334#[cfg(feature = "deserialize")]
32335impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32336    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32337        use std::str::FromStr;
32338        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32339        Self::from_str(&s).map_err(|_| {
32340            serde::de::Error::custom(
32341                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
32342            )
32343        })
32344    }
32345}
32346/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
32347#[derive(Copy, Clone, Debug, serde::Serialize)]
32348pub struct ConfirmPaymentIntentPaymentMethodOptionsPayco {
32349    /// Controls when the funds are captured from the customer's account.
32350    ///
32351    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
32352    ///
32353    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
32354    #[serde(skip_serializing_if = "Option::is_none")]
32355    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
32356}
32357impl ConfirmPaymentIntentPaymentMethodOptionsPayco {
32358    pub fn new() -> Self {
32359        Self { capture_method: None }
32360    }
32361}
32362impl Default for ConfirmPaymentIntentPaymentMethodOptionsPayco {
32363    fn default() -> Self {
32364        Self::new()
32365    }
32366}
32367/// Controls when the funds are captured from the customer's account.
32368///
32369/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
32370///
32371/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
32372#[derive(Copy, Clone, Eq, PartialEq)]
32373pub enum ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32374    Manual,
32375}
32376impl ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32377    pub fn as_str(self) -> &'static str {
32378        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
32379        match self {
32380            Manual => "manual",
32381        }
32382    }
32383}
32384
32385impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32386    type Err = stripe_types::StripeParseError;
32387    fn from_str(s: &str) -> Result<Self, Self::Err> {
32388        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
32389        match s {
32390            "manual" => Ok(Manual),
32391            _ => Err(stripe_types::StripeParseError),
32392        }
32393    }
32394}
32395impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32396    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32397        f.write_str(self.as_str())
32398    }
32399}
32400
32401impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32402    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32403        f.write_str(self.as_str())
32404    }
32405}
32406impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32407    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32408    where
32409        S: serde::Serializer,
32410    {
32411        serializer.serialize_str(self.as_str())
32412    }
32413}
32414#[cfg(feature = "deserialize")]
32415impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32416    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32417        use std::str::FromStr;
32418        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32419        Self::from_str(&s).map_err(|_| {
32420            serde::de::Error::custom(
32421                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
32422            )
32423        })
32424    }
32425}
32426/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
32427#[derive(Copy, Clone, Debug, serde::Serialize)]
32428pub struct ConfirmPaymentIntentPaymentMethodOptionsPaynow {
32429    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32430    ///
32431    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32432    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32433    ///
32434    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32435    ///
32436    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32437    ///
32438    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32439    #[serde(skip_serializing_if = "Option::is_none")]
32440    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
32441}
32442impl ConfirmPaymentIntentPaymentMethodOptionsPaynow {
32443    pub fn new() -> Self {
32444        Self { setup_future_usage: None }
32445    }
32446}
32447impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaynow {
32448    fn default() -> Self {
32449        Self::new()
32450    }
32451}
32452/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32453///
32454/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32455/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32456///
32457/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32458///
32459/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32460///
32461/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32462#[derive(Copy, Clone, Eq, PartialEq)]
32463pub enum ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32464    None,
32465}
32466impl ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32467    pub fn as_str(self) -> &'static str {
32468        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
32469        match self {
32470            None => "none",
32471        }
32472    }
32473}
32474
32475impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32476    type Err = stripe_types::StripeParseError;
32477    fn from_str(s: &str) -> Result<Self, Self::Err> {
32478        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
32479        match s {
32480            "none" => Ok(None),
32481            _ => Err(stripe_types::StripeParseError),
32482        }
32483    }
32484}
32485impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32486    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32487        f.write_str(self.as_str())
32488    }
32489}
32490
32491impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32493        f.write_str(self.as_str())
32494    }
32495}
32496impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32497    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32498    where
32499        S: serde::Serializer,
32500    {
32501        serializer.serialize_str(self.as_str())
32502    }
32503}
32504#[cfg(feature = "deserialize")]
32505impl<'de> serde::Deserialize<'de>
32506    for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
32507{
32508    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32509        use std::str::FromStr;
32510        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32511        Self::from_str(&s).map_err(|_| {
32512            serde::de::Error::custom(
32513                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
32514            )
32515        })
32516    }
32517}
32518/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
32519#[derive(Clone, Debug, serde::Serialize)]
32520pub struct ConfirmPaymentIntentPaymentMethodOptionsPaypal {
32521    /// Controls when the funds will be captured from the customer's account.
32522    #[serde(skip_serializing_if = "Option::is_none")]
32523    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
32524    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
32525    #[serde(skip_serializing_if = "Option::is_none")]
32526    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
32527    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
32528    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
32529    #[serde(skip_serializing_if = "Option::is_none")]
32530    pub reference: Option<String>,
32531    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
32532    #[serde(skip_serializing_if = "Option::is_none")]
32533    pub risk_correlation_id: Option<String>,
32534    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32535    ///
32536    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32537    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32538    ///
32539    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32540    ///
32541    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32542    ///
32543    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32544    #[serde(skip_serializing_if = "Option::is_none")]
32545    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
32546}
32547impl ConfirmPaymentIntentPaymentMethodOptionsPaypal {
32548    pub fn new() -> Self {
32549        Self {
32550            capture_method: None,
32551            preferred_locale: None,
32552            reference: None,
32553            risk_correlation_id: None,
32554            setup_future_usage: None,
32555        }
32556    }
32557}
32558impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaypal {
32559    fn default() -> Self {
32560        Self::new()
32561    }
32562}
32563/// Controls when the funds will be captured from the customer's account.
32564#[derive(Copy, Clone, Eq, PartialEq)]
32565pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32566    Manual,
32567}
32568impl ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32569    pub fn as_str(self) -> &'static str {
32570        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
32571        match self {
32572            Manual => "manual",
32573        }
32574    }
32575}
32576
32577impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32578    type Err = stripe_types::StripeParseError;
32579    fn from_str(s: &str) -> Result<Self, Self::Err> {
32580        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
32581        match s {
32582            "manual" => Ok(Manual),
32583            _ => Err(stripe_types::StripeParseError),
32584        }
32585    }
32586}
32587impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32589        f.write_str(self.as_str())
32590    }
32591}
32592
32593impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32595        f.write_str(self.as_str())
32596    }
32597}
32598impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32599    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32600    where
32601        S: serde::Serializer,
32602    {
32603        serializer.serialize_str(self.as_str())
32604    }
32605}
32606#[cfg(feature = "deserialize")]
32607impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32608    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32609        use std::str::FromStr;
32610        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32611        Self::from_str(&s).map_err(|_| {
32612            serde::de::Error::custom(
32613                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
32614            )
32615        })
32616    }
32617}
32618/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
32619#[derive(Clone, Eq, PartialEq)]
32620#[non_exhaustive]
32621pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32622    CsMinusCz,
32623    DaMinusDk,
32624    DeMinusAt,
32625    DeMinusDe,
32626    DeMinusLu,
32627    ElMinusGr,
32628    EnMinusGb,
32629    EnMinusUs,
32630    EsMinusEs,
32631    FiMinusFi,
32632    FrMinusBe,
32633    FrMinusFr,
32634    FrMinusLu,
32635    HuMinusHu,
32636    ItMinusIt,
32637    NlMinusBe,
32638    NlMinusNl,
32639    PlMinusPl,
32640    PtMinusPt,
32641    SkMinusSk,
32642    SvMinusSe,
32643    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32644    Unknown(String),
32645}
32646impl ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32647    pub fn as_str(&self) -> &str {
32648        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
32649        match self {
32650            CsMinusCz => "cs-CZ",
32651            DaMinusDk => "da-DK",
32652            DeMinusAt => "de-AT",
32653            DeMinusDe => "de-DE",
32654            DeMinusLu => "de-LU",
32655            ElMinusGr => "el-GR",
32656            EnMinusGb => "en-GB",
32657            EnMinusUs => "en-US",
32658            EsMinusEs => "es-ES",
32659            FiMinusFi => "fi-FI",
32660            FrMinusBe => "fr-BE",
32661            FrMinusFr => "fr-FR",
32662            FrMinusLu => "fr-LU",
32663            HuMinusHu => "hu-HU",
32664            ItMinusIt => "it-IT",
32665            NlMinusBe => "nl-BE",
32666            NlMinusNl => "nl-NL",
32667            PlMinusPl => "pl-PL",
32668            PtMinusPt => "pt-PT",
32669            SkMinusSk => "sk-SK",
32670            SvMinusSe => "sv-SE",
32671            Unknown(v) => v,
32672        }
32673    }
32674}
32675
32676impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32677    type Err = std::convert::Infallible;
32678    fn from_str(s: &str) -> Result<Self, Self::Err> {
32679        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
32680        match s {
32681            "cs-CZ" => Ok(CsMinusCz),
32682            "da-DK" => Ok(DaMinusDk),
32683            "de-AT" => Ok(DeMinusAt),
32684            "de-DE" => Ok(DeMinusDe),
32685            "de-LU" => Ok(DeMinusLu),
32686            "el-GR" => Ok(ElMinusGr),
32687            "en-GB" => Ok(EnMinusGb),
32688            "en-US" => Ok(EnMinusUs),
32689            "es-ES" => Ok(EsMinusEs),
32690            "fi-FI" => Ok(FiMinusFi),
32691            "fr-BE" => Ok(FrMinusBe),
32692            "fr-FR" => Ok(FrMinusFr),
32693            "fr-LU" => Ok(FrMinusLu),
32694            "hu-HU" => Ok(HuMinusHu),
32695            "it-IT" => Ok(ItMinusIt),
32696            "nl-BE" => Ok(NlMinusBe),
32697            "nl-NL" => Ok(NlMinusNl),
32698            "pl-PL" => Ok(PlMinusPl),
32699            "pt-PT" => Ok(PtMinusPt),
32700            "sk-SK" => Ok(SkMinusSk),
32701            "sv-SE" => Ok(SvMinusSe),
32702            v => Ok(Unknown(v.to_owned())),
32703        }
32704    }
32705}
32706impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32708        f.write_str(self.as_str())
32709    }
32710}
32711
32712impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32714        f.write_str(self.as_str())
32715    }
32716}
32717impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32718    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32719    where
32720        S: serde::Serializer,
32721    {
32722        serializer.serialize_str(self.as_str())
32723    }
32724}
32725#[cfg(feature = "deserialize")]
32726impl<'de> serde::Deserialize<'de>
32727    for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale
32728{
32729    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32730        use std::str::FromStr;
32731        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32732        Ok(Self::from_str(&s).unwrap())
32733    }
32734}
32735/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32736///
32737/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32738/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32739///
32740/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32741///
32742/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32743///
32744/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32745#[derive(Copy, Clone, Eq, PartialEq)]
32746pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32747    None,
32748    OffSession,
32749}
32750impl ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32751    pub fn as_str(self) -> &'static str {
32752        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
32753        match self {
32754            None => "none",
32755            OffSession => "off_session",
32756        }
32757    }
32758}
32759
32760impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32761    type Err = stripe_types::StripeParseError;
32762    fn from_str(s: &str) -> Result<Self, Self::Err> {
32763        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
32764        match s {
32765            "none" => Ok(None),
32766            "off_session" => Ok(OffSession),
32767            _ => Err(stripe_types::StripeParseError),
32768        }
32769    }
32770}
32771impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32773        f.write_str(self.as_str())
32774    }
32775}
32776
32777impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32778    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32779        f.write_str(self.as_str())
32780    }
32781}
32782impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32783    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32784    where
32785        S: serde::Serializer,
32786    {
32787        serializer.serialize_str(self.as_str())
32788    }
32789}
32790#[cfg(feature = "deserialize")]
32791impl<'de> serde::Deserialize<'de>
32792    for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
32793{
32794    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32795        use std::str::FromStr;
32796        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32797        Self::from_str(&s).map_err(|_| {
32798            serde::de::Error::custom(
32799                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
32800            )
32801        })
32802    }
32803}
32804/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
32805#[derive(Copy, Clone, Debug, serde::Serialize)]
32806pub struct ConfirmPaymentIntentPaymentMethodOptionsPix {
32807    /// Determines if the amount includes the IOF tax. Defaults to `never`.
32808    #[serde(skip_serializing_if = "Option::is_none")]
32809    pub amount_includes_iof: Option<ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
32810    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
32811    /// Defaults to 86400 seconds.
32812    #[serde(skip_serializing_if = "Option::is_none")]
32813    pub expires_after_seconds: Option<i64>,
32814    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
32815    /// Defaults to 1 day in the future.
32816    #[serde(skip_serializing_if = "Option::is_none")]
32817    pub expires_at: Option<stripe_types::Timestamp>,
32818    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32819    ///
32820    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32821    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32822    ///
32823    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32824    ///
32825    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32826    ///
32827    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32828    #[serde(skip_serializing_if = "Option::is_none")]
32829    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
32830}
32831impl ConfirmPaymentIntentPaymentMethodOptionsPix {
32832    pub fn new() -> Self {
32833        Self {
32834            amount_includes_iof: None,
32835            expires_after_seconds: None,
32836            expires_at: None,
32837            setup_future_usage: None,
32838        }
32839    }
32840}
32841impl Default for ConfirmPaymentIntentPaymentMethodOptionsPix {
32842    fn default() -> Self {
32843        Self::new()
32844    }
32845}
32846/// Determines if the amount includes the IOF tax. Defaults to `never`.
32847#[derive(Copy, Clone, Eq, PartialEq)]
32848pub enum ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32849    Always,
32850    Never,
32851}
32852impl ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32853    pub fn as_str(self) -> &'static str {
32854        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
32855        match self {
32856            Always => "always",
32857            Never => "never",
32858        }
32859    }
32860}
32861
32862impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32863    type Err = stripe_types::StripeParseError;
32864    fn from_str(s: &str) -> Result<Self, Self::Err> {
32865        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
32866        match s {
32867            "always" => Ok(Always),
32868            "never" => Ok(Never),
32869            _ => Err(stripe_types::StripeParseError),
32870        }
32871    }
32872}
32873impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32874    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32875        f.write_str(self.as_str())
32876    }
32877}
32878
32879impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32880    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32881        f.write_str(self.as_str())
32882    }
32883}
32884impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32885    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32886    where
32887        S: serde::Serializer,
32888    {
32889        serializer.serialize_str(self.as_str())
32890    }
32891}
32892#[cfg(feature = "deserialize")]
32893impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32894    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32895        use std::str::FromStr;
32896        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32897        Self::from_str(&s).map_err(|_| {
32898            serde::de::Error::custom(
32899                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
32900            )
32901        })
32902    }
32903}
32904/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32905///
32906/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32907/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32908///
32909/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32910///
32911/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32912///
32913/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32914#[derive(Copy, Clone, Eq, PartialEq)]
32915pub enum ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32916    None,
32917}
32918impl ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32919    pub fn as_str(self) -> &'static str {
32920        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
32921        match self {
32922            None => "none",
32923        }
32924    }
32925}
32926
32927impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32928    type Err = stripe_types::StripeParseError;
32929    fn from_str(s: &str) -> Result<Self, Self::Err> {
32930        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
32931        match s {
32932            "none" => Ok(None),
32933            _ => Err(stripe_types::StripeParseError),
32934        }
32935    }
32936}
32937impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32938    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32939        f.write_str(self.as_str())
32940    }
32941}
32942
32943impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32944    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32945        f.write_str(self.as_str())
32946    }
32947}
32948impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32949    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32950    where
32951        S: serde::Serializer,
32952    {
32953        serializer.serialize_str(self.as_str())
32954    }
32955}
32956#[cfg(feature = "deserialize")]
32957impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32958    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32959        use std::str::FromStr;
32960        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32961        Self::from_str(&s).map_err(|_| {
32962            serde::de::Error::custom(
32963                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
32964            )
32965        })
32966    }
32967}
32968/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
32969#[derive(Copy, Clone, Debug, serde::Serialize)]
32970pub struct ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
32971    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32972    ///
32973    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32974    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32975    ///
32976    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32977    ///
32978    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32979    ///
32980    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32981    #[serde(skip_serializing_if = "Option::is_none")]
32982    pub setup_future_usage:
32983        Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
32984}
32985impl ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
32986    pub fn new() -> Self {
32987        Self { setup_future_usage: None }
32988    }
32989}
32990impl Default for ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
32991    fn default() -> Self {
32992        Self::new()
32993    }
32994}
32995/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32996///
32997/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32998/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32999///
33000/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33001///
33002/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33003///
33004/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33005#[derive(Copy, Clone, Eq, PartialEq)]
33006pub enum ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
33007    None,
33008}
33009impl ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
33010    pub fn as_str(self) -> &'static str {
33011        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
33012        match self {
33013            None => "none",
33014        }
33015    }
33016}
33017
33018impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
33019    type Err = stripe_types::StripeParseError;
33020    fn from_str(s: &str) -> Result<Self, Self::Err> {
33021        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
33022        match s {
33023            "none" => Ok(None),
33024            _ => Err(stripe_types::StripeParseError),
33025        }
33026    }
33027}
33028impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
33029    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33030        f.write_str(self.as_str())
33031    }
33032}
33033
33034impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
33035    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33036        f.write_str(self.as_str())
33037    }
33038}
33039impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
33040    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33041    where
33042        S: serde::Serializer,
33043    {
33044        serializer.serialize_str(self.as_str())
33045    }
33046}
33047#[cfg(feature = "deserialize")]
33048impl<'de> serde::Deserialize<'de>
33049    for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
33050{
33051    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33052        use std::str::FromStr;
33053        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33054        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
33055    }
33056}
33057/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
33058#[derive(Copy, Clone, Debug, serde::Serialize)]
33059pub struct ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
33060    /// Controls when the funds are captured from the customer's account.
33061    ///
33062    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
33063    ///
33064    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
33065    #[serde(skip_serializing_if = "Option::is_none")]
33066    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
33067    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33068    ///
33069    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33070    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33071    ///
33072    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33073    ///
33074    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33075    #[serde(skip_serializing_if = "Option::is_none")]
33076    pub setup_future_usage:
33077        Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
33078}
33079impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
33080    pub fn new() -> Self {
33081        Self { capture_method: None, setup_future_usage: None }
33082    }
33083}
33084impl Default for ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
33085    fn default() -> Self {
33086        Self::new()
33087    }
33088}
33089/// Controls when the funds are captured from the customer's account.
33090///
33091/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
33092///
33093/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
33094#[derive(Copy, Clone, Eq, PartialEq)]
33095pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
33096    Manual,
33097}
33098impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
33099    pub fn as_str(self) -> &'static str {
33100        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
33101        match self {
33102            Manual => "manual",
33103        }
33104    }
33105}
33106
33107impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
33108    type Err = stripe_types::StripeParseError;
33109    fn from_str(s: &str) -> Result<Self, Self::Err> {
33110        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
33111        match s {
33112            "manual" => Ok(Manual),
33113            _ => Err(stripe_types::StripeParseError),
33114        }
33115    }
33116}
33117impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
33118    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33119        f.write_str(self.as_str())
33120    }
33121}
33122
33123impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
33124    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33125        f.write_str(self.as_str())
33126    }
33127}
33128impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
33129    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33130    where
33131        S: serde::Serializer,
33132    {
33133        serializer.serialize_str(self.as_str())
33134    }
33135}
33136#[cfg(feature = "deserialize")]
33137impl<'de> serde::Deserialize<'de>
33138    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
33139{
33140    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33141        use std::str::FromStr;
33142        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33143        Self::from_str(&s).map_err(|_| {
33144            serde::de::Error::custom(
33145                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
33146            )
33147        })
33148    }
33149}
33150/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33151///
33152/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33153/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33154///
33155/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33156///
33157/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33158#[derive(Copy, Clone, Eq, PartialEq)]
33159pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
33160    None,
33161    OffSession,
33162}
33163impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
33164    pub fn as_str(self) -> &'static str {
33165        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
33166        match self {
33167            None => "none",
33168            OffSession => "off_session",
33169        }
33170    }
33171}
33172
33173impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
33174    type Err = stripe_types::StripeParseError;
33175    fn from_str(s: &str) -> Result<Self, Self::Err> {
33176        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
33177        match s {
33178            "none" => Ok(None),
33179            "off_session" => Ok(OffSession),
33180            _ => Err(stripe_types::StripeParseError),
33181        }
33182    }
33183}
33184impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
33185    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33186        f.write_str(self.as_str())
33187    }
33188}
33189
33190impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
33191    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33192        f.write_str(self.as_str())
33193    }
33194}
33195impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
33196    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33197    where
33198        S: serde::Serializer,
33199    {
33200        serializer.serialize_str(self.as_str())
33201    }
33202}
33203#[cfg(feature = "deserialize")]
33204impl<'de> serde::Deserialize<'de>
33205    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
33206{
33207    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33208        use std::str::FromStr;
33209        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33210        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
33211    }
33212}
33213/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
33214#[derive(Copy, Clone, Debug, serde::Serialize)]
33215pub struct ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
33216    /// Controls when the funds are captured from the customer's account.
33217    ///
33218    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
33219    ///
33220    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
33221    #[serde(skip_serializing_if = "Option::is_none")]
33222    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
33223}
33224impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
33225    pub fn new() -> Self {
33226        Self { capture_method: None }
33227    }
33228}
33229impl Default for ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
33230    fn default() -> Self {
33231        Self::new()
33232    }
33233}
33234/// Controls when the funds are captured from the customer's account.
33235///
33236/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
33237///
33238/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
33239#[derive(Copy, Clone, Eq, PartialEq)]
33240pub enum ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33241    Manual,
33242}
33243impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33244    pub fn as_str(self) -> &'static str {
33245        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
33246        match self {
33247            Manual => "manual",
33248        }
33249    }
33250}
33251
33252impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33253    type Err = stripe_types::StripeParseError;
33254    fn from_str(s: &str) -> Result<Self, Self::Err> {
33255        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
33256        match s {
33257            "manual" => Ok(Manual),
33258            _ => Err(stripe_types::StripeParseError),
33259        }
33260    }
33261}
33262impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33263    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33264        f.write_str(self.as_str())
33265    }
33266}
33267
33268impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33269    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33270        f.write_str(self.as_str())
33271    }
33272}
33273impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33274    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33275    where
33276        S: serde::Serializer,
33277    {
33278        serializer.serialize_str(self.as_str())
33279    }
33280}
33281#[cfg(feature = "deserialize")]
33282impl<'de> serde::Deserialize<'de>
33283    for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
33284{
33285    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33286        use std::str::FromStr;
33287        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33288        Self::from_str(&s).map_err(|_| {
33289            serde::de::Error::custom(
33290                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
33291            )
33292        })
33293    }
33294}
33295/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
33296#[derive(Copy, Clone, Debug, serde::Serialize)]
33297pub struct ConfirmPaymentIntentPaymentMethodOptionsSatispay {
33298    /// Controls when the funds are captured from the customer's account.
33299    ///
33300    /// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
33301    ///
33302    /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
33303    #[serde(skip_serializing_if = "Option::is_none")]
33304    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
33305}
33306impl ConfirmPaymentIntentPaymentMethodOptionsSatispay {
33307    pub fn new() -> Self {
33308        Self { capture_method: None }
33309    }
33310}
33311impl Default for ConfirmPaymentIntentPaymentMethodOptionsSatispay {
33312    fn default() -> Self {
33313        Self::new()
33314    }
33315}
33316/// Controls when the funds are captured from the customer's account.
33317///
33318/// If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
33319///
33320/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
33321#[derive(Copy, Clone, Eq, PartialEq)]
33322pub enum ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33323    Manual,
33324}
33325impl ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33326    pub fn as_str(self) -> &'static str {
33327        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
33328        match self {
33329            Manual => "manual",
33330        }
33331    }
33332}
33333
33334impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33335    type Err = stripe_types::StripeParseError;
33336    fn from_str(s: &str) -> Result<Self, Self::Err> {
33337        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
33338        match s {
33339            "manual" => Ok(Manual),
33340            _ => Err(stripe_types::StripeParseError),
33341        }
33342    }
33343}
33344impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33345    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33346        f.write_str(self.as_str())
33347    }
33348}
33349
33350impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33351    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33352        f.write_str(self.as_str())
33353    }
33354}
33355impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33356    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33357    where
33358        S: serde::Serializer,
33359    {
33360        serializer.serialize_str(self.as_str())
33361    }
33362}
33363#[cfg(feature = "deserialize")]
33364impl<'de> serde::Deserialize<'de>
33365    for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod
33366{
33367    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33368        use std::str::FromStr;
33369        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33370        Self::from_str(&s).map_err(|_| {
33371            serde::de::Error::custom(
33372                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
33373            )
33374        })
33375    }
33376}
33377/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
33378#[derive(Clone, Debug, serde::Serialize)]
33379pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
33380    /// Additional fields for Mandate creation
33381    #[serde(skip_serializing_if = "Option::is_none")]
33382    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
33383    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33384    ///
33385    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33386    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33387    ///
33388    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33389    ///
33390    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33391    ///
33392    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33393    #[serde(skip_serializing_if = "Option::is_none")]
33394    pub setup_future_usage:
33395        Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
33396    /// Controls when Stripe will attempt to debit the funds from the customer's account.
33397    /// The date must be a string in YYYY-MM-DD format.
33398    /// The date must be in the future and between 3 and 15 calendar days from now.
33399    #[serde(skip_serializing_if = "Option::is_none")]
33400    pub target_date: Option<String>,
33401}
33402impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
33403    pub fn new() -> Self {
33404        Self { mandate_options: None, setup_future_usage: None, target_date: None }
33405    }
33406}
33407impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
33408    fn default() -> Self {
33409        Self::new()
33410    }
33411}
33412/// Additional fields for Mandate creation
33413#[derive(Clone, Debug, serde::Serialize)]
33414pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
33415    /// Prefix used to generate the Mandate reference.
33416    /// Must be at most 12 characters long.
33417    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
33418    /// Cannot begin with 'STRIPE'.
33419    #[serde(skip_serializing_if = "Option::is_none")]
33420    pub reference_prefix: Option<String>,
33421}
33422impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
33423    pub fn new() -> Self {
33424        Self { reference_prefix: None }
33425    }
33426}
33427impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
33428    fn default() -> Self {
33429        Self::new()
33430    }
33431}
33432/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33433///
33434/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33435/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33436///
33437/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33438///
33439/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33440///
33441/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33442#[derive(Copy, Clone, Eq, PartialEq)]
33443pub enum ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33444    None,
33445    OffSession,
33446    OnSession,
33447}
33448impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33449    pub fn as_str(self) -> &'static str {
33450        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
33451        match self {
33452            None => "none",
33453            OffSession => "off_session",
33454            OnSession => "on_session",
33455        }
33456    }
33457}
33458
33459impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33460    type Err = stripe_types::StripeParseError;
33461    fn from_str(s: &str) -> Result<Self, Self::Err> {
33462        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
33463        match s {
33464            "none" => Ok(None),
33465            "off_session" => Ok(OffSession),
33466            "on_session" => Ok(OnSession),
33467            _ => Err(stripe_types::StripeParseError),
33468        }
33469    }
33470}
33471impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33472    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33473        f.write_str(self.as_str())
33474    }
33475}
33476
33477impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33479        f.write_str(self.as_str())
33480    }
33481}
33482impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33483    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33484    where
33485        S: serde::Serializer,
33486    {
33487        serializer.serialize_str(self.as_str())
33488    }
33489}
33490#[cfg(feature = "deserialize")]
33491impl<'de> serde::Deserialize<'de>
33492    for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
33493{
33494    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33495        use std::str::FromStr;
33496        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33497        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
33498    }
33499}
33500/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
33501#[derive(Copy, Clone, Debug, serde::Serialize)]
33502pub struct ConfirmPaymentIntentPaymentMethodOptionsSofort {
33503    /// Language shown to the payer on redirect.
33504    #[serde(skip_serializing_if = "Option::is_none")]
33505    pub preferred_language: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
33506    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33507    ///
33508    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33509    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33510    ///
33511    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33512    ///
33513    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33514    ///
33515    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33516    #[serde(skip_serializing_if = "Option::is_none")]
33517    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
33518}
33519impl ConfirmPaymentIntentPaymentMethodOptionsSofort {
33520    pub fn new() -> Self {
33521        Self { preferred_language: None, setup_future_usage: None }
33522    }
33523}
33524impl Default for ConfirmPaymentIntentPaymentMethodOptionsSofort {
33525    fn default() -> Self {
33526        Self::new()
33527    }
33528}
33529/// Language shown to the payer on redirect.
33530#[derive(Copy, Clone, Eq, PartialEq)]
33531pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33532    De,
33533    En,
33534    Es,
33535    Fr,
33536    It,
33537    Nl,
33538    Pl,
33539}
33540impl ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33541    pub fn as_str(self) -> &'static str {
33542        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
33543        match self {
33544            De => "de",
33545            En => "en",
33546            Es => "es",
33547            Fr => "fr",
33548            It => "it",
33549            Nl => "nl",
33550            Pl => "pl",
33551        }
33552    }
33553}
33554
33555impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33556    type Err = stripe_types::StripeParseError;
33557    fn from_str(s: &str) -> Result<Self, Self::Err> {
33558        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
33559        match s {
33560            "de" => Ok(De),
33561            "en" => Ok(En),
33562            "es" => Ok(Es),
33563            "fr" => Ok(Fr),
33564            "it" => Ok(It),
33565            "nl" => Ok(Nl),
33566            "pl" => Ok(Pl),
33567            _ => Err(stripe_types::StripeParseError),
33568        }
33569    }
33570}
33571impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33573        f.write_str(self.as_str())
33574    }
33575}
33576
33577impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33578    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33579        f.write_str(self.as_str())
33580    }
33581}
33582impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33583    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33584    where
33585        S: serde::Serializer,
33586    {
33587        serializer.serialize_str(self.as_str())
33588    }
33589}
33590#[cfg(feature = "deserialize")]
33591impl<'de> serde::Deserialize<'de>
33592    for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage
33593{
33594    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33595        use std::str::FromStr;
33596        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33597        Self::from_str(&s).map_err(|_| {
33598            serde::de::Error::custom(
33599                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
33600            )
33601        })
33602    }
33603}
33604/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33605///
33606/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33607/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33608///
33609/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33610///
33611/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33612///
33613/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33614#[derive(Copy, Clone, Eq, PartialEq)]
33615pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33616    None,
33617    OffSession,
33618}
33619impl ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33620    pub fn as_str(self) -> &'static str {
33621        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
33622        match self {
33623            None => "none",
33624            OffSession => "off_session",
33625        }
33626    }
33627}
33628
33629impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33630    type Err = stripe_types::StripeParseError;
33631    fn from_str(s: &str) -> Result<Self, Self::Err> {
33632        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
33633        match s {
33634            "none" => Ok(None),
33635            "off_session" => Ok(OffSession),
33636            _ => Err(stripe_types::StripeParseError),
33637        }
33638    }
33639}
33640impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33641    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33642        f.write_str(self.as_str())
33643    }
33644}
33645
33646impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33648        f.write_str(self.as_str())
33649    }
33650}
33651impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33652    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33653    where
33654        S: serde::Serializer,
33655    {
33656        serializer.serialize_str(self.as_str())
33657    }
33658}
33659#[cfg(feature = "deserialize")]
33660impl<'de> serde::Deserialize<'de>
33661    for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
33662{
33663    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33664        use std::str::FromStr;
33665        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33666        Self::from_str(&s).map_err(|_| {
33667            serde::de::Error::custom(
33668                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
33669            )
33670        })
33671    }
33672}
33673/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
33674#[derive(Clone, Debug, serde::Serialize)]
33675pub struct ConfirmPaymentIntentPaymentMethodOptionsSwish {
33676    /// A reference for this payment to be displayed in the Swish app.
33677    #[serde(skip_serializing_if = "Option::is_none")]
33678    pub reference: Option<String>,
33679    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33680    ///
33681    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33682    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33683    ///
33684    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33685    ///
33686    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33687    ///
33688    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33689    #[serde(skip_serializing_if = "Option::is_none")]
33690    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
33691}
33692impl ConfirmPaymentIntentPaymentMethodOptionsSwish {
33693    pub fn new() -> Self {
33694        Self { reference: None, setup_future_usage: None }
33695    }
33696}
33697impl Default for ConfirmPaymentIntentPaymentMethodOptionsSwish {
33698    fn default() -> Self {
33699        Self::new()
33700    }
33701}
33702/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33703///
33704/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33705/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33706///
33707/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33708///
33709/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33710///
33711/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33712#[derive(Copy, Clone, Eq, PartialEq)]
33713pub enum ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33714    None,
33715}
33716impl ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33717    pub fn as_str(self) -> &'static str {
33718        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
33719        match self {
33720            None => "none",
33721        }
33722    }
33723}
33724
33725impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33726    type Err = stripe_types::StripeParseError;
33727    fn from_str(s: &str) -> Result<Self, Self::Err> {
33728        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
33729        match s {
33730            "none" => Ok(None),
33731            _ => Err(stripe_types::StripeParseError),
33732        }
33733    }
33734}
33735impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33736    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33737        f.write_str(self.as_str())
33738    }
33739}
33740
33741impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33742    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33743        f.write_str(self.as_str())
33744    }
33745}
33746impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33747    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33748    where
33749        S: serde::Serializer,
33750    {
33751        serializer.serialize_str(self.as_str())
33752    }
33753}
33754#[cfg(feature = "deserialize")]
33755impl<'de> serde::Deserialize<'de>
33756    for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage
33757{
33758    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33759        use std::str::FromStr;
33760        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33761        Self::from_str(&s).map_err(|_| {
33762            serde::de::Error::custom(
33763                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
33764            )
33765        })
33766    }
33767}
33768/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
33769#[derive(Copy, Clone, Debug, serde::Serialize)]
33770pub struct ConfirmPaymentIntentPaymentMethodOptionsTwint {
33771    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33772    ///
33773    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33774    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33775    ///
33776    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33777    ///
33778    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33779    ///
33780    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33781    #[serde(skip_serializing_if = "Option::is_none")]
33782    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
33783}
33784impl ConfirmPaymentIntentPaymentMethodOptionsTwint {
33785    pub fn new() -> Self {
33786        Self { setup_future_usage: None }
33787    }
33788}
33789impl Default for ConfirmPaymentIntentPaymentMethodOptionsTwint {
33790    fn default() -> Self {
33791        Self::new()
33792    }
33793}
33794/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33795///
33796/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33797/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33798///
33799/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33800///
33801/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33802///
33803/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33804#[derive(Copy, Clone, Eq, PartialEq)]
33805pub enum ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33806    None,
33807}
33808impl ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33809    pub fn as_str(self) -> &'static str {
33810        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
33811        match self {
33812            None => "none",
33813        }
33814    }
33815}
33816
33817impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33818    type Err = stripe_types::StripeParseError;
33819    fn from_str(s: &str) -> Result<Self, Self::Err> {
33820        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
33821        match s {
33822            "none" => Ok(None),
33823            _ => Err(stripe_types::StripeParseError),
33824        }
33825    }
33826}
33827impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33828    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33829        f.write_str(self.as_str())
33830    }
33831}
33832
33833impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33834    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33835        f.write_str(self.as_str())
33836    }
33837}
33838impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33839    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33840    where
33841        S: serde::Serializer,
33842    {
33843        serializer.serialize_str(self.as_str())
33844    }
33845}
33846#[cfg(feature = "deserialize")]
33847impl<'de> serde::Deserialize<'de>
33848    for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage
33849{
33850    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33851        use std::str::FromStr;
33852        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33853        Self::from_str(&s).map_err(|_| {
33854            serde::de::Error::custom(
33855                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
33856            )
33857        })
33858    }
33859}
33860/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
33861#[derive(Clone, Debug, serde::Serialize)]
33862pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
33863    /// Additional fields for Financial Connections Session creation
33864    #[serde(skip_serializing_if = "Option::is_none")]
33865    pub financial_connections:
33866        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
33867    /// Additional fields for Mandate creation
33868    #[serde(skip_serializing_if = "Option::is_none")]
33869    pub mandate_options:
33870        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
33871    /// Additional fields for network related functions
33872    #[serde(skip_serializing_if = "Option::is_none")]
33873    pub networks: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
33874    /// Preferred transaction settlement speed
33875    #[serde(skip_serializing_if = "Option::is_none")]
33876    pub preferred_settlement_speed:
33877        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
33878    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33879    ///
33880    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33881    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33882    ///
33883    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33884    ///
33885    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33886    ///
33887    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33888    #[serde(skip_serializing_if = "Option::is_none")]
33889    pub setup_future_usage:
33890        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
33891    /// Controls when Stripe will attempt to debit the funds from the customer's account.
33892    /// The date must be a string in YYYY-MM-DD format.
33893    /// The date must be in the future and between 3 and 15 calendar days from now.
33894    #[serde(skip_serializing_if = "Option::is_none")]
33895    pub target_date: Option<String>,
33896    /// Bank account verification method.
33897    #[serde(skip_serializing_if = "Option::is_none")]
33898    pub verification_method:
33899        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
33900}
33901impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
33902    pub fn new() -> Self {
33903        Self {
33904            financial_connections: None,
33905            mandate_options: None,
33906            networks: None,
33907            preferred_settlement_speed: None,
33908            setup_future_usage: None,
33909            target_date: None,
33910            verification_method: None,
33911        }
33912    }
33913}
33914impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
33915    fn default() -> Self {
33916        Self::new()
33917    }
33918}
33919/// Additional fields for Financial Connections Session creation
33920#[derive(Clone, Debug, serde::Serialize)]
33921pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
33922    /// Provide filters for the linked accounts that the customer can select for the payment method.
33923    #[serde(skip_serializing_if = "Option::is_none")]
33924    pub filters:
33925        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
33926    /// The list of permissions to request.
33927    /// If this parameter is passed, the `payment_method` permission must be included.
33928    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
33929    #[serde(skip_serializing_if = "Option::is_none")]
33930    pub permissions: Option<
33931        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
33932    >,
33933    /// List of data features that you would like to retrieve upon account creation.
33934    #[serde(skip_serializing_if = "Option::is_none")]
33935    pub prefetch: Option<
33936        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
33937    >,
33938    /// For webview integrations only.
33939    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
33940    #[serde(skip_serializing_if = "Option::is_none")]
33941    pub return_url: Option<String>,
33942}
33943impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
33944    pub fn new() -> Self {
33945        Self { filters: None, permissions: None, prefetch: None, return_url: None }
33946    }
33947}
33948impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
33949    fn default() -> Self {
33950        Self::new()
33951    }
33952}
33953/// Provide filters for the linked accounts that the customer can select for the payment method.
33954#[derive(Clone, Debug, serde::Serialize)]
33955pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
33956        /// The account subcategories to use to filter for selectable accounts.
33957    /// Valid subcategories are `checking` and `savings`.
33958#[serde(skip_serializing_if = "Option::is_none")]
33959pub account_subcategories: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
33960
33961}
33962impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
33963    pub fn new() -> Self {
33964        Self { account_subcategories: None }
33965    }
33966}
33967impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
33968    fn default() -> Self {
33969        Self::new()
33970    }
33971}
33972/// The account subcategories to use to filter for selectable accounts.
33973/// Valid subcategories are `checking` and `savings`.
33974#[derive(Copy, Clone, Eq, PartialEq)]
33975pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
33976{
33977    Checking,
33978    Savings,
33979}
33980impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33981    pub fn as_str(self) -> &'static str {
33982        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
33983        match self {
33984Checking => "checking",
33985Savings => "savings",
33986
33987        }
33988    }
33989}
33990
33991impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33992    type Err = stripe_types::StripeParseError;
33993    fn from_str(s: &str) -> Result<Self, Self::Err> {
33994        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
33995        match s {
33996    "checking" => Ok(Checking),
33997"savings" => Ok(Savings),
33998_ => Err(stripe_types::StripeParseError)
33999
34000        }
34001    }
34002}
34003impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
34004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34005        f.write_str(self.as_str())
34006    }
34007}
34008
34009impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
34010    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34011        f.write_str(self.as_str())
34012    }
34013}
34014impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
34015    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
34016        serializer.serialize_str(self.as_str())
34017    }
34018}
34019#[cfg(feature = "deserialize")]
34020impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
34021    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34022        use std::str::FromStr;
34023        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34024        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
34025    }
34026}
34027/// The list of permissions to request.
34028/// If this parameter is passed, the `payment_method` permission must be included.
34029/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
34030#[derive(Copy, Clone, Eq, PartialEq)]
34031pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
34032    Balances,
34033    Ownership,
34034    PaymentMethod,
34035    Transactions,
34036}
34037impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
34038    pub fn as_str(self) -> &'static str {
34039        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
34040        match self {
34041            Balances => "balances",
34042            Ownership => "ownership",
34043            PaymentMethod => "payment_method",
34044            Transactions => "transactions",
34045        }
34046    }
34047}
34048
34049impl std::str::FromStr
34050    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
34051{
34052    type Err = stripe_types::StripeParseError;
34053    fn from_str(s: &str) -> Result<Self, Self::Err> {
34054        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
34055        match s {
34056            "balances" => Ok(Balances),
34057            "ownership" => Ok(Ownership),
34058            "payment_method" => Ok(PaymentMethod),
34059            "transactions" => Ok(Transactions),
34060            _ => Err(stripe_types::StripeParseError),
34061        }
34062    }
34063}
34064impl std::fmt::Display
34065    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
34066{
34067    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34068        f.write_str(self.as_str())
34069    }
34070}
34071
34072impl std::fmt::Debug
34073    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
34074{
34075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34076        f.write_str(self.as_str())
34077    }
34078}
34079impl serde::Serialize
34080    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
34081{
34082    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34083    where
34084        S: serde::Serializer,
34085    {
34086        serializer.serialize_str(self.as_str())
34087    }
34088}
34089#[cfg(feature = "deserialize")]
34090impl<'de> serde::Deserialize<'de>
34091    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
34092{
34093    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34094        use std::str::FromStr;
34095        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34096        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
34097    }
34098}
34099/// List of data features that you would like to retrieve upon account creation.
34100#[derive(Copy, Clone, Eq, PartialEq)]
34101pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
34102    Balances,
34103    Ownership,
34104    Transactions,
34105}
34106impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
34107    pub fn as_str(self) -> &'static str {
34108        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
34109        match self {
34110            Balances => "balances",
34111            Ownership => "ownership",
34112            Transactions => "transactions",
34113        }
34114    }
34115}
34116
34117impl std::str::FromStr
34118    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
34119{
34120    type Err = stripe_types::StripeParseError;
34121    fn from_str(s: &str) -> Result<Self, Self::Err> {
34122        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
34123        match s {
34124            "balances" => Ok(Balances),
34125            "ownership" => Ok(Ownership),
34126            "transactions" => Ok(Transactions),
34127            _ => Err(stripe_types::StripeParseError),
34128        }
34129    }
34130}
34131impl std::fmt::Display
34132    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
34133{
34134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34135        f.write_str(self.as_str())
34136    }
34137}
34138
34139impl std::fmt::Debug
34140    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
34141{
34142    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34143        f.write_str(self.as_str())
34144    }
34145}
34146impl serde::Serialize
34147    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
34148{
34149    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34150    where
34151        S: serde::Serializer,
34152    {
34153        serializer.serialize_str(self.as_str())
34154    }
34155}
34156#[cfg(feature = "deserialize")]
34157impl<'de> serde::Deserialize<'de>
34158    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
34159{
34160    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34161        use std::str::FromStr;
34162        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34163        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
34164    }
34165}
34166/// Additional fields for Mandate creation
34167#[derive(Copy, Clone, Debug, serde::Serialize)]
34168pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
34169    /// The method used to collect offline mandate customer acceptance.
34170    #[serde(skip_serializing_if = "Option::is_none")]
34171    pub collection_method:
34172        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
34173}
34174impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
34175    pub fn new() -> Self {
34176        Self { collection_method: None }
34177    }
34178}
34179impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
34180    fn default() -> Self {
34181        Self::new()
34182    }
34183}
34184/// The method used to collect offline mandate customer acceptance.
34185#[derive(Copy, Clone, Eq, PartialEq)]
34186pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
34187    Paper,
34188}
34189impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
34190    pub fn as_str(self) -> &'static str {
34191        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
34192        match self {
34193            Paper => "paper",
34194        }
34195    }
34196}
34197
34198impl std::str::FromStr
34199    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
34200{
34201    type Err = stripe_types::StripeParseError;
34202    fn from_str(s: &str) -> Result<Self, Self::Err> {
34203        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
34204        match s {
34205            "paper" => Ok(Paper),
34206            _ => Err(stripe_types::StripeParseError),
34207        }
34208    }
34209}
34210impl std::fmt::Display
34211    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
34212{
34213    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34214        f.write_str(self.as_str())
34215    }
34216}
34217
34218impl std::fmt::Debug
34219    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
34220{
34221    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34222        f.write_str(self.as_str())
34223    }
34224}
34225impl serde::Serialize
34226    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
34227{
34228    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34229    where
34230        S: serde::Serializer,
34231    {
34232        serializer.serialize_str(self.as_str())
34233    }
34234}
34235#[cfg(feature = "deserialize")]
34236impl<'de> serde::Deserialize<'de>
34237    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
34238{
34239    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34240        use std::str::FromStr;
34241        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34242        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
34243    }
34244}
34245/// Additional fields for network related functions
34246#[derive(Clone, Debug, serde::Serialize)]
34247pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
34248    /// Triggers validations to run across the selected networks
34249    #[serde(skip_serializing_if = "Option::is_none")]
34250    pub requested:
34251        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
34252}
34253impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
34254    pub fn new() -> Self {
34255        Self { requested: None }
34256    }
34257}
34258impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
34259    fn default() -> Self {
34260        Self::new()
34261    }
34262}
34263/// Triggers validations to run across the selected networks
34264#[derive(Copy, Clone, Eq, PartialEq)]
34265pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34266    Ach,
34267    UsDomesticWire,
34268}
34269impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34270    pub fn as_str(self) -> &'static str {
34271        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
34272        match self {
34273            Ach => "ach",
34274            UsDomesticWire => "us_domestic_wire",
34275        }
34276    }
34277}
34278
34279impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34280    type Err = stripe_types::StripeParseError;
34281    fn from_str(s: &str) -> Result<Self, Self::Err> {
34282        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
34283        match s {
34284            "ach" => Ok(Ach),
34285            "us_domestic_wire" => Ok(UsDomesticWire),
34286            _ => Err(stripe_types::StripeParseError),
34287        }
34288    }
34289}
34290impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34291    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34292        f.write_str(self.as_str())
34293    }
34294}
34295
34296impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34298        f.write_str(self.as_str())
34299    }
34300}
34301impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34302    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34303    where
34304        S: serde::Serializer,
34305    {
34306        serializer.serialize_str(self.as_str())
34307    }
34308}
34309#[cfg(feature = "deserialize")]
34310impl<'de> serde::Deserialize<'de>
34311    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
34312{
34313    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34314        use std::str::FromStr;
34315        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34316        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
34317    }
34318}
34319/// Preferred transaction settlement speed
34320#[derive(Copy, Clone, Eq, PartialEq)]
34321pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
34322    Fastest,
34323    Standard,
34324}
34325impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
34326    pub fn as_str(self) -> &'static str {
34327        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
34328        match self {
34329            Fastest => "fastest",
34330            Standard => "standard",
34331        }
34332    }
34333}
34334
34335impl std::str::FromStr
34336    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34337{
34338    type Err = stripe_types::StripeParseError;
34339    fn from_str(s: &str) -> Result<Self, Self::Err> {
34340        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
34341        match s {
34342            "fastest" => Ok(Fastest),
34343            "standard" => Ok(Standard),
34344            _ => Err(stripe_types::StripeParseError),
34345        }
34346    }
34347}
34348impl std::fmt::Display
34349    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34350{
34351    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34352        f.write_str(self.as_str())
34353    }
34354}
34355
34356impl std::fmt::Debug
34357    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34358{
34359    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34360        f.write_str(self.as_str())
34361    }
34362}
34363impl serde::Serialize
34364    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34365{
34366    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34367    where
34368        S: serde::Serializer,
34369    {
34370        serializer.serialize_str(self.as_str())
34371    }
34372}
34373#[cfg(feature = "deserialize")]
34374impl<'de> serde::Deserialize<'de>
34375    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34376{
34377    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34378        use std::str::FromStr;
34379        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34380        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
34381    }
34382}
34383/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34384///
34385/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34386/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34387///
34388/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34389///
34390/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34391///
34392/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34393#[derive(Copy, Clone, Eq, PartialEq)]
34394pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34395    None,
34396    OffSession,
34397    OnSession,
34398}
34399impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34400    pub fn as_str(self) -> &'static str {
34401        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
34402        match self {
34403            None => "none",
34404            OffSession => "off_session",
34405            OnSession => "on_session",
34406        }
34407    }
34408}
34409
34410impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34411    type Err = stripe_types::StripeParseError;
34412    fn from_str(s: &str) -> Result<Self, Self::Err> {
34413        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
34414        match s {
34415            "none" => Ok(None),
34416            "off_session" => Ok(OffSession),
34417            "on_session" => Ok(OnSession),
34418            _ => Err(stripe_types::StripeParseError),
34419        }
34420    }
34421}
34422impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34423    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34424        f.write_str(self.as_str())
34425    }
34426}
34427
34428impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34429    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34430        f.write_str(self.as_str())
34431    }
34432}
34433impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34434    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34435    where
34436        S: serde::Serializer,
34437    {
34438        serializer.serialize_str(self.as_str())
34439    }
34440}
34441#[cfg(feature = "deserialize")]
34442impl<'de> serde::Deserialize<'de>
34443    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
34444{
34445    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34446        use std::str::FromStr;
34447        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34448        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
34449    }
34450}
34451/// Bank account verification method.
34452#[derive(Copy, Clone, Eq, PartialEq)]
34453pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34454    Automatic,
34455    Instant,
34456    Microdeposits,
34457}
34458impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34459    pub fn as_str(self) -> &'static str {
34460        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
34461        match self {
34462            Automatic => "automatic",
34463            Instant => "instant",
34464            Microdeposits => "microdeposits",
34465        }
34466    }
34467}
34468
34469impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34470    type Err = stripe_types::StripeParseError;
34471    fn from_str(s: &str) -> Result<Self, Self::Err> {
34472        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
34473        match s {
34474            "automatic" => Ok(Automatic),
34475            "instant" => Ok(Instant),
34476            "microdeposits" => Ok(Microdeposits),
34477            _ => Err(stripe_types::StripeParseError),
34478        }
34479    }
34480}
34481impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34482    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34483        f.write_str(self.as_str())
34484    }
34485}
34486
34487impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34489        f.write_str(self.as_str())
34490    }
34491}
34492impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34493    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34494    where
34495        S: serde::Serializer,
34496    {
34497        serializer.serialize_str(self.as_str())
34498    }
34499}
34500#[cfg(feature = "deserialize")]
34501impl<'de> serde::Deserialize<'de>
34502    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
34503{
34504    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34505        use std::str::FromStr;
34506        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34507        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
34508    }
34509}
34510/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
34511#[derive(Clone, Debug, serde::Serialize)]
34512pub struct ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
34513    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
34514    #[serde(skip_serializing_if = "Option::is_none")]
34515    pub app_id: Option<String>,
34516    /// The client type that the end customer will pay from
34517    #[serde(skip_serializing_if = "Option::is_none")]
34518    pub client: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient>,
34519    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34520    ///
34521    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34522    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34523    ///
34524    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34525    ///
34526    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34527    ///
34528    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34529    #[serde(skip_serializing_if = "Option::is_none")]
34530    pub setup_future_usage:
34531        Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
34532}
34533impl ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
34534    pub fn new() -> Self {
34535        Self { app_id: None, client: None, setup_future_usage: None }
34536    }
34537}
34538impl Default for ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
34539    fn default() -> Self {
34540        Self::new()
34541    }
34542}
34543/// The client type that the end customer will pay from
34544#[derive(Copy, Clone, Eq, PartialEq)]
34545pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34546    Android,
34547    Ios,
34548    Web,
34549}
34550impl ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34551    pub fn as_str(self) -> &'static str {
34552        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
34553        match self {
34554            Android => "android",
34555            Ios => "ios",
34556            Web => "web",
34557        }
34558    }
34559}
34560
34561impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34562    type Err = stripe_types::StripeParseError;
34563    fn from_str(s: &str) -> Result<Self, Self::Err> {
34564        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
34565        match s {
34566            "android" => Ok(Android),
34567            "ios" => Ok(Ios),
34568            "web" => Ok(Web),
34569            _ => Err(stripe_types::StripeParseError),
34570        }
34571    }
34572}
34573impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34574    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34575        f.write_str(self.as_str())
34576    }
34577}
34578
34579impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34580    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34581        f.write_str(self.as_str())
34582    }
34583}
34584impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34585    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34586    where
34587        S: serde::Serializer,
34588    {
34589        serializer.serialize_str(self.as_str())
34590    }
34591}
34592#[cfg(feature = "deserialize")]
34593impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34594    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34595        use std::str::FromStr;
34596        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34597        Self::from_str(&s).map_err(|_| {
34598            serde::de::Error::custom(
34599                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient",
34600            )
34601        })
34602    }
34603}
34604/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34605///
34606/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34607/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34608///
34609/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34610///
34611/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34612///
34613/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34614#[derive(Copy, Clone, Eq, PartialEq)]
34615pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34616    None,
34617}
34618impl ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34619    pub fn as_str(self) -> &'static str {
34620        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
34621        match self {
34622            None => "none",
34623        }
34624    }
34625}
34626
34627impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34628    type Err = stripe_types::StripeParseError;
34629    fn from_str(s: &str) -> Result<Self, Self::Err> {
34630        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
34631        match s {
34632            "none" => Ok(None),
34633            _ => Err(stripe_types::StripeParseError),
34634        }
34635    }
34636}
34637impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34638    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34639        f.write_str(self.as_str())
34640    }
34641}
34642
34643impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34644    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34645        f.write_str(self.as_str())
34646    }
34647}
34648impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34649    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34650    where
34651        S: serde::Serializer,
34652    {
34653        serializer.serialize_str(self.as_str())
34654    }
34655}
34656#[cfg(feature = "deserialize")]
34657impl<'de> serde::Deserialize<'de>
34658    for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
34659{
34660    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34661        use std::str::FromStr;
34662        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34663        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
34664    }
34665}
34666/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
34667#[derive(Copy, Clone, Debug, serde::Serialize)]
34668pub struct ConfirmPaymentIntentPaymentMethodOptionsZip {
34669    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34670    ///
34671    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34672    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34673    ///
34674    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34675    ///
34676    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34677    ///
34678    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34679    #[serde(skip_serializing_if = "Option::is_none")]
34680    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
34681}
34682impl ConfirmPaymentIntentPaymentMethodOptionsZip {
34683    pub fn new() -> Self {
34684        Self { setup_future_usage: None }
34685    }
34686}
34687impl Default for ConfirmPaymentIntentPaymentMethodOptionsZip {
34688    fn default() -> Self {
34689        Self::new()
34690    }
34691}
34692/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34693///
34694/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34695/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34696///
34697/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34698///
34699/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34700///
34701/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34702#[derive(Copy, Clone, Eq, PartialEq)]
34703pub enum ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34704    None,
34705}
34706impl ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34707    pub fn as_str(self) -> &'static str {
34708        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
34709        match self {
34710            None => "none",
34711        }
34712    }
34713}
34714
34715impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34716    type Err = stripe_types::StripeParseError;
34717    fn from_str(s: &str) -> Result<Self, Self::Err> {
34718        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
34719        match s {
34720            "none" => Ok(None),
34721            _ => Err(stripe_types::StripeParseError),
34722        }
34723    }
34724}
34725impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34727        f.write_str(self.as_str())
34728    }
34729}
34730
34731impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34733        f.write_str(self.as_str())
34734    }
34735}
34736impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34737    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34738    where
34739        S: serde::Serializer,
34740    {
34741        serializer.serialize_str(self.as_str())
34742    }
34743}
34744#[cfg(feature = "deserialize")]
34745impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34746    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34747        use std::str::FromStr;
34748        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34749        Self::from_str(&s).map_err(|_| {
34750            serde::de::Error::custom(
34751                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
34752            )
34753        })
34754    }
34755}
34756/// Options to configure Radar.
34757/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
34758#[derive(Clone, Debug, serde::Serialize)]
34759pub struct ConfirmPaymentIntentRadarOptions {
34760    /// 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.
34761    #[serde(skip_serializing_if = "Option::is_none")]
34762    pub session: Option<String>,
34763}
34764impl ConfirmPaymentIntentRadarOptions {
34765    pub fn new() -> Self {
34766        Self { session: None }
34767    }
34768}
34769impl Default for ConfirmPaymentIntentRadarOptions {
34770    fn default() -> Self {
34771        Self::new()
34772    }
34773}
34774/// Shipping information for this PaymentIntent.
34775#[derive(Clone, Debug, serde::Serialize)]
34776pub struct ConfirmPaymentIntentShipping {
34777    /// Shipping address.
34778    pub address: ConfirmPaymentIntentShippingAddress,
34779    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
34780    #[serde(skip_serializing_if = "Option::is_none")]
34781    pub carrier: Option<String>,
34782    /// Recipient name.
34783    pub name: String,
34784    /// Recipient phone (including extension).
34785    #[serde(skip_serializing_if = "Option::is_none")]
34786    pub phone: Option<String>,
34787    /// The tracking number for a physical product, obtained from the delivery service.
34788    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
34789    #[serde(skip_serializing_if = "Option::is_none")]
34790    pub tracking_number: Option<String>,
34791}
34792impl ConfirmPaymentIntentShipping {
34793    pub fn new(
34794        address: impl Into<ConfirmPaymentIntentShippingAddress>,
34795        name: impl Into<String>,
34796    ) -> Self {
34797        Self {
34798            address: address.into(),
34799            carrier: None,
34800            name: name.into(),
34801            phone: None,
34802            tracking_number: None,
34803        }
34804    }
34805}
34806/// Shipping address.
34807#[derive(Clone, Debug, serde::Serialize)]
34808pub struct ConfirmPaymentIntentShippingAddress {
34809    /// City, district, suburb, town, or village.
34810    #[serde(skip_serializing_if = "Option::is_none")]
34811    pub city: Option<String>,
34812    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
34813    #[serde(skip_serializing_if = "Option::is_none")]
34814    pub country: Option<String>,
34815    /// Address line 1, such as the street, PO Box, or company name.
34816    #[serde(skip_serializing_if = "Option::is_none")]
34817    pub line1: Option<String>,
34818    /// Address line 2, such as the apartment, suite, unit, or building.
34819    #[serde(skip_serializing_if = "Option::is_none")]
34820    pub line2: Option<String>,
34821    /// ZIP or postal code.
34822    #[serde(skip_serializing_if = "Option::is_none")]
34823    pub postal_code: Option<String>,
34824    /// State, county, province, or region.
34825    #[serde(skip_serializing_if = "Option::is_none")]
34826    pub state: Option<String>,
34827}
34828impl ConfirmPaymentIntentShippingAddress {
34829    pub fn new() -> Self {
34830        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
34831    }
34832}
34833impl Default for ConfirmPaymentIntentShippingAddress {
34834    fn default() -> Self {
34835        Self::new()
34836    }
34837}
34838/// Confirm that your customer intends to pay with current or provided
34839/// payment method. Upon confirmation, the PaymentIntent will attempt to initiate
34840/// a payment.
34841///
34842/// If the selected payment method requires additional authentication steps, the
34843/// PaymentIntent will transition to the `requires_action` status and
34844/// suggest additional actions via `next_action`. If payment fails,
34845/// the PaymentIntent transitions to the `requires_payment_method` status or the
34846/// `canceled` status if the confirmation limit is reached. If
34847/// payment succeeds, the PaymentIntent will transition to the `succeeded`
34848/// status (or `requires_capture`, if `capture_method` is set to `manual`).
34849///
34850/// If the `confirmation_method` is `automatic`, payment may be attempted
34851/// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
34852/// and the PaymentIntent’s [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
34853/// After `next_action`s are handled by the client, no additional
34854/// confirmation is required to complete the payment.
34855///
34856/// If the `confirmation_method` is `manual`, all payment attempts must be
34857/// initiated using a secret key.
34858///
34859/// If any actions are required for the payment, the PaymentIntent will
34860/// return to the `requires_confirmation` state
34861/// after those actions are completed. Your server needs to then
34862/// explicitly re-confirm the PaymentIntent to initiate the next payment
34863/// attempt.
34864///
34865/// There is a variable upper limit on how many times a PaymentIntent can be confirmed.
34866/// After this limit is reached, any further calls to this endpoint will
34867/// transition the PaymentIntent to the `canceled` state.
34868#[derive(Clone, Debug, serde::Serialize)]
34869pub struct ConfirmPaymentIntent {
34870    inner: ConfirmPaymentIntentBuilder,
34871    intent: stripe_shared::PaymentIntentId,
34872}
34873impl ConfirmPaymentIntent {
34874    /// Construct a new `ConfirmPaymentIntent`.
34875    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
34876        Self { intent: intent.into(), inner: ConfirmPaymentIntentBuilder::new() }
34877    }
34878    /// Provides industry-specific information about the amount.
34879    pub fn amount_details(
34880        mut self,
34881        amount_details: impl Into<ConfirmPaymentIntentAmountDetails>,
34882    ) -> Self {
34883        self.inner.amount_details = Some(amount_details.into());
34884        self
34885    }
34886    /// Controls when the funds will be captured from the customer's account.
34887    pub fn capture_method(
34888        mut self,
34889        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
34890    ) -> Self {
34891        self.inner.capture_method = Some(capture_method.into());
34892        self
34893    }
34894    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
34895    ///
34896    /// 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.
34897    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
34898        self.inner.confirmation_token = Some(confirmation_token.into());
34899        self
34900    }
34901    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
34902    /// This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication).
34903    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
34904        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
34905        self
34906    }
34907    /// The list of payment method types to exclude from use with this payment.
34908    pub fn excluded_payment_method_types(
34909        mut self,
34910        excluded_payment_method_types: impl Into<
34911            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
34912        >,
34913    ) -> Self {
34914        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
34915        self
34916    }
34917    /// Specifies which fields in the response should be expanded.
34918    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
34919        self.inner.expand = Some(expand.into());
34920        self
34921    }
34922    /// Automations to be run during the PaymentIntent lifecycle
34923    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
34924        self.inner.hooks = Some(hooks.into());
34925        self
34926    }
34927    /// ID of the mandate that's used for this payment.
34928    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
34929        self.inner.mandate = Some(mandate.into());
34930        self
34931    }
34932    pub fn mandate_data(
34933        mut self,
34934        mandate_data: impl Into<ConfirmPaymentIntentMandateData>,
34935    ) -> Self {
34936        self.inner.mandate_data = Some(mandate_data.into());
34937        self
34938    }
34939    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
34940    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
34941    pub fn off_session(mut self, off_session: impl Into<ConfirmPaymentIntentOffSession>) -> Self {
34942        self.inner.off_session = Some(off_session.into());
34943        self
34944    }
34945    /// Provides industry-specific information about the charge.
34946    pub fn payment_details(
34947        mut self,
34948        payment_details: impl Into<ConfirmPaymentIntentPaymentDetails>,
34949    ) -> Self {
34950        self.inner.payment_details = Some(payment_details.into());
34951        self
34952    }
34953    /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.
34954    /// If the payment method is attached to a Customer, it must match the [customer](https://stripe.com/docs/api#create_payment_intent-customer) that is set on this PaymentIntent.
34955    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
34956        self.inner.payment_method = Some(payment_method.into());
34957        self
34958    }
34959    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
34960    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
34961    /// property on the PaymentIntent.
34962    pub fn payment_method_data(
34963        mut self,
34964        payment_method_data: impl Into<ConfirmPaymentIntentPaymentMethodData>,
34965    ) -> Self {
34966        self.inner.payment_method_data = Some(payment_method_data.into());
34967        self
34968    }
34969    /// Payment method-specific configuration for this PaymentIntent.
34970    pub fn payment_method_options(
34971        mut self,
34972        payment_method_options: impl Into<ConfirmPaymentIntentPaymentMethodOptions>,
34973    ) -> Self {
34974        self.inner.payment_method_options = Some(payment_method_options.into());
34975        self
34976    }
34977    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
34978    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
34979    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
34980    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
34981        self.inner.payment_method_types = Some(payment_method_types.into());
34982        self
34983    }
34984    /// Options to configure Radar.
34985    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
34986    pub fn radar_options(
34987        mut self,
34988        radar_options: impl Into<ConfirmPaymentIntentRadarOptions>,
34989    ) -> Self {
34990        self.inner.radar_options = Some(radar_options.into());
34991        self
34992    }
34993    /// Email address that the receipt for the resulting payment will be sent to.
34994    /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
34995    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
34996        self.inner.receipt_email = Some(receipt_email.into());
34997        self
34998    }
34999    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
35000    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
35001    /// This parameter is only used for cards and other redirect-based payment methods.
35002    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
35003        self.inner.return_url = Some(return_url.into());
35004        self
35005    }
35006    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35007    ///
35008    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35009    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35010    ///
35011    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35012    ///
35013    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35014    ///
35015    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35016    pub fn setup_future_usage(
35017        mut self,
35018        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
35019    ) -> Self {
35020        self.inner.setup_future_usage = Some(setup_future_usage.into());
35021        self
35022    }
35023    /// Shipping information for this PaymentIntent.
35024    pub fn shipping(mut self, shipping: impl Into<ConfirmPaymentIntentShipping>) -> Self {
35025        self.inner.shipping = Some(shipping.into());
35026        self
35027    }
35028    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
35029    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
35030        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
35031        self
35032    }
35033}
35034impl ConfirmPaymentIntent {
35035    /// Send the request and return the deserialized response.
35036    pub async fn send<C: StripeClient>(
35037        &self,
35038        client: &C,
35039    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35040        self.customize().send(client).await
35041    }
35042
35043    /// Send the request and return the deserialized response, blocking until completion.
35044    pub fn send_blocking<C: StripeBlockingClient>(
35045        &self,
35046        client: &C,
35047    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35048        self.customize().send_blocking(client)
35049    }
35050}
35051
35052impl StripeRequest for ConfirmPaymentIntent {
35053    type Output = stripe_shared::PaymentIntent;
35054
35055    fn build(&self) -> RequestBuilder {
35056        let intent = &self.intent;
35057        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/confirm"))
35058            .form(&self.inner)
35059    }
35060}
35061#[derive(Clone, Debug, serde::Serialize)]
35062struct IncrementAuthorizationPaymentIntentBuilder {
35063    amount: i64,
35064    #[serde(skip_serializing_if = "Option::is_none")]
35065    amount_details: Option<IncrementAuthorizationPaymentIntentAmountDetails>,
35066    #[serde(skip_serializing_if = "Option::is_none")]
35067    application_fee_amount: Option<i64>,
35068    #[serde(skip_serializing_if = "Option::is_none")]
35069    description: Option<String>,
35070    #[serde(skip_serializing_if = "Option::is_none")]
35071    expand: Option<Vec<String>>,
35072    #[serde(skip_serializing_if = "Option::is_none")]
35073    hooks: Option<AsyncWorkflowsParam>,
35074    #[serde(skip_serializing_if = "Option::is_none")]
35075    metadata: Option<std::collections::HashMap<String, String>>,
35076    #[serde(skip_serializing_if = "Option::is_none")]
35077    payment_details: Option<IncrementAuthorizationPaymentIntentPaymentDetails>,
35078    #[serde(skip_serializing_if = "Option::is_none")]
35079    statement_descriptor: Option<String>,
35080    #[serde(skip_serializing_if = "Option::is_none")]
35081    transfer_data: Option<IncrementAuthorizationPaymentIntentTransferData>,
35082}
35083impl IncrementAuthorizationPaymentIntentBuilder {
35084    fn new(amount: impl Into<i64>) -> Self {
35085        Self {
35086            amount: amount.into(),
35087            amount_details: None,
35088            application_fee_amount: None,
35089            description: None,
35090            expand: None,
35091            hooks: None,
35092            metadata: None,
35093            payment_details: None,
35094            statement_descriptor: None,
35095            transfer_data: None,
35096        }
35097    }
35098}
35099/// Provides industry-specific information about the amount.
35100#[derive(Clone, Debug, serde::Serialize)]
35101pub struct IncrementAuthorizationPaymentIntentAmountDetails {
35102    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35103    /// An integer greater than 0.
35104    ///
35105    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
35106    #[serde(skip_serializing_if = "Option::is_none")]
35107    pub discount_amount: Option<i64>,
35108    /// A list of line items, each containing information about a product in the PaymentIntent.
35109    /// There is a maximum of 100 line items.
35110    #[serde(skip_serializing_if = "Option::is_none")]
35111    pub line_items: Option<Vec<IncrementAuthorizationPaymentIntentAmountDetailsLineItems>>,
35112    /// Contains information about the shipping portion of the amount.
35113    #[serde(skip_serializing_if = "Option::is_none")]
35114    pub shipping: Option<AmountDetailsShippingParam>,
35115    /// Contains information about the tax portion of the amount.
35116    #[serde(skip_serializing_if = "Option::is_none")]
35117    pub tax: Option<AmountDetailsTaxParam>,
35118}
35119impl IncrementAuthorizationPaymentIntentAmountDetails {
35120    pub fn new() -> Self {
35121        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
35122    }
35123}
35124impl Default for IncrementAuthorizationPaymentIntentAmountDetails {
35125    fn default() -> Self {
35126        Self::new()
35127    }
35128}
35129/// A list of line items, each containing information about a product in the PaymentIntent.
35130/// There is a maximum of 100 line items.
35131#[derive(Clone, Debug, serde::Serialize)]
35132pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItems {
35133    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35134    /// An integer greater than 0.
35135    ///
35136    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
35137    #[serde(skip_serializing_if = "Option::is_none")]
35138    pub discount_amount: Option<i64>,
35139    /// Payment method-specific information for line items.
35140    #[serde(skip_serializing_if = "Option::is_none")]
35141    pub payment_method_options:
35142        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
35143    /// The product code of the line item, such as an SKU.
35144    /// Required for L3 rates.
35145    /// At most 12 characters long.
35146    #[serde(skip_serializing_if = "Option::is_none")]
35147    pub product_code: Option<String>,
35148    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
35149    ///
35150    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
35151    /// For Paypal, this field is truncated to 127 characters.
35152    pub product_name: String,
35153    /// The quantity of items. Required for L3 rates. An integer greater than 0.
35154    pub quantity: u64,
35155    /// Contains information about the tax on the item.
35156    #[serde(skip_serializing_if = "Option::is_none")]
35157    pub tax: Option<AmountDetailsLineItemTaxParam>,
35158    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35159    /// Required for L3 rates.
35160    /// An integer greater than or equal to 0.
35161    pub unit_cost: i64,
35162    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
35163    #[serde(skip_serializing_if = "Option::is_none")]
35164    pub unit_of_measure: Option<String>,
35165}
35166impl IncrementAuthorizationPaymentIntentAmountDetailsLineItems {
35167    pub fn new(
35168        product_name: impl Into<String>,
35169        quantity: impl Into<u64>,
35170        unit_cost: impl Into<i64>,
35171    ) -> Self {
35172        Self {
35173            discount_amount: None,
35174            payment_method_options: None,
35175            product_code: None,
35176            product_name: product_name.into(),
35177            quantity: quantity.into(),
35178            tax: None,
35179            unit_cost: unit_cost.into(),
35180            unit_of_measure: None,
35181        }
35182    }
35183}
35184/// Payment method-specific information for line items.
35185#[derive(Clone, Debug, serde::Serialize)]
35186pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
35187    /// This sub-hash contains line item details that are specific to `card` payment method."
35188    #[serde(skip_serializing_if = "Option::is_none")]
35189    pub card:
35190        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
35191    /// This sub-hash contains line item details that are specific to `card_present` payment method."
35192    #[serde(skip_serializing_if = "Option::is_none")]
35193    pub card_present: Option<
35194        IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent,
35195    >,
35196    /// This sub-hash contains line item details that are specific to `klarna` payment method."
35197    #[serde(skip_serializing_if = "Option::is_none")]
35198    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
35199    /// This sub-hash contains line item details that are specific to `paypal` payment method."
35200    #[serde(skip_serializing_if = "Option::is_none")]
35201    pub paypal:
35202        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
35203}
35204impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
35205    pub fn new() -> Self {
35206        Self { card: None, card_present: None, klarna: None, paypal: None }
35207    }
35208}
35209impl Default for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
35210    fn default() -> Self {
35211        Self::new()
35212    }
35213}
35214/// This sub-hash contains line item details that are specific to `card` payment method."
35215#[derive(Clone, Debug, serde::Serialize)]
35216pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
35217    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
35218    #[serde(skip_serializing_if = "Option::is_none")]
35219    pub commodity_code: Option<String>,
35220}
35221impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
35222    pub fn new() -> Self {
35223        Self { commodity_code: None }
35224    }
35225}
35226impl Default for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
35227    fn default() -> Self {
35228        Self::new()
35229    }
35230}
35231/// This sub-hash contains line item details that are specific to `card_present` payment method."
35232#[derive(Clone, Debug, serde::Serialize)]
35233pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent
35234{
35235    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
35236    #[serde(skip_serializing_if = "Option::is_none")]
35237    pub commodity_code: Option<String>,
35238}
35239impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
35240    pub fn new() -> Self {
35241        Self { commodity_code: None }
35242    }
35243}
35244impl Default
35245    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent
35246{
35247    fn default() -> Self {
35248        Self::new()
35249    }
35250}
35251/// This sub-hash contains line item details that are specific to `paypal` payment method."
35252#[derive(Clone, Debug, serde::Serialize)]
35253pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
35254    /// Type of the line item.
35255    #[serde(skip_serializing_if = "Option::is_none")]
35256    pub category: Option<
35257        IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory,
35258    >,
35259    /// Description of the line item.
35260    #[serde(skip_serializing_if = "Option::is_none")]
35261    pub description: Option<String>,
35262    /// The Stripe account ID of the connected account that sells the item.
35263    #[serde(skip_serializing_if = "Option::is_none")]
35264    pub sold_by: Option<String>,
35265}
35266impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
35267    pub fn new() -> Self {
35268        Self { category: None, description: None, sold_by: None }
35269    }
35270}
35271impl Default
35272    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal
35273{
35274    fn default() -> Self {
35275        Self::new()
35276    }
35277}
35278/// Type of the line item.
35279#[derive(Copy, Clone, Eq, PartialEq)]
35280pub enum IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35281{
35282    DigitalGoods,
35283    Donation,
35284    PhysicalGoods,
35285}
35286impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
35287    pub fn as_str(self) -> &'static str {
35288        use IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
35289        match self {
35290            DigitalGoods => "digital_goods",
35291            Donation => "donation",
35292            PhysicalGoods => "physical_goods",
35293        }
35294    }
35295}
35296
35297impl std::str::FromStr
35298    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35299{
35300    type Err = stripe_types::StripeParseError;
35301    fn from_str(s: &str) -> Result<Self, Self::Err> {
35302        use IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
35303        match s {
35304            "digital_goods" => Ok(DigitalGoods),
35305            "donation" => Ok(Donation),
35306            "physical_goods" => Ok(PhysicalGoods),
35307            _ => Err(stripe_types::StripeParseError),
35308        }
35309    }
35310}
35311impl std::fmt::Display
35312    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35313{
35314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35315        f.write_str(self.as_str())
35316    }
35317}
35318
35319impl std::fmt::Debug
35320    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35321{
35322    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35323        f.write_str(self.as_str())
35324    }
35325}
35326impl serde::Serialize
35327    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35328{
35329    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35330    where
35331        S: serde::Serializer,
35332    {
35333        serializer.serialize_str(self.as_str())
35334    }
35335}
35336#[cfg(feature = "deserialize")]
35337impl<'de> serde::Deserialize<'de>
35338    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35339{
35340    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35341        use std::str::FromStr;
35342        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35343        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
35344    }
35345}
35346/// Provides industry-specific information about the charge.
35347#[derive(Clone, Debug, serde::Serialize)]
35348pub struct IncrementAuthorizationPaymentIntentPaymentDetails {
35349    /// A unique value to identify the customer. This field is available only for card payments.
35350    ///
35351    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
35352    #[serde(skip_serializing_if = "Option::is_none")]
35353    pub customer_reference: Option<String>,
35354    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
35355    ///
35356    /// Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`.
35357    ///
35358    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
35359    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
35360    #[serde(skip_serializing_if = "Option::is_none")]
35361    pub order_reference: Option<String>,
35362}
35363impl IncrementAuthorizationPaymentIntentPaymentDetails {
35364    pub fn new() -> Self {
35365        Self { customer_reference: None, order_reference: None }
35366    }
35367}
35368impl Default for IncrementAuthorizationPaymentIntentPaymentDetails {
35369    fn default() -> Self {
35370        Self::new()
35371    }
35372}
35373/// The parameters used to automatically create a transfer after the payment is captured.
35374/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
35375#[derive(Copy, Clone, Debug, serde::Serialize)]
35376pub struct IncrementAuthorizationPaymentIntentTransferData {
35377    /// The amount that will be transferred automatically when a charge succeeds.
35378    #[serde(skip_serializing_if = "Option::is_none")]
35379    pub amount: Option<i64>,
35380}
35381impl IncrementAuthorizationPaymentIntentTransferData {
35382    pub fn new() -> Self {
35383        Self { amount: None }
35384    }
35385}
35386impl Default for IncrementAuthorizationPaymentIntentTransferData {
35387    fn default() -> Self {
35388        Self::new()
35389    }
35390}
35391/// Perform an incremental authorization on an eligible
35392/// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
35393/// PaymentIntent’s status must be `requires_capture` and
35394/// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported).
35395/// must be `true`.
35396///
35397/// Incremental authorizations attempt to increase the authorized amount on
35398/// your customer’s card to the new, higher `amount` provided. Similar to the
35399/// initial authorization, incremental authorizations can be declined. A
35400/// single PaymentIntent can call this endpoint multiple times to further
35401/// increase the authorized amount.
35402///
35403/// If the incremental authorization succeeds, the PaymentIntent object
35404/// returns with the updated
35405/// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
35406/// If the incremental authorization fails, a
35407/// [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
35408/// fields on the PaymentIntent or Charge update. The PaymentIntent
35409/// object remains capturable for the previously authorized amount.
35410///
35411/// Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
35412/// After it’s captured, a PaymentIntent can no longer be incremented.
35413///
35414/// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
35415#[derive(Clone, Debug, serde::Serialize)]
35416pub struct IncrementAuthorizationPaymentIntent {
35417    inner: IncrementAuthorizationPaymentIntentBuilder,
35418    intent: stripe_shared::PaymentIntentId,
35419}
35420impl IncrementAuthorizationPaymentIntent {
35421    /// Construct a new `IncrementAuthorizationPaymentIntent`.
35422    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>, amount: impl Into<i64>) -> Self {
35423        Self {
35424            intent: intent.into(),
35425            inner: IncrementAuthorizationPaymentIntentBuilder::new(amount.into()),
35426        }
35427    }
35428    /// Provides industry-specific information about the amount.
35429    pub fn amount_details(
35430        mut self,
35431        amount_details: impl Into<IncrementAuthorizationPaymentIntentAmountDetails>,
35432    ) -> Self {
35433        self.inner.amount_details = Some(amount_details.into());
35434        self
35435    }
35436    /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
35437    /// The amount of the application fee collected will be capped at the total amount captured.
35438    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
35439    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
35440        self.inner.application_fee_amount = Some(application_fee_amount.into());
35441        self
35442    }
35443    /// An arbitrary string attached to the object. Often useful for displaying to users.
35444    pub fn description(mut self, description: impl Into<String>) -> Self {
35445        self.inner.description = Some(description.into());
35446        self
35447    }
35448    /// Specifies which fields in the response should be expanded.
35449    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
35450        self.inner.expand = Some(expand.into());
35451        self
35452    }
35453    /// Automations to be run during the PaymentIntent lifecycle
35454    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
35455        self.inner.hooks = Some(hooks.into());
35456        self
35457    }
35458    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
35459    /// This can be useful for storing additional information about the object in a structured format.
35460    /// Individual keys can be unset by posting an empty value to them.
35461    /// All keys can be unset by posting an empty value to `metadata`.
35462    pub fn metadata(
35463        mut self,
35464        metadata: impl Into<std::collections::HashMap<String, String>>,
35465    ) -> Self {
35466        self.inner.metadata = Some(metadata.into());
35467        self
35468    }
35469    /// Provides industry-specific information about the charge.
35470    pub fn payment_details(
35471        mut self,
35472        payment_details: impl Into<IncrementAuthorizationPaymentIntentPaymentDetails>,
35473    ) -> Self {
35474        self.inner.payment_details = Some(payment_details.into());
35475        self
35476    }
35477    /// Text that appears on the customer's statement as the statement descriptor for a non-card or card charge.
35478    /// This value overrides the account's default statement descriptor.
35479    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
35480    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
35481        self.inner.statement_descriptor = Some(statement_descriptor.into());
35482        self
35483    }
35484    /// The parameters used to automatically create a transfer after the payment is captured.
35485    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
35486    pub fn transfer_data(
35487        mut self,
35488        transfer_data: impl Into<IncrementAuthorizationPaymentIntentTransferData>,
35489    ) -> Self {
35490        self.inner.transfer_data = Some(transfer_data.into());
35491        self
35492    }
35493}
35494impl IncrementAuthorizationPaymentIntent {
35495    /// Send the request and return the deserialized response.
35496    pub async fn send<C: StripeClient>(
35497        &self,
35498        client: &C,
35499    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35500        self.customize().send(client).await
35501    }
35502
35503    /// Send the request and return the deserialized response, blocking until completion.
35504    pub fn send_blocking<C: StripeBlockingClient>(
35505        &self,
35506        client: &C,
35507    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35508        self.customize().send_blocking(client)
35509    }
35510}
35511
35512impl StripeRequest for IncrementAuthorizationPaymentIntent {
35513    type Output = stripe_shared::PaymentIntent;
35514
35515    fn build(&self) -> RequestBuilder {
35516        let intent = &self.intent;
35517        RequestBuilder::new(
35518            StripeMethod::Post,
35519            format!("/payment_intents/{intent}/increment_authorization"),
35520        )
35521        .form(&self.inner)
35522    }
35523}
35524#[derive(Clone, Debug, serde::Serialize)]
35525struct VerifyMicrodepositsPaymentIntentBuilder {
35526    #[serde(skip_serializing_if = "Option::is_none")]
35527    amounts: Option<Vec<i64>>,
35528    #[serde(skip_serializing_if = "Option::is_none")]
35529    descriptor_code: Option<String>,
35530    #[serde(skip_serializing_if = "Option::is_none")]
35531    expand: Option<Vec<String>>,
35532}
35533impl VerifyMicrodepositsPaymentIntentBuilder {
35534    fn new() -> Self {
35535        Self { amounts: None, descriptor_code: None, expand: None }
35536    }
35537}
35538/// Verifies microdeposits on a PaymentIntent object.
35539#[derive(Clone, Debug, serde::Serialize)]
35540pub struct VerifyMicrodepositsPaymentIntent {
35541    inner: VerifyMicrodepositsPaymentIntentBuilder,
35542    intent: stripe_shared::PaymentIntentId,
35543}
35544impl VerifyMicrodepositsPaymentIntent {
35545    /// Construct a new `VerifyMicrodepositsPaymentIntent`.
35546    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
35547        Self { intent: intent.into(), inner: VerifyMicrodepositsPaymentIntentBuilder::new() }
35548    }
35549    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
35550    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
35551        self.inner.amounts = Some(amounts.into());
35552        self
35553    }
35554    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
35555    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
35556        self.inner.descriptor_code = Some(descriptor_code.into());
35557        self
35558    }
35559    /// Specifies which fields in the response should be expanded.
35560    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
35561        self.inner.expand = Some(expand.into());
35562        self
35563    }
35564}
35565impl VerifyMicrodepositsPaymentIntent {
35566    /// Send the request and return the deserialized response.
35567    pub async fn send<C: StripeClient>(
35568        &self,
35569        client: &C,
35570    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35571        self.customize().send(client).await
35572    }
35573
35574    /// Send the request and return the deserialized response, blocking until completion.
35575    pub fn send_blocking<C: StripeBlockingClient>(
35576        &self,
35577        client: &C,
35578    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35579        self.customize().send_blocking(client)
35580    }
35581}
35582
35583impl StripeRequest for VerifyMicrodepositsPaymentIntent {
35584    type Output = stripe_shared::PaymentIntent;
35585
35586    fn build(&self) -> RequestBuilder {
35587        let intent = &self.intent;
35588        RequestBuilder::new(
35589            StripeMethod::Post,
35590            format!("/payment_intents/{intent}/verify_microdeposits"),
35591        )
35592        .form(&self.inner)
35593    }
35594}
35595
35596#[derive(Clone, Debug, serde::Serialize)]
35597pub struct PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
35598    /// URL to an image for the product. Max length, 4096 characters.
35599    #[serde(skip_serializing_if = "Option::is_none")]
35600    pub image_url: Option<String>,
35601    /// URL to the product page. Max length, 4096 characters.
35602    #[serde(skip_serializing_if = "Option::is_none")]
35603    pub product_url: Option<String>,
35604    /// Unique reference for this line item to correlate it with your system’s internal records.
35605    /// The field is displayed in the Klarna Consumer App if passed.
35606    #[serde(skip_serializing_if = "Option::is_none")]
35607    pub reference: Option<String>,
35608    /// Reference for the subscription this line item is for.
35609    #[serde(skip_serializing_if = "Option::is_none")]
35610    pub subscription_reference: Option<String>,
35611}
35612impl PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
35613    pub fn new() -> Self {
35614        Self { image_url: None, product_url: None, reference: None, subscription_reference: None }
35615    }
35616}
35617impl Default for PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
35618    fn default() -> Self {
35619        Self::new()
35620    }
35621}
35622#[derive(Copy, Clone, Debug, serde::Serialize)]
35623pub struct AmountDetailsLineItemTaxParam {
35624    /// The total amount of tax on a single line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35625    /// Required for L3 rates.
35626    /// An integer greater than or equal to 0.
35627    ///
35628    /// This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field.
35629    pub total_tax_amount: i64,
35630}
35631impl AmountDetailsLineItemTaxParam {
35632    pub fn new(total_tax_amount: impl Into<i64>) -> Self {
35633        Self { total_tax_amount: total_tax_amount.into() }
35634    }
35635}
35636#[derive(Clone, Debug, serde::Serialize)]
35637pub struct AmountDetailsShippingParam {
35638    /// If a physical good is being shipped, the cost of shipping represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35639    /// An integer greater than or equal to 0.
35640    #[serde(skip_serializing_if = "Option::is_none")]
35641    pub amount: Option<i64>,
35642    /// If a physical good is being shipped, the postal code of where it is being shipped from.
35643    /// At most 10 alphanumeric characters long, hyphens are allowed.
35644    #[serde(skip_serializing_if = "Option::is_none")]
35645    pub from_postal_code: Option<String>,
35646    /// If a physical good is being shipped, the postal code of where it is being shipped to.
35647    /// At most 10 alphanumeric characters long, hyphens are allowed.
35648    #[serde(skip_serializing_if = "Option::is_none")]
35649    pub to_postal_code: Option<String>,
35650}
35651impl AmountDetailsShippingParam {
35652    pub fn new() -> Self {
35653        Self { amount: None, from_postal_code: None, to_postal_code: None }
35654    }
35655}
35656impl Default for AmountDetailsShippingParam {
35657    fn default() -> Self {
35658        Self::new()
35659    }
35660}
35661#[derive(Copy, Clone, Debug, serde::Serialize)]
35662pub struct AmountDetailsTaxParam {
35663    /// The total amount of tax on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35664    /// Required for L2 rates.
35665    /// An integer greater than or equal to 0.
35666    ///
35667    /// This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field.
35668    pub total_tax_amount: i64,
35669}
35670impl AmountDetailsTaxParam {
35671    pub fn new(total_tax_amount: impl Into<i64>) -> Self {
35672        Self { total_tax_amount: total_tax_amount.into() }
35673    }
35674}
35675#[derive(Clone, Debug, serde::Serialize)]
35676pub struct AsyncWorkflowsInputsTaxParam {
35677    /// The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id
35678    pub calculation: String,
35679}
35680impl AsyncWorkflowsInputsTaxParam {
35681    pub fn new(calculation: impl Into<String>) -> Self {
35682        Self { calculation: calculation.into() }
35683    }
35684}
35685#[derive(Clone, Debug, serde::Serialize)]
35686pub struct OnlineParam {
35687    /// The IP address from which the Mandate was accepted by the customer.
35688    pub ip_address: String,
35689    /// The user agent of the browser from which the Mandate was accepted by the customer.
35690    pub user_agent: String,
35691}
35692impl OnlineParam {
35693    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
35694        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
35695    }
35696}
35697#[derive(Clone, Debug, serde::Serialize)]
35698pub struct PaymentMethodParam {
35699    /// Customer's bank account number.
35700    pub account_number: String,
35701    /// Institution number of the customer's bank.
35702    pub institution_number: String,
35703    /// Transit number of the customer's bank.
35704    pub transit_number: String,
35705}
35706impl PaymentMethodParam {
35707    pub fn new(
35708        account_number: impl Into<String>,
35709        institution_number: impl Into<String>,
35710        transit_number: impl Into<String>,
35711    ) -> Self {
35712        Self {
35713            account_number: account_number.into(),
35714            institution_number: institution_number.into(),
35715            transit_number: transit_number.into(),
35716        }
35717    }
35718}
35719#[derive(Copy, Clone, Debug, serde::Serialize)]
35720pub struct DateOfBirth {
35721    /// The day of birth, between 1 and 31.
35722    pub day: i64,
35723    /// The month of birth, between 1 and 12.
35724    pub month: i64,
35725    /// The four-digit year of birth.
35726    pub year: i64,
35727}
35728impl DateOfBirth {
35729    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
35730        Self { day: day.into(), month: month.into(), year: year.into() }
35731    }
35732}
35733#[derive(Clone, Debug, serde::Serialize)]
35734pub struct PaymentMethodOptionsMandateOptionsParam {
35735    /// Prefix used to generate the Mandate reference.
35736    /// Must be at most 12 characters long.
35737    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
35738    /// Cannot begin with 'DDIC' or 'STRIPE'.
35739    #[serde(skip_serializing_if = "Option::is_none")]
35740    pub reference_prefix: Option<String>,
35741}
35742impl PaymentMethodOptionsMandateOptionsParam {
35743    pub fn new() -> Self {
35744        Self { reference_prefix: None }
35745    }
35746}
35747impl Default for PaymentMethodOptionsMandateOptionsParam {
35748    fn default() -> Self {
35749        Self::new()
35750    }
35751}
35752#[derive(Clone, Debug, serde::Serialize)]
35753pub struct EuBankTransferParams {
35754    /// The desired country code of the bank account information.
35755    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
35756    pub country: String,
35757}
35758impl EuBankTransferParams {
35759    pub fn new(country: impl Into<String>) -> Self {
35760        Self { country: country.into() }
35761    }
35762}
35763#[derive(Clone, Debug, serde::Serialize)]
35764pub struct SubscriptionNextBillingParam {
35765    /// The amount of the next charge for the subscription.
35766    pub amount: i64,
35767    /// The date of the next charge for the subscription in YYYY-MM-DD format.
35768    pub date: String,
35769}
35770impl SubscriptionNextBillingParam {
35771    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
35772        Self { amount: amount.into(), date: date.into() }
35773    }
35774}
35775#[derive(Clone, Debug, serde::Serialize)]
35776pub struct AsyncWorkflowsInputsParam {
35777    /// Tax arguments for automations
35778    #[serde(skip_serializing_if = "Option::is_none")]
35779    pub tax: Option<AsyncWorkflowsInputsTaxParam>,
35780}
35781impl AsyncWorkflowsInputsParam {
35782    pub fn new() -> Self {
35783        Self { tax: None }
35784    }
35785}
35786impl Default for AsyncWorkflowsInputsParam {
35787    fn default() -> Self {
35788        Self::new()
35789    }
35790}
35791#[derive(Clone, Debug, serde::Serialize)]
35792pub struct AsyncWorkflowsParam {
35793    /// Arguments passed in automations
35794    #[serde(skip_serializing_if = "Option::is_none")]
35795    pub inputs: Option<AsyncWorkflowsInputsParam>,
35796}
35797impl AsyncWorkflowsParam {
35798    pub fn new() -> Self {
35799        Self { inputs: None }
35800    }
35801}
35802impl Default for AsyncWorkflowsParam {
35803    fn default() -> Self {
35804        Self::new()
35805    }
35806}