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    mandate: Option<String>,
295    #[serde(skip_serializing_if = "Option::is_none")]
296    mandate_data: Option<CreatePaymentIntentMandateData>,
297    #[serde(skip_serializing_if = "Option::is_none")]
298    metadata: Option<std::collections::HashMap<String, String>>,
299    #[serde(skip_serializing_if = "Option::is_none")]
300    off_session: Option<CreatePaymentIntentOffSession>,
301    #[serde(skip_serializing_if = "Option::is_none")]
302    on_behalf_of: Option<String>,
303    #[serde(skip_serializing_if = "Option::is_none")]
304    payment_details: Option<CreatePaymentIntentPaymentDetails>,
305    #[serde(skip_serializing_if = "Option::is_none")]
306    payment_method: Option<String>,
307    #[serde(skip_serializing_if = "Option::is_none")]
308    payment_method_configuration: Option<String>,
309    #[serde(skip_serializing_if = "Option::is_none")]
310    payment_method_data: Option<CreatePaymentIntentPaymentMethodData>,
311    #[serde(skip_serializing_if = "Option::is_none")]
312    payment_method_options: Option<CreatePaymentIntentPaymentMethodOptions>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    payment_method_types: Option<Vec<String>>,
315    #[serde(skip_serializing_if = "Option::is_none")]
316    radar_options: Option<CreatePaymentIntentRadarOptions>,
317    #[serde(skip_serializing_if = "Option::is_none")]
318    receipt_email: Option<String>,
319    #[serde(skip_serializing_if = "Option::is_none")]
320    return_url: Option<String>,
321    #[serde(skip_serializing_if = "Option::is_none")]
322    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
323    #[serde(skip_serializing_if = "Option::is_none")]
324    shipping: Option<CreatePaymentIntentShipping>,
325    #[serde(skip_serializing_if = "Option::is_none")]
326    statement_descriptor: Option<String>,
327    #[serde(skip_serializing_if = "Option::is_none")]
328    statement_descriptor_suffix: Option<String>,
329    #[serde(skip_serializing_if = "Option::is_none")]
330    transfer_data: Option<CreatePaymentIntentTransferData>,
331    #[serde(skip_serializing_if = "Option::is_none")]
332    transfer_group: Option<String>,
333    #[serde(skip_serializing_if = "Option::is_none")]
334    use_stripe_sdk: Option<bool>,
335}
336impl CreatePaymentIntentBuilder {
337    fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
338        Self {
339            amount: amount.into(),
340            amount_details: None,
341            application_fee_amount: None,
342            automatic_payment_methods: None,
343            capture_method: None,
344            confirm: None,
345            confirmation_method: None,
346            confirmation_token: None,
347            currency: currency.into(),
348            customer: None,
349            description: None,
350            error_on_requires_action: None,
351            excluded_payment_method_types: None,
352            expand: None,
353            mandate: None,
354            mandate_data: None,
355            metadata: None,
356            off_session: None,
357            on_behalf_of: None,
358            payment_details: None,
359            payment_method: None,
360            payment_method_configuration: None,
361            payment_method_data: None,
362            payment_method_options: None,
363            payment_method_types: None,
364            radar_options: None,
365            receipt_email: None,
366            return_url: None,
367            setup_future_usage: None,
368            shipping: None,
369            statement_descriptor: None,
370            statement_descriptor_suffix: None,
371            transfer_data: None,
372            transfer_group: None,
373            use_stripe_sdk: None,
374        }
375    }
376}
377/// Provides industry-specific information about the amount.
378#[derive(Clone, Debug, serde::Serialize)]
379pub struct CreatePaymentIntentAmountDetails {
380    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
381    /// An integer greater than 0.
382    ///
383    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
384    #[serde(skip_serializing_if = "Option::is_none")]
385    pub discount_amount: Option<i64>,
386    /// A list of line items, each containing information about a product in the PaymentIntent.
387    /// There is a maximum of 100 line items.
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub line_items: Option<Vec<CreatePaymentIntentAmountDetailsLineItems>>,
390    /// Contains information about the shipping portion of the amount.
391    #[serde(skip_serializing_if = "Option::is_none")]
392    pub shipping: Option<AmountDetailsShippingParam>,
393    /// Contains information about the tax portion of the amount.
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub tax: Option<AmountDetailsTaxParam>,
396}
397impl CreatePaymentIntentAmountDetails {
398    pub fn new() -> Self {
399        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
400    }
401}
402impl Default for CreatePaymentIntentAmountDetails {
403    fn default() -> Self {
404        Self::new()
405    }
406}
407/// A list of line items, each containing information about a product in the PaymentIntent.
408/// There is a maximum of 100 line items.
409#[derive(Clone, Debug, serde::Serialize)]
410pub struct CreatePaymentIntentAmountDetailsLineItems {
411    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
412    /// An integer greater than 0.
413    ///
414    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
415    #[serde(skip_serializing_if = "Option::is_none")]
416    pub discount_amount: Option<i64>,
417    /// Payment method-specific information for line items.
418    #[serde(skip_serializing_if = "Option::is_none")]
419    pub payment_method_options:
420        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
421    /// The product code of the line item, such as an SKU.
422    /// Required for L3 rates.
423    /// At most 12 characters long.
424    #[serde(skip_serializing_if = "Option::is_none")]
425    pub product_code: Option<String>,
426    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
427    ///
428    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
429    /// For Paypal, this field is truncated to 127 characters.
430    pub product_name: String,
431    /// The quantity of items. Required for L3 rates. An integer greater than 0.
432    pub quantity: u64,
433    /// Contains information about the tax on the item.
434    #[serde(skip_serializing_if = "Option::is_none")]
435    pub tax: Option<AmountDetailsLineItemTaxParam>,
436    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
437    /// Required for L3 rates.
438    /// An integer greater than or equal to 0.
439    pub unit_cost: i64,
440    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub unit_of_measure: Option<String>,
443}
444impl CreatePaymentIntentAmountDetailsLineItems {
445    pub fn new(
446        product_name: impl Into<String>,
447        quantity: impl Into<u64>,
448        unit_cost: impl Into<i64>,
449    ) -> Self {
450        Self {
451            discount_amount: None,
452            payment_method_options: None,
453            product_code: None,
454            product_name: product_name.into(),
455            quantity: quantity.into(),
456            tax: None,
457            unit_cost: unit_cost.into(),
458            unit_of_measure: None,
459        }
460    }
461}
462/// Payment method-specific information for line items.
463#[derive(Clone, Debug, serde::Serialize)]
464pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
465    /// This sub-hash contains line item details that are specific to `card` payment method."
466    #[serde(skip_serializing_if = "Option::is_none")]
467    pub card: Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
468    /// This sub-hash contains line item details that are specific to `card_present` payment method."
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub card_present:
471        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
472    /// This sub-hash contains line item details that are specific to `klarna` payment method."
473    #[serde(skip_serializing_if = "Option::is_none")]
474    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
475    /// This sub-hash contains line item details that are specific to `paypal` payment method."
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub paypal: Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
478}
479impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
480    pub fn new() -> Self {
481        Self { card: None, card_present: None, klarna: None, paypal: None }
482    }
483}
484impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
485    fn default() -> Self {
486        Self::new()
487    }
488}
489/// This sub-hash contains line item details that are specific to `card` payment method."
490#[derive(Clone, Debug, serde::Serialize)]
491pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
492    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
493    #[serde(skip_serializing_if = "Option::is_none")]
494    pub commodity_code: Option<String>,
495}
496impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
497    pub fn new() -> Self {
498        Self { commodity_code: None }
499    }
500}
501impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
502    fn default() -> Self {
503        Self::new()
504    }
505}
506/// This sub-hash contains line item details that are specific to `card_present` payment method."
507#[derive(Clone, Debug, serde::Serialize)]
508pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
509    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
510    #[serde(skip_serializing_if = "Option::is_none")]
511    pub commodity_code: Option<String>,
512}
513impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
514    pub fn new() -> Self {
515        Self { commodity_code: None }
516    }
517}
518impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
519    fn default() -> Self {
520        Self::new()
521    }
522}
523/// This sub-hash contains line item details that are specific to `paypal` payment method."
524#[derive(Clone, Debug, serde::Serialize)]
525pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
526    /// Type of the line item.
527    #[serde(skip_serializing_if = "Option::is_none")]
528    pub category:
529        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
530    /// Description of the line item.
531    #[serde(skip_serializing_if = "Option::is_none")]
532    pub description: Option<String>,
533    /// The Stripe account ID of the connected account that sells the item.
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub sold_by: Option<String>,
536}
537impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
538    pub fn new() -> Self {
539        Self { category: None, description: None, sold_by: None }
540    }
541}
542impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
543    fn default() -> Self {
544        Self::new()
545    }
546}
547/// Type of the line item.
548#[derive(Copy, Clone, Eq, PartialEq)]
549pub enum CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
550    DigitalGoods,
551    Donation,
552    PhysicalGoods,
553}
554impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
555    pub fn as_str(self) -> &'static str {
556        use CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
557        match self {
558            DigitalGoods => "digital_goods",
559            Donation => "donation",
560            PhysicalGoods => "physical_goods",
561        }
562    }
563}
564
565impl std::str::FromStr
566    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
567{
568    type Err = stripe_types::StripeParseError;
569    fn from_str(s: &str) -> Result<Self, Self::Err> {
570        use CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
571        match s {
572            "digital_goods" => Ok(DigitalGoods),
573            "donation" => Ok(Donation),
574            "physical_goods" => Ok(PhysicalGoods),
575            _ => Err(stripe_types::StripeParseError),
576        }
577    }
578}
579impl std::fmt::Display
580    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
581{
582    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
583        f.write_str(self.as_str())
584    }
585}
586
587impl std::fmt::Debug
588    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
589{
590    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
591        f.write_str(self.as_str())
592    }
593}
594impl serde::Serialize
595    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
596{
597    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
598    where
599        S: serde::Serializer,
600    {
601        serializer.serialize_str(self.as_str())
602    }
603}
604#[cfg(feature = "deserialize")]
605impl<'de> serde::Deserialize<'de>
606    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
607{
608    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
609        use std::str::FromStr;
610        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
611        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
612    }
613}
614/// 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.
615#[derive(Copy, Clone, Debug, serde::Serialize)]
616pub struct CreatePaymentIntentAutomaticPaymentMethods {
617    /// Controls whether this PaymentIntent will accept redirect-based payment methods.
618    ///
619    /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
620    /// 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.
621    #[serde(skip_serializing_if = "Option::is_none")]
622    pub allow_redirects: Option<CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects>,
623    /// Whether this feature is enabled.
624    pub enabled: bool,
625}
626impl CreatePaymentIntentAutomaticPaymentMethods {
627    pub fn new(enabled: impl Into<bool>) -> Self {
628        Self { allow_redirects: None, enabled: enabled.into() }
629    }
630}
631/// Controls whether this PaymentIntent will accept redirect-based payment methods.
632///
633/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
634/// 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.
635#[derive(Copy, Clone, Eq, PartialEq)]
636pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
637    Always,
638    Never,
639}
640impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
641    pub fn as_str(self) -> &'static str {
642        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
643        match self {
644            Always => "always",
645            Never => "never",
646        }
647    }
648}
649
650impl std::str::FromStr for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
651    type Err = stripe_types::StripeParseError;
652    fn from_str(s: &str) -> Result<Self, Self::Err> {
653        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
654        match s {
655            "always" => Ok(Always),
656            "never" => Ok(Never),
657            _ => Err(stripe_types::StripeParseError),
658        }
659    }
660}
661impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
663        f.write_str(self.as_str())
664    }
665}
666
667impl std::fmt::Debug for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
668    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
669        f.write_str(self.as_str())
670    }
671}
672impl serde::Serialize for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
673    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
674    where
675        S: serde::Serializer,
676    {
677        serializer.serialize_str(self.as_str())
678    }
679}
680#[cfg(feature = "deserialize")]
681impl<'de> serde::Deserialize<'de> for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
682    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
683        use std::str::FromStr;
684        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
685        Self::from_str(&s).map_err(|_| {
686            serde::de::Error::custom(
687                "Unknown value for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects",
688            )
689        })
690    }
691}
692/// This hash contains details about the Mandate to create.
693/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
694#[derive(Clone, Debug, serde::Serialize)]
695pub struct CreatePaymentIntentMandateData {
696    /// This hash contains details about the customer acceptance of the Mandate.
697    pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance,
698}
699impl CreatePaymentIntentMandateData {
700    pub fn new(
701        customer_acceptance: impl Into<CreatePaymentIntentMandateDataCustomerAcceptance>,
702    ) -> Self {
703        Self { customer_acceptance: customer_acceptance.into() }
704    }
705}
706/// This hash contains details about the customer acceptance of the Mandate.
707#[derive(Clone, Debug, serde::Serialize)]
708pub struct CreatePaymentIntentMandateDataCustomerAcceptance {
709    /// The time at which the customer accepted the Mandate.
710    #[serde(skip_serializing_if = "Option::is_none")]
711    pub accepted_at: Option<stripe_types::Timestamp>,
712    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
713    #[serde(skip_serializing_if = "Option::is_none")]
714    #[serde(with = "stripe_types::with_serde_json_opt")]
715    pub offline: Option<miniserde::json::Value>,
716    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
717    #[serde(skip_serializing_if = "Option::is_none")]
718    pub online: Option<OnlineParam>,
719    /// The type of customer acceptance information included with the Mandate.
720    /// One of `online` or `offline`.
721    #[serde(rename = "type")]
722    pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType,
723}
724impl CreatePaymentIntentMandateDataCustomerAcceptance {
725    pub fn new(type_: impl Into<CreatePaymentIntentMandateDataCustomerAcceptanceType>) -> Self {
726        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
727    }
728}
729/// The type of customer acceptance information included with the Mandate.
730/// One of `online` or `offline`.
731#[derive(Copy, Clone, Eq, PartialEq)]
732pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType {
733    Offline,
734    Online,
735}
736impl CreatePaymentIntentMandateDataCustomerAcceptanceType {
737    pub fn as_str(self) -> &'static str {
738        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
739        match self {
740            Offline => "offline",
741            Online => "online",
742        }
743    }
744}
745
746impl std::str::FromStr for CreatePaymentIntentMandateDataCustomerAcceptanceType {
747    type Err = stripe_types::StripeParseError;
748    fn from_str(s: &str) -> Result<Self, Self::Err> {
749        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
750        match s {
751            "offline" => Ok(Offline),
752            "online" => Ok(Online),
753            _ => Err(stripe_types::StripeParseError),
754        }
755    }
756}
757impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType {
758    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
759        f.write_str(self.as_str())
760    }
761}
762
763impl std::fmt::Debug for CreatePaymentIntentMandateDataCustomerAcceptanceType {
764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
765        f.write_str(self.as_str())
766    }
767}
768impl serde::Serialize for CreatePaymentIntentMandateDataCustomerAcceptanceType {
769    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
770    where
771        S: serde::Serializer,
772    {
773        serializer.serialize_str(self.as_str())
774    }
775}
776#[cfg(feature = "deserialize")]
777impl<'de> serde::Deserialize<'de> for CreatePaymentIntentMandateDataCustomerAcceptanceType {
778    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
779        use std::str::FromStr;
780        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
781        Self::from_str(&s).map_err(|_| {
782            serde::de::Error::custom(
783                "Unknown value for CreatePaymentIntentMandateDataCustomerAcceptanceType",
784            )
785        })
786    }
787}
788/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
789/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
790/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
791#[derive(Copy, Clone, Debug, serde::Serialize)]
792#[serde(rename_all = "snake_case")]
793pub enum CreatePaymentIntentOffSession {
794    OneOff,
795    Recurring,
796    #[serde(untagged)]
797    Bool(bool),
798}
799/// Provides industry-specific information about the charge.
800#[derive(Clone, Debug, serde::Serialize)]
801pub struct CreatePaymentIntentPaymentDetails {
802    /// A unique value to identify the customer. This field is available only for card payments.
803    ///
804    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
805    #[serde(skip_serializing_if = "Option::is_none")]
806    pub customer_reference: Option<String>,
807    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
808    ///
809    /// 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`.
810    ///
811    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
812    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
813    #[serde(skip_serializing_if = "Option::is_none")]
814    pub order_reference: Option<String>,
815}
816impl CreatePaymentIntentPaymentDetails {
817    pub fn new() -> Self {
818        Self { customer_reference: None, order_reference: None }
819    }
820}
821impl Default for CreatePaymentIntentPaymentDetails {
822    fn default() -> Self {
823        Self::new()
824    }
825}
826/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
827/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
828/// property on the PaymentIntent.
829#[derive(Clone, Debug, serde::Serialize)]
830pub struct CreatePaymentIntentPaymentMethodData {
831    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
832    #[serde(skip_serializing_if = "Option::is_none")]
833    pub acss_debit: Option<PaymentMethodParam>,
834    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
835    #[serde(skip_serializing_if = "Option::is_none")]
836    #[serde(with = "stripe_types::with_serde_json_opt")]
837    pub affirm: Option<miniserde::json::Value>,
838    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
839    #[serde(skip_serializing_if = "Option::is_none")]
840    #[serde(with = "stripe_types::with_serde_json_opt")]
841    pub afterpay_clearpay: Option<miniserde::json::Value>,
842    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
843    #[serde(skip_serializing_if = "Option::is_none")]
844    #[serde(with = "stripe_types::with_serde_json_opt")]
845    pub alipay: Option<miniserde::json::Value>,
846    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
847    /// 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.
848    /// The field defaults to `unspecified`.
849    #[serde(skip_serializing_if = "Option::is_none")]
850    pub allow_redisplay: Option<CreatePaymentIntentPaymentMethodDataAllowRedisplay>,
851    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
852    #[serde(skip_serializing_if = "Option::is_none")]
853    #[serde(with = "stripe_types::with_serde_json_opt")]
854    pub alma: Option<miniserde::json::Value>,
855    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
856    #[serde(skip_serializing_if = "Option::is_none")]
857    #[serde(with = "stripe_types::with_serde_json_opt")]
858    pub amazon_pay: Option<miniserde::json::Value>,
859    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
860    #[serde(skip_serializing_if = "Option::is_none")]
861    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodDataAuBecsDebit>,
862    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
863    #[serde(skip_serializing_if = "Option::is_none")]
864    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodDataBacsDebit>,
865    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
866    #[serde(skip_serializing_if = "Option::is_none")]
867    #[serde(with = "stripe_types::with_serde_json_opt")]
868    pub bancontact: Option<miniserde::json::Value>,
869    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
870    #[serde(skip_serializing_if = "Option::is_none")]
871    #[serde(with = "stripe_types::with_serde_json_opt")]
872    pub billie: Option<miniserde::json::Value>,
873    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
874    #[serde(skip_serializing_if = "Option::is_none")]
875    pub billing_details: Option<CreatePaymentIntentPaymentMethodDataBillingDetails>,
876    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
877    #[serde(skip_serializing_if = "Option::is_none")]
878    #[serde(with = "stripe_types::with_serde_json_opt")]
879    pub blik: Option<miniserde::json::Value>,
880    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
881    #[serde(skip_serializing_if = "Option::is_none")]
882    pub boleto: Option<CreatePaymentIntentPaymentMethodDataBoleto>,
883    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
884    #[serde(skip_serializing_if = "Option::is_none")]
885    #[serde(with = "stripe_types::with_serde_json_opt")]
886    pub cashapp: Option<miniserde::json::Value>,
887    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
888    #[serde(skip_serializing_if = "Option::is_none")]
889    #[serde(with = "stripe_types::with_serde_json_opt")]
890    pub crypto: Option<miniserde::json::Value>,
891    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
892    #[serde(skip_serializing_if = "Option::is_none")]
893    #[serde(with = "stripe_types::with_serde_json_opt")]
894    pub customer_balance: Option<miniserde::json::Value>,
895    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
896    #[serde(skip_serializing_if = "Option::is_none")]
897    pub eps: Option<CreatePaymentIntentPaymentMethodDataEps>,
898    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
899    #[serde(skip_serializing_if = "Option::is_none")]
900    pub fpx: Option<CreatePaymentIntentPaymentMethodDataFpx>,
901    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
902    #[serde(skip_serializing_if = "Option::is_none")]
903    #[serde(with = "stripe_types::with_serde_json_opt")]
904    pub giropay: Option<miniserde::json::Value>,
905    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
906    #[serde(skip_serializing_if = "Option::is_none")]
907    #[serde(with = "stripe_types::with_serde_json_opt")]
908    pub grabpay: Option<miniserde::json::Value>,
909    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
910    #[serde(skip_serializing_if = "Option::is_none")]
911    pub ideal: Option<CreatePaymentIntentPaymentMethodDataIdeal>,
912    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
913    #[serde(skip_serializing_if = "Option::is_none")]
914    #[serde(with = "stripe_types::with_serde_json_opt")]
915    pub interac_present: Option<miniserde::json::Value>,
916    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
917    #[serde(skip_serializing_if = "Option::is_none")]
918    #[serde(with = "stripe_types::with_serde_json_opt")]
919    pub kakao_pay: Option<miniserde::json::Value>,
920    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
921    #[serde(skip_serializing_if = "Option::is_none")]
922    pub klarna: Option<CreatePaymentIntentPaymentMethodDataKlarna>,
923    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
924    #[serde(skip_serializing_if = "Option::is_none")]
925    #[serde(with = "stripe_types::with_serde_json_opt")]
926    pub konbini: Option<miniserde::json::Value>,
927    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
928    #[serde(skip_serializing_if = "Option::is_none")]
929    #[serde(with = "stripe_types::with_serde_json_opt")]
930    pub kr_card: Option<miniserde::json::Value>,
931    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
932    #[serde(skip_serializing_if = "Option::is_none")]
933    #[serde(with = "stripe_types::with_serde_json_opt")]
934    pub link: Option<miniserde::json::Value>,
935    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
936    #[serde(skip_serializing_if = "Option::is_none")]
937    #[serde(with = "stripe_types::with_serde_json_opt")]
938    pub mb_way: Option<miniserde::json::Value>,
939    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
940    /// This can be useful for storing additional information about the object in a structured format.
941    /// Individual keys can be unset by posting an empty value to them.
942    /// All keys can be unset by posting an empty value to `metadata`.
943    #[serde(skip_serializing_if = "Option::is_none")]
944    pub metadata: Option<std::collections::HashMap<String, String>>,
945    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
946    #[serde(skip_serializing_if = "Option::is_none")]
947    #[serde(with = "stripe_types::with_serde_json_opt")]
948    pub mobilepay: Option<miniserde::json::Value>,
949    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
950    #[serde(skip_serializing_if = "Option::is_none")]
951    #[serde(with = "stripe_types::with_serde_json_opt")]
952    pub multibanco: Option<miniserde::json::Value>,
953    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
954    #[serde(skip_serializing_if = "Option::is_none")]
955    pub naver_pay: Option<CreatePaymentIntentPaymentMethodDataNaverPay>,
956    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodDataNzBankAccount>,
959    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
960    #[serde(skip_serializing_if = "Option::is_none")]
961    #[serde(with = "stripe_types::with_serde_json_opt")]
962    pub oxxo: Option<miniserde::json::Value>,
963    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
964    #[serde(skip_serializing_if = "Option::is_none")]
965    pub p24: Option<CreatePaymentIntentPaymentMethodDataP24>,
966    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
967    #[serde(skip_serializing_if = "Option::is_none")]
968    #[serde(with = "stripe_types::with_serde_json_opt")]
969    pub pay_by_bank: Option<miniserde::json::Value>,
970    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
971    #[serde(skip_serializing_if = "Option::is_none")]
972    #[serde(with = "stripe_types::with_serde_json_opt")]
973    pub payco: Option<miniserde::json::Value>,
974    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
975    #[serde(skip_serializing_if = "Option::is_none")]
976    #[serde(with = "stripe_types::with_serde_json_opt")]
977    pub paynow: Option<miniserde::json::Value>,
978    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
979    #[serde(skip_serializing_if = "Option::is_none")]
980    #[serde(with = "stripe_types::with_serde_json_opt")]
981    pub paypal: Option<miniserde::json::Value>,
982    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
983    #[serde(skip_serializing_if = "Option::is_none")]
984    #[serde(with = "stripe_types::with_serde_json_opt")]
985    pub pix: Option<miniserde::json::Value>,
986    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
987    #[serde(skip_serializing_if = "Option::is_none")]
988    #[serde(with = "stripe_types::with_serde_json_opt")]
989    pub promptpay: Option<miniserde::json::Value>,
990    /// Options to configure Radar.
991    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
992    #[serde(skip_serializing_if = "Option::is_none")]
993    pub radar_options: Option<CreatePaymentIntentPaymentMethodDataRadarOptions>,
994    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
995    #[serde(skip_serializing_if = "Option::is_none")]
996    #[serde(with = "stripe_types::with_serde_json_opt")]
997    pub revolut_pay: Option<miniserde::json::Value>,
998    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
999    #[serde(skip_serializing_if = "Option::is_none")]
1000    #[serde(with = "stripe_types::with_serde_json_opt")]
1001    pub samsung_pay: Option<miniserde::json::Value>,
1002    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
1003    #[serde(skip_serializing_if = "Option::is_none")]
1004    #[serde(with = "stripe_types::with_serde_json_opt")]
1005    pub satispay: Option<miniserde::json::Value>,
1006    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodDataSepaDebit>,
1009    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1010    #[serde(skip_serializing_if = "Option::is_none")]
1011    pub sofort: Option<CreatePaymentIntentPaymentMethodDataSofort>,
1012    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
1013    #[serde(skip_serializing_if = "Option::is_none")]
1014    #[serde(with = "stripe_types::with_serde_json_opt")]
1015    pub swish: Option<miniserde::json::Value>,
1016    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
1017    #[serde(skip_serializing_if = "Option::is_none")]
1018    #[serde(with = "stripe_types::with_serde_json_opt")]
1019    pub twint: Option<miniserde::json::Value>,
1020    /// The type of the PaymentMethod.
1021    /// An additional hash is included on the PaymentMethod with a name matching this value.
1022    /// It contains additional information specific to the PaymentMethod type.
1023    #[serde(rename = "type")]
1024    pub type_: CreatePaymentIntentPaymentMethodDataType,
1025    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1026    #[serde(skip_serializing_if = "Option::is_none")]
1027    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodDataUsBankAccount>,
1028    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
1029    #[serde(skip_serializing_if = "Option::is_none")]
1030    #[serde(with = "stripe_types::with_serde_json_opt")]
1031    pub wechat_pay: Option<miniserde::json::Value>,
1032    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
1033    #[serde(skip_serializing_if = "Option::is_none")]
1034    #[serde(with = "stripe_types::with_serde_json_opt")]
1035    pub zip: Option<miniserde::json::Value>,
1036}
1037impl CreatePaymentIntentPaymentMethodData {
1038    pub fn new(type_: impl Into<CreatePaymentIntentPaymentMethodDataType>) -> Self {
1039        Self {
1040            acss_debit: None,
1041            affirm: None,
1042            afterpay_clearpay: None,
1043            alipay: None,
1044            allow_redisplay: None,
1045            alma: None,
1046            amazon_pay: None,
1047            au_becs_debit: None,
1048            bacs_debit: None,
1049            bancontact: None,
1050            billie: None,
1051            billing_details: None,
1052            blik: None,
1053            boleto: None,
1054            cashapp: None,
1055            crypto: None,
1056            customer_balance: None,
1057            eps: None,
1058            fpx: None,
1059            giropay: None,
1060            grabpay: None,
1061            ideal: None,
1062            interac_present: None,
1063            kakao_pay: None,
1064            klarna: None,
1065            konbini: None,
1066            kr_card: None,
1067            link: None,
1068            mb_way: None,
1069            metadata: None,
1070            mobilepay: None,
1071            multibanco: None,
1072            naver_pay: None,
1073            nz_bank_account: None,
1074            oxxo: None,
1075            p24: None,
1076            pay_by_bank: None,
1077            payco: None,
1078            paynow: None,
1079            paypal: None,
1080            pix: None,
1081            promptpay: None,
1082            radar_options: None,
1083            revolut_pay: None,
1084            samsung_pay: None,
1085            satispay: None,
1086            sepa_debit: None,
1087            sofort: None,
1088            swish: None,
1089            twint: None,
1090            type_: type_.into(),
1091            us_bank_account: None,
1092            wechat_pay: None,
1093            zip: None,
1094        }
1095    }
1096}
1097/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
1098/// 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.
1099/// The field defaults to `unspecified`.
1100#[derive(Copy, Clone, Eq, PartialEq)]
1101pub enum CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1102    Always,
1103    Limited,
1104    Unspecified,
1105}
1106impl CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1107    pub fn as_str(self) -> &'static str {
1108        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
1109        match self {
1110            Always => "always",
1111            Limited => "limited",
1112            Unspecified => "unspecified",
1113        }
1114    }
1115}
1116
1117impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1118    type Err = stripe_types::StripeParseError;
1119    fn from_str(s: &str) -> Result<Self, Self::Err> {
1120        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
1121        match s {
1122            "always" => Ok(Always),
1123            "limited" => Ok(Limited),
1124            "unspecified" => Ok(Unspecified),
1125            _ => Err(stripe_types::StripeParseError),
1126        }
1127    }
1128}
1129impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1130    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1131        f.write_str(self.as_str())
1132    }
1133}
1134
1135impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1136    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1137        f.write_str(self.as_str())
1138    }
1139}
1140impl serde::Serialize for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1141    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1142    where
1143        S: serde::Serializer,
1144    {
1145        serializer.serialize_str(self.as_str())
1146    }
1147}
1148#[cfg(feature = "deserialize")]
1149impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1150    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1151        use std::str::FromStr;
1152        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1153        Self::from_str(&s).map_err(|_| {
1154            serde::de::Error::custom(
1155                "Unknown value for CreatePaymentIntentPaymentMethodDataAllowRedisplay",
1156            )
1157        })
1158    }
1159}
1160/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
1161#[derive(Clone, Debug, serde::Serialize)]
1162pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit {
1163    /// The account number for the bank account.
1164    pub account_number: String,
1165    /// Bank-State-Branch number of the bank account.
1166    pub bsb_number: String,
1167}
1168impl CreatePaymentIntentPaymentMethodDataAuBecsDebit {
1169    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
1170        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
1171    }
1172}
1173/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
1174#[derive(Clone, Debug, serde::Serialize)]
1175pub struct CreatePaymentIntentPaymentMethodDataBacsDebit {
1176    /// Account number of the bank account that the funds will be debited from.
1177    #[serde(skip_serializing_if = "Option::is_none")]
1178    pub account_number: Option<String>,
1179    /// Sort code of the bank account. (e.g., `10-20-30`)
1180    #[serde(skip_serializing_if = "Option::is_none")]
1181    pub sort_code: Option<String>,
1182}
1183impl CreatePaymentIntentPaymentMethodDataBacsDebit {
1184    pub fn new() -> Self {
1185        Self { account_number: None, sort_code: None }
1186    }
1187}
1188impl Default for CreatePaymentIntentPaymentMethodDataBacsDebit {
1189    fn default() -> Self {
1190        Self::new()
1191    }
1192}
1193/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
1194#[derive(Clone, Debug, serde::Serialize)]
1195pub struct CreatePaymentIntentPaymentMethodDataBillingDetails {
1196    /// Billing address.
1197    #[serde(skip_serializing_if = "Option::is_none")]
1198    pub address: Option<CreatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
1199    /// Email address.
1200    #[serde(skip_serializing_if = "Option::is_none")]
1201    pub email: Option<String>,
1202    /// Full name.
1203    #[serde(skip_serializing_if = "Option::is_none")]
1204    pub name: Option<String>,
1205    /// Billing phone number (including extension).
1206    #[serde(skip_serializing_if = "Option::is_none")]
1207    pub phone: Option<String>,
1208    /// Taxpayer identification number.
1209    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
1210    #[serde(skip_serializing_if = "Option::is_none")]
1211    pub tax_id: Option<String>,
1212}
1213impl CreatePaymentIntentPaymentMethodDataBillingDetails {
1214    pub fn new() -> Self {
1215        Self { address: None, email: None, name: None, phone: None, tax_id: None }
1216    }
1217}
1218impl Default for CreatePaymentIntentPaymentMethodDataBillingDetails {
1219    fn default() -> Self {
1220        Self::new()
1221    }
1222}
1223/// Billing address.
1224#[derive(Clone, Debug, serde::Serialize)]
1225pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1226    /// City, district, suburb, town, or village.
1227    #[serde(skip_serializing_if = "Option::is_none")]
1228    pub city: Option<String>,
1229    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1230    #[serde(skip_serializing_if = "Option::is_none")]
1231    pub country: Option<String>,
1232    /// Address line 1, such as the street, PO Box, or company name.
1233    #[serde(skip_serializing_if = "Option::is_none")]
1234    pub line1: Option<String>,
1235    /// Address line 2, such as the apartment, suite, unit, or building.
1236    #[serde(skip_serializing_if = "Option::is_none")]
1237    pub line2: Option<String>,
1238    /// ZIP or postal code.
1239    #[serde(skip_serializing_if = "Option::is_none")]
1240    pub postal_code: Option<String>,
1241    /// State, county, province, or region.
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub state: Option<String>,
1244}
1245impl CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1246    pub fn new() -> Self {
1247        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
1248    }
1249}
1250impl Default for CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1251    fn default() -> Self {
1252        Self::new()
1253    }
1254}
1255/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
1256#[derive(Clone, Debug, serde::Serialize)]
1257pub struct CreatePaymentIntentPaymentMethodDataBoleto {
1258    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
1259    pub tax_id: String,
1260}
1261impl CreatePaymentIntentPaymentMethodDataBoleto {
1262    pub fn new(tax_id: impl Into<String>) -> Self {
1263        Self { tax_id: tax_id.into() }
1264    }
1265}
1266/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
1267#[derive(Clone, Debug, serde::Serialize)]
1268pub struct CreatePaymentIntentPaymentMethodDataEps {
1269    /// The customer's bank.
1270    #[serde(skip_serializing_if = "Option::is_none")]
1271    pub bank: Option<CreatePaymentIntentPaymentMethodDataEpsBank>,
1272}
1273impl CreatePaymentIntentPaymentMethodDataEps {
1274    pub fn new() -> Self {
1275        Self { bank: None }
1276    }
1277}
1278impl Default for CreatePaymentIntentPaymentMethodDataEps {
1279    fn default() -> Self {
1280        Self::new()
1281    }
1282}
1283/// The customer's bank.
1284#[derive(Clone, Eq, PartialEq)]
1285#[non_exhaustive]
1286pub enum CreatePaymentIntentPaymentMethodDataEpsBank {
1287    ArzteUndApothekerBank,
1288    AustrianAnadiBankAg,
1289    BankAustria,
1290    BankhausCarlSpangler,
1291    BankhausSchelhammerUndSchatteraAg,
1292    BawagPskAg,
1293    BksBankAg,
1294    BrullKallmusBankAg,
1295    BtvVierLanderBank,
1296    CapitalBankGraweGruppeAg,
1297    DeutscheBankAg,
1298    Dolomitenbank,
1299    EasybankAg,
1300    ErsteBankUndSparkassen,
1301    HypoAlpeadriabankInternationalAg,
1302    HypoBankBurgenlandAktiengesellschaft,
1303    HypoNoeLbFurNiederosterreichUWien,
1304    HypoOberosterreichSalzburgSteiermark,
1305    HypoTirolBankAg,
1306    HypoVorarlbergBankAg,
1307    MarchfelderBank,
1308    OberbankAg,
1309    RaiffeisenBankengruppeOsterreich,
1310    SchoellerbankAg,
1311    SpardaBankWien,
1312    VolksbankGruppe,
1313    VolkskreditbankAg,
1314    VrBankBraunau,
1315    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1316    Unknown(String),
1317}
1318impl CreatePaymentIntentPaymentMethodDataEpsBank {
1319    pub fn as_str(&self) -> &str {
1320        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1321        match self {
1322            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1323            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1324            BankAustria => "bank_austria",
1325            BankhausCarlSpangler => "bankhaus_carl_spangler",
1326            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
1327            BawagPskAg => "bawag_psk_ag",
1328            BksBankAg => "bks_bank_ag",
1329            BrullKallmusBankAg => "brull_kallmus_bank_ag",
1330            BtvVierLanderBank => "btv_vier_lander_bank",
1331            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1332            DeutscheBankAg => "deutsche_bank_ag",
1333            Dolomitenbank => "dolomitenbank",
1334            EasybankAg => "easybank_ag",
1335            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1336            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
1337            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
1338            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
1339            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
1340            HypoTirolBankAg => "hypo_tirol_bank_ag",
1341            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1342            MarchfelderBank => "marchfelder_bank",
1343            OberbankAg => "oberbank_ag",
1344            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
1345            SchoellerbankAg => "schoellerbank_ag",
1346            SpardaBankWien => "sparda_bank_wien",
1347            VolksbankGruppe => "volksbank_gruppe",
1348            VolkskreditbankAg => "volkskreditbank_ag",
1349            VrBankBraunau => "vr_bank_braunau",
1350            Unknown(v) => v,
1351        }
1352    }
1353}
1354
1355impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataEpsBank {
1356    type Err = std::convert::Infallible;
1357    fn from_str(s: &str) -> Result<Self, Self::Err> {
1358        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1359        match s {
1360            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
1361            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
1362            "bank_austria" => Ok(BankAustria),
1363            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
1364            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
1365            "bawag_psk_ag" => Ok(BawagPskAg),
1366            "bks_bank_ag" => Ok(BksBankAg),
1367            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
1368            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
1369            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
1370            "deutsche_bank_ag" => Ok(DeutscheBankAg),
1371            "dolomitenbank" => Ok(Dolomitenbank),
1372            "easybank_ag" => Ok(EasybankAg),
1373            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
1374            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
1375            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
1376            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
1377            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
1378            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
1379            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
1380            "marchfelder_bank" => Ok(MarchfelderBank),
1381            "oberbank_ag" => Ok(OberbankAg),
1382            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
1383            "schoellerbank_ag" => Ok(SchoellerbankAg),
1384            "sparda_bank_wien" => Ok(SpardaBankWien),
1385            "volksbank_gruppe" => Ok(VolksbankGruppe),
1386            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
1387            "vr_bank_braunau" => Ok(VrBankBraunau),
1388            v => Ok(Unknown(v.to_owned())),
1389        }
1390    }
1391}
1392impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank {
1393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1394        f.write_str(self.as_str())
1395    }
1396}
1397
1398impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataEpsBank {
1399    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1400        f.write_str(self.as_str())
1401    }
1402}
1403impl serde::Serialize for CreatePaymentIntentPaymentMethodDataEpsBank {
1404    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1405    where
1406        S: serde::Serializer,
1407    {
1408        serializer.serialize_str(self.as_str())
1409    }
1410}
1411#[cfg(feature = "deserialize")]
1412impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataEpsBank {
1413    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1414        use std::str::FromStr;
1415        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1416        Ok(Self::from_str(&s).unwrap())
1417    }
1418}
1419/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1420#[derive(Clone, Debug, serde::Serialize)]
1421pub struct CreatePaymentIntentPaymentMethodDataFpx {
1422    /// Account holder type for FPX transaction
1423    #[serde(skip_serializing_if = "Option::is_none")]
1424    pub account_holder_type: Option<CreatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
1425    /// The customer's bank.
1426    pub bank: CreatePaymentIntentPaymentMethodDataFpxBank,
1427}
1428impl CreatePaymentIntentPaymentMethodDataFpx {
1429    pub fn new(bank: impl Into<CreatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
1430        Self { account_holder_type: None, bank: bank.into() }
1431    }
1432}
1433/// Account holder type for FPX transaction
1434#[derive(Copy, Clone, Eq, PartialEq)]
1435pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1436    Company,
1437    Individual,
1438}
1439impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1440    pub fn as_str(self) -> &'static str {
1441        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1442        match self {
1443            Company => "company",
1444            Individual => "individual",
1445        }
1446    }
1447}
1448
1449impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1450    type Err = stripe_types::StripeParseError;
1451    fn from_str(s: &str) -> Result<Self, Self::Err> {
1452        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1453        match s {
1454            "company" => Ok(Company),
1455            "individual" => Ok(Individual),
1456            _ => Err(stripe_types::StripeParseError),
1457        }
1458    }
1459}
1460impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1461    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1462        f.write_str(self.as_str())
1463    }
1464}
1465
1466impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1467    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1468        f.write_str(self.as_str())
1469    }
1470}
1471impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1472    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1473    where
1474        S: serde::Serializer,
1475    {
1476        serializer.serialize_str(self.as_str())
1477    }
1478}
1479#[cfg(feature = "deserialize")]
1480impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1481    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1482        use std::str::FromStr;
1483        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1484        Self::from_str(&s).map_err(|_| {
1485            serde::de::Error::custom(
1486                "Unknown value for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType",
1487            )
1488        })
1489    }
1490}
1491/// The customer's bank.
1492#[derive(Clone, Eq, PartialEq)]
1493#[non_exhaustive]
1494pub enum CreatePaymentIntentPaymentMethodDataFpxBank {
1495    AffinBank,
1496    Agrobank,
1497    AllianceBank,
1498    Ambank,
1499    BankIslam,
1500    BankMuamalat,
1501    BankOfChina,
1502    BankRakyat,
1503    Bsn,
1504    Cimb,
1505    DeutscheBank,
1506    HongLeongBank,
1507    Hsbc,
1508    Kfh,
1509    Maybank2e,
1510    Maybank2u,
1511    Ocbc,
1512    PbEnterprise,
1513    PublicBank,
1514    Rhb,
1515    StandardChartered,
1516    Uob,
1517    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1518    Unknown(String),
1519}
1520impl CreatePaymentIntentPaymentMethodDataFpxBank {
1521    pub fn as_str(&self) -> &str {
1522        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1523        match self {
1524            AffinBank => "affin_bank",
1525            Agrobank => "agrobank",
1526            AllianceBank => "alliance_bank",
1527            Ambank => "ambank",
1528            BankIslam => "bank_islam",
1529            BankMuamalat => "bank_muamalat",
1530            BankOfChina => "bank_of_china",
1531            BankRakyat => "bank_rakyat",
1532            Bsn => "bsn",
1533            Cimb => "cimb",
1534            DeutscheBank => "deutsche_bank",
1535            HongLeongBank => "hong_leong_bank",
1536            Hsbc => "hsbc",
1537            Kfh => "kfh",
1538            Maybank2e => "maybank2e",
1539            Maybank2u => "maybank2u",
1540            Ocbc => "ocbc",
1541            PbEnterprise => "pb_enterprise",
1542            PublicBank => "public_bank",
1543            Rhb => "rhb",
1544            StandardChartered => "standard_chartered",
1545            Uob => "uob",
1546            Unknown(v) => v,
1547        }
1548    }
1549}
1550
1551impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxBank {
1552    type Err = std::convert::Infallible;
1553    fn from_str(s: &str) -> Result<Self, Self::Err> {
1554        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1555        match s {
1556            "affin_bank" => Ok(AffinBank),
1557            "agrobank" => Ok(Agrobank),
1558            "alliance_bank" => Ok(AllianceBank),
1559            "ambank" => Ok(Ambank),
1560            "bank_islam" => Ok(BankIslam),
1561            "bank_muamalat" => Ok(BankMuamalat),
1562            "bank_of_china" => Ok(BankOfChina),
1563            "bank_rakyat" => Ok(BankRakyat),
1564            "bsn" => Ok(Bsn),
1565            "cimb" => Ok(Cimb),
1566            "deutsche_bank" => Ok(DeutscheBank),
1567            "hong_leong_bank" => Ok(HongLeongBank),
1568            "hsbc" => Ok(Hsbc),
1569            "kfh" => Ok(Kfh),
1570            "maybank2e" => Ok(Maybank2e),
1571            "maybank2u" => Ok(Maybank2u),
1572            "ocbc" => Ok(Ocbc),
1573            "pb_enterprise" => Ok(PbEnterprise),
1574            "public_bank" => Ok(PublicBank),
1575            "rhb" => Ok(Rhb),
1576            "standard_chartered" => Ok(StandardChartered),
1577            "uob" => Ok(Uob),
1578            v => Ok(Unknown(v.to_owned())),
1579        }
1580    }
1581}
1582impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank {
1583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1584        f.write_str(self.as_str())
1585    }
1586}
1587
1588impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxBank {
1589    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1590        f.write_str(self.as_str())
1591    }
1592}
1593impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxBank {
1594    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1595    where
1596        S: serde::Serializer,
1597    {
1598        serializer.serialize_str(self.as_str())
1599    }
1600}
1601#[cfg(feature = "deserialize")]
1602impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxBank {
1603    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1604        use std::str::FromStr;
1605        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1606        Ok(Self::from_str(&s).unwrap())
1607    }
1608}
1609/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1610#[derive(Clone, Debug, serde::Serialize)]
1611pub struct CreatePaymentIntentPaymentMethodDataIdeal {
1612    /// The customer's bank.
1613    /// Only use this parameter for existing customers.
1614    /// Don't use it for new customers.
1615    #[serde(skip_serializing_if = "Option::is_none")]
1616    pub bank: Option<CreatePaymentIntentPaymentMethodDataIdealBank>,
1617}
1618impl CreatePaymentIntentPaymentMethodDataIdeal {
1619    pub fn new() -> Self {
1620        Self { bank: None }
1621    }
1622}
1623impl Default for CreatePaymentIntentPaymentMethodDataIdeal {
1624    fn default() -> Self {
1625        Self::new()
1626    }
1627}
1628/// The customer's bank.
1629/// Only use this parameter for existing customers.
1630/// Don't use it for new customers.
1631#[derive(Clone, Eq, PartialEq)]
1632#[non_exhaustive]
1633pub enum CreatePaymentIntentPaymentMethodDataIdealBank {
1634    AbnAmro,
1635    AsnBank,
1636    Bunq,
1637    Buut,
1638    Handelsbanken,
1639    Ing,
1640    Knab,
1641    Moneyou,
1642    N26,
1643    Nn,
1644    Rabobank,
1645    Regiobank,
1646    Revolut,
1647    SnsBank,
1648    TriodosBank,
1649    VanLanschot,
1650    Yoursafe,
1651    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1652    Unknown(String),
1653}
1654impl CreatePaymentIntentPaymentMethodDataIdealBank {
1655    pub fn as_str(&self) -> &str {
1656        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1657        match self {
1658            AbnAmro => "abn_amro",
1659            AsnBank => "asn_bank",
1660            Bunq => "bunq",
1661            Buut => "buut",
1662            Handelsbanken => "handelsbanken",
1663            Ing => "ing",
1664            Knab => "knab",
1665            Moneyou => "moneyou",
1666            N26 => "n26",
1667            Nn => "nn",
1668            Rabobank => "rabobank",
1669            Regiobank => "regiobank",
1670            Revolut => "revolut",
1671            SnsBank => "sns_bank",
1672            TriodosBank => "triodos_bank",
1673            VanLanschot => "van_lanschot",
1674            Yoursafe => "yoursafe",
1675            Unknown(v) => v,
1676        }
1677    }
1678}
1679
1680impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataIdealBank {
1681    type Err = std::convert::Infallible;
1682    fn from_str(s: &str) -> Result<Self, Self::Err> {
1683        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1684        match s {
1685            "abn_amro" => Ok(AbnAmro),
1686            "asn_bank" => Ok(AsnBank),
1687            "bunq" => Ok(Bunq),
1688            "buut" => Ok(Buut),
1689            "handelsbanken" => Ok(Handelsbanken),
1690            "ing" => Ok(Ing),
1691            "knab" => Ok(Knab),
1692            "moneyou" => Ok(Moneyou),
1693            "n26" => Ok(N26),
1694            "nn" => Ok(Nn),
1695            "rabobank" => Ok(Rabobank),
1696            "regiobank" => Ok(Regiobank),
1697            "revolut" => Ok(Revolut),
1698            "sns_bank" => Ok(SnsBank),
1699            "triodos_bank" => Ok(TriodosBank),
1700            "van_lanschot" => Ok(VanLanschot),
1701            "yoursafe" => Ok(Yoursafe),
1702            v => Ok(Unknown(v.to_owned())),
1703        }
1704    }
1705}
1706impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank {
1707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1708        f.write_str(self.as_str())
1709    }
1710}
1711
1712impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataIdealBank {
1713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1714        f.write_str(self.as_str())
1715    }
1716}
1717impl serde::Serialize for CreatePaymentIntentPaymentMethodDataIdealBank {
1718    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1719    where
1720        S: serde::Serializer,
1721    {
1722        serializer.serialize_str(self.as_str())
1723    }
1724}
1725#[cfg(feature = "deserialize")]
1726impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataIdealBank {
1727    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1728        use std::str::FromStr;
1729        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1730        Ok(Self::from_str(&s).unwrap())
1731    }
1732}
1733/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1734#[derive(Copy, Clone, Debug, serde::Serialize)]
1735pub struct CreatePaymentIntentPaymentMethodDataKlarna {
1736    /// Customer's date of birth
1737    #[serde(skip_serializing_if = "Option::is_none")]
1738    pub dob: Option<DateOfBirth>,
1739}
1740impl CreatePaymentIntentPaymentMethodDataKlarna {
1741    pub fn new() -> Self {
1742        Self { dob: None }
1743    }
1744}
1745impl Default for CreatePaymentIntentPaymentMethodDataKlarna {
1746    fn default() -> Self {
1747        Self::new()
1748    }
1749}
1750/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1751#[derive(Copy, Clone, Debug, serde::Serialize)]
1752pub struct CreatePaymentIntentPaymentMethodDataNaverPay {
1753    /// Whether to use Naver Pay points or a card to fund this transaction.
1754    /// If not provided, this defaults to `card`.
1755    #[serde(skip_serializing_if = "Option::is_none")]
1756    pub funding: Option<CreatePaymentIntentPaymentMethodDataNaverPayFunding>,
1757}
1758impl CreatePaymentIntentPaymentMethodDataNaverPay {
1759    pub fn new() -> Self {
1760        Self { funding: None }
1761    }
1762}
1763impl Default for CreatePaymentIntentPaymentMethodDataNaverPay {
1764    fn default() -> Self {
1765        Self::new()
1766    }
1767}
1768/// Whether to use Naver Pay points or a card to fund this transaction.
1769/// If not provided, this defaults to `card`.
1770#[derive(Copy, Clone, Eq, PartialEq)]
1771pub enum CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1772    Card,
1773    Points,
1774}
1775impl CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1776    pub fn as_str(self) -> &'static str {
1777        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1778        match self {
1779            Card => "card",
1780            Points => "points",
1781        }
1782    }
1783}
1784
1785impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1786    type Err = stripe_types::StripeParseError;
1787    fn from_str(s: &str) -> Result<Self, Self::Err> {
1788        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1789        match s {
1790            "card" => Ok(Card),
1791            "points" => Ok(Points),
1792            _ => Err(stripe_types::StripeParseError),
1793        }
1794    }
1795}
1796impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1797    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1798        f.write_str(self.as_str())
1799    }
1800}
1801
1802impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1804        f.write_str(self.as_str())
1805    }
1806}
1807impl serde::Serialize for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1808    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1809    where
1810        S: serde::Serializer,
1811    {
1812        serializer.serialize_str(self.as_str())
1813    }
1814}
1815#[cfg(feature = "deserialize")]
1816impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1817    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1818        use std::str::FromStr;
1819        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1820        Self::from_str(&s).map_err(|_| {
1821            serde::de::Error::custom(
1822                "Unknown value for CreatePaymentIntentPaymentMethodDataNaverPayFunding",
1823            )
1824        })
1825    }
1826}
1827/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1828#[derive(Clone, Debug, serde::Serialize)]
1829pub struct CreatePaymentIntentPaymentMethodDataNzBankAccount {
1830    /// The name on the bank account.
1831    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1832    #[serde(skip_serializing_if = "Option::is_none")]
1833    pub account_holder_name: Option<String>,
1834    /// The account number for the bank account.
1835    pub account_number: String,
1836    /// The numeric code for the bank account's bank.
1837    pub bank_code: String,
1838    /// The numeric code for the bank account's bank branch.
1839    pub branch_code: String,
1840    #[serde(skip_serializing_if = "Option::is_none")]
1841    pub reference: Option<String>,
1842    /// The suffix of the bank account number.
1843    pub suffix: String,
1844}
1845impl CreatePaymentIntentPaymentMethodDataNzBankAccount {
1846    pub fn new(
1847        account_number: impl Into<String>,
1848        bank_code: impl Into<String>,
1849        branch_code: impl Into<String>,
1850        suffix: impl Into<String>,
1851    ) -> Self {
1852        Self {
1853            account_holder_name: None,
1854            account_number: account_number.into(),
1855            bank_code: bank_code.into(),
1856            branch_code: branch_code.into(),
1857            reference: None,
1858            suffix: suffix.into(),
1859        }
1860    }
1861}
1862/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1863#[derive(Clone, Debug, serde::Serialize)]
1864pub struct CreatePaymentIntentPaymentMethodDataP24 {
1865    /// The customer's bank.
1866    #[serde(skip_serializing_if = "Option::is_none")]
1867    pub bank: Option<CreatePaymentIntentPaymentMethodDataP24Bank>,
1868}
1869impl CreatePaymentIntentPaymentMethodDataP24 {
1870    pub fn new() -> Self {
1871        Self { bank: None }
1872    }
1873}
1874impl Default for CreatePaymentIntentPaymentMethodDataP24 {
1875    fn default() -> Self {
1876        Self::new()
1877    }
1878}
1879/// The customer's bank.
1880#[derive(Clone, Eq, PartialEq)]
1881#[non_exhaustive]
1882pub enum CreatePaymentIntentPaymentMethodDataP24Bank {
1883    AliorBank,
1884    BankMillennium,
1885    BankNowyBfgSa,
1886    BankPekaoSa,
1887    BankiSpbdzielcze,
1888    Blik,
1889    BnpParibas,
1890    Boz,
1891    CitiHandlowy,
1892    CreditAgricole,
1893    Envelobank,
1894    EtransferPocztowy24,
1895    GetinBank,
1896    Ideabank,
1897    Ing,
1898    Inteligo,
1899    MbankMtransfer,
1900    NestPrzelew,
1901    NoblePay,
1902    PbacZIpko,
1903    PlusBank,
1904    SantanderPrzelew24,
1905    TmobileUsbugiBankowe,
1906    ToyotaBank,
1907    Velobank,
1908    VolkswagenBank,
1909    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1910    Unknown(String),
1911}
1912impl CreatePaymentIntentPaymentMethodDataP24Bank {
1913    pub fn as_str(&self) -> &str {
1914        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1915        match self {
1916            AliorBank => "alior_bank",
1917            BankMillennium => "bank_millennium",
1918            BankNowyBfgSa => "bank_nowy_bfg_sa",
1919            BankPekaoSa => "bank_pekao_sa",
1920            BankiSpbdzielcze => "banki_spbdzielcze",
1921            Blik => "blik",
1922            BnpParibas => "bnp_paribas",
1923            Boz => "boz",
1924            CitiHandlowy => "citi_handlowy",
1925            CreditAgricole => "credit_agricole",
1926            Envelobank => "envelobank",
1927            EtransferPocztowy24 => "etransfer_pocztowy24",
1928            GetinBank => "getin_bank",
1929            Ideabank => "ideabank",
1930            Ing => "ing",
1931            Inteligo => "inteligo",
1932            MbankMtransfer => "mbank_mtransfer",
1933            NestPrzelew => "nest_przelew",
1934            NoblePay => "noble_pay",
1935            PbacZIpko => "pbac_z_ipko",
1936            PlusBank => "plus_bank",
1937            SantanderPrzelew24 => "santander_przelew24",
1938            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1939            ToyotaBank => "toyota_bank",
1940            Velobank => "velobank",
1941            VolkswagenBank => "volkswagen_bank",
1942            Unknown(v) => v,
1943        }
1944    }
1945}
1946
1947impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataP24Bank {
1948    type Err = std::convert::Infallible;
1949    fn from_str(s: &str) -> Result<Self, Self::Err> {
1950        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1951        match s {
1952            "alior_bank" => Ok(AliorBank),
1953            "bank_millennium" => Ok(BankMillennium),
1954            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
1955            "bank_pekao_sa" => Ok(BankPekaoSa),
1956            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
1957            "blik" => Ok(Blik),
1958            "bnp_paribas" => Ok(BnpParibas),
1959            "boz" => Ok(Boz),
1960            "citi_handlowy" => Ok(CitiHandlowy),
1961            "credit_agricole" => Ok(CreditAgricole),
1962            "envelobank" => Ok(Envelobank),
1963            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
1964            "getin_bank" => Ok(GetinBank),
1965            "ideabank" => Ok(Ideabank),
1966            "ing" => Ok(Ing),
1967            "inteligo" => Ok(Inteligo),
1968            "mbank_mtransfer" => Ok(MbankMtransfer),
1969            "nest_przelew" => Ok(NestPrzelew),
1970            "noble_pay" => Ok(NoblePay),
1971            "pbac_z_ipko" => Ok(PbacZIpko),
1972            "plus_bank" => Ok(PlusBank),
1973            "santander_przelew24" => Ok(SantanderPrzelew24),
1974            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
1975            "toyota_bank" => Ok(ToyotaBank),
1976            "velobank" => Ok(Velobank),
1977            "volkswagen_bank" => Ok(VolkswagenBank),
1978            v => Ok(Unknown(v.to_owned())),
1979        }
1980    }
1981}
1982impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank {
1983    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1984        f.write_str(self.as_str())
1985    }
1986}
1987
1988impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataP24Bank {
1989    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1990        f.write_str(self.as_str())
1991    }
1992}
1993impl serde::Serialize for CreatePaymentIntentPaymentMethodDataP24Bank {
1994    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1995    where
1996        S: serde::Serializer,
1997    {
1998        serializer.serialize_str(self.as_str())
1999    }
2000}
2001#[cfg(feature = "deserialize")]
2002impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataP24Bank {
2003    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2004        use std::str::FromStr;
2005        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2006        Ok(Self::from_str(&s).unwrap())
2007    }
2008}
2009/// Options to configure Radar.
2010/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
2011#[derive(Clone, Debug, serde::Serialize)]
2012pub struct CreatePaymentIntentPaymentMethodDataRadarOptions {
2013    /// 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.
2014    #[serde(skip_serializing_if = "Option::is_none")]
2015    pub session: Option<String>,
2016}
2017impl CreatePaymentIntentPaymentMethodDataRadarOptions {
2018    pub fn new() -> Self {
2019        Self { session: None }
2020    }
2021}
2022impl Default for CreatePaymentIntentPaymentMethodDataRadarOptions {
2023    fn default() -> Self {
2024        Self::new()
2025    }
2026}
2027/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
2028#[derive(Clone, Debug, serde::Serialize)]
2029pub struct CreatePaymentIntentPaymentMethodDataSepaDebit {
2030    /// IBAN of the bank account.
2031    pub iban: String,
2032}
2033impl CreatePaymentIntentPaymentMethodDataSepaDebit {
2034    pub fn new(iban: impl Into<String>) -> Self {
2035        Self { iban: iban.into() }
2036    }
2037}
2038/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
2039#[derive(Copy, Clone, Debug, serde::Serialize)]
2040pub struct CreatePaymentIntentPaymentMethodDataSofort {
2041    /// Two-letter ISO code representing the country the bank account is located in.
2042    pub country: CreatePaymentIntentPaymentMethodDataSofortCountry,
2043}
2044impl CreatePaymentIntentPaymentMethodDataSofort {
2045    pub fn new(country: impl Into<CreatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
2046        Self { country: country.into() }
2047    }
2048}
2049/// Two-letter ISO code representing the country the bank account is located in.
2050#[derive(Copy, Clone, Eq, PartialEq)]
2051pub enum CreatePaymentIntentPaymentMethodDataSofortCountry {
2052    At,
2053    Be,
2054    De,
2055    Es,
2056    It,
2057    Nl,
2058}
2059impl CreatePaymentIntentPaymentMethodDataSofortCountry {
2060    pub fn as_str(self) -> &'static str {
2061        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
2062        match self {
2063            At => "AT",
2064            Be => "BE",
2065            De => "DE",
2066            Es => "ES",
2067            It => "IT",
2068            Nl => "NL",
2069        }
2070    }
2071}
2072
2073impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataSofortCountry {
2074    type Err = stripe_types::StripeParseError;
2075    fn from_str(s: &str) -> Result<Self, Self::Err> {
2076        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
2077        match s {
2078            "AT" => Ok(At),
2079            "BE" => Ok(Be),
2080            "DE" => Ok(De),
2081            "ES" => Ok(Es),
2082            "IT" => Ok(It),
2083            "NL" => Ok(Nl),
2084            _ => Err(stripe_types::StripeParseError),
2085        }
2086    }
2087}
2088impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry {
2089    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2090        f.write_str(self.as_str())
2091    }
2092}
2093
2094impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataSofortCountry {
2095    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2096        f.write_str(self.as_str())
2097    }
2098}
2099impl serde::Serialize for CreatePaymentIntentPaymentMethodDataSofortCountry {
2100    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2101    where
2102        S: serde::Serializer,
2103    {
2104        serializer.serialize_str(self.as_str())
2105    }
2106}
2107#[cfg(feature = "deserialize")]
2108impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataSofortCountry {
2109    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2110        use std::str::FromStr;
2111        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2112        Self::from_str(&s).map_err(|_| {
2113            serde::de::Error::custom(
2114                "Unknown value for CreatePaymentIntentPaymentMethodDataSofortCountry",
2115            )
2116        })
2117    }
2118}
2119/// The type of the PaymentMethod.
2120/// An additional hash is included on the PaymentMethod with a name matching this value.
2121/// It contains additional information specific to the PaymentMethod type.
2122#[derive(Clone, Eq, PartialEq)]
2123#[non_exhaustive]
2124pub enum CreatePaymentIntentPaymentMethodDataType {
2125    AcssDebit,
2126    Affirm,
2127    AfterpayClearpay,
2128    Alipay,
2129    Alma,
2130    AmazonPay,
2131    AuBecsDebit,
2132    BacsDebit,
2133    Bancontact,
2134    Billie,
2135    Blik,
2136    Boleto,
2137    Cashapp,
2138    Crypto,
2139    CustomerBalance,
2140    Eps,
2141    Fpx,
2142    Giropay,
2143    Grabpay,
2144    Ideal,
2145    KakaoPay,
2146    Klarna,
2147    Konbini,
2148    KrCard,
2149    Link,
2150    MbWay,
2151    Mobilepay,
2152    Multibanco,
2153    NaverPay,
2154    NzBankAccount,
2155    Oxxo,
2156    P24,
2157    PayByBank,
2158    Payco,
2159    Paynow,
2160    Paypal,
2161    Pix,
2162    Promptpay,
2163    RevolutPay,
2164    SamsungPay,
2165    Satispay,
2166    SepaDebit,
2167    Sofort,
2168    Swish,
2169    Twint,
2170    UsBankAccount,
2171    WechatPay,
2172    Zip,
2173    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2174    Unknown(String),
2175}
2176impl CreatePaymentIntentPaymentMethodDataType {
2177    pub fn as_str(&self) -> &str {
2178        use CreatePaymentIntentPaymentMethodDataType::*;
2179        match self {
2180            AcssDebit => "acss_debit",
2181            Affirm => "affirm",
2182            AfterpayClearpay => "afterpay_clearpay",
2183            Alipay => "alipay",
2184            Alma => "alma",
2185            AmazonPay => "amazon_pay",
2186            AuBecsDebit => "au_becs_debit",
2187            BacsDebit => "bacs_debit",
2188            Bancontact => "bancontact",
2189            Billie => "billie",
2190            Blik => "blik",
2191            Boleto => "boleto",
2192            Cashapp => "cashapp",
2193            Crypto => "crypto",
2194            CustomerBalance => "customer_balance",
2195            Eps => "eps",
2196            Fpx => "fpx",
2197            Giropay => "giropay",
2198            Grabpay => "grabpay",
2199            Ideal => "ideal",
2200            KakaoPay => "kakao_pay",
2201            Klarna => "klarna",
2202            Konbini => "konbini",
2203            KrCard => "kr_card",
2204            Link => "link",
2205            MbWay => "mb_way",
2206            Mobilepay => "mobilepay",
2207            Multibanco => "multibanco",
2208            NaverPay => "naver_pay",
2209            NzBankAccount => "nz_bank_account",
2210            Oxxo => "oxxo",
2211            P24 => "p24",
2212            PayByBank => "pay_by_bank",
2213            Payco => "payco",
2214            Paynow => "paynow",
2215            Paypal => "paypal",
2216            Pix => "pix",
2217            Promptpay => "promptpay",
2218            RevolutPay => "revolut_pay",
2219            SamsungPay => "samsung_pay",
2220            Satispay => "satispay",
2221            SepaDebit => "sepa_debit",
2222            Sofort => "sofort",
2223            Swish => "swish",
2224            Twint => "twint",
2225            UsBankAccount => "us_bank_account",
2226            WechatPay => "wechat_pay",
2227            Zip => "zip",
2228            Unknown(v) => v,
2229        }
2230    }
2231}
2232
2233impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataType {
2234    type Err = std::convert::Infallible;
2235    fn from_str(s: &str) -> Result<Self, Self::Err> {
2236        use CreatePaymentIntentPaymentMethodDataType::*;
2237        match s {
2238            "acss_debit" => Ok(AcssDebit),
2239            "affirm" => Ok(Affirm),
2240            "afterpay_clearpay" => Ok(AfterpayClearpay),
2241            "alipay" => Ok(Alipay),
2242            "alma" => Ok(Alma),
2243            "amazon_pay" => Ok(AmazonPay),
2244            "au_becs_debit" => Ok(AuBecsDebit),
2245            "bacs_debit" => Ok(BacsDebit),
2246            "bancontact" => Ok(Bancontact),
2247            "billie" => Ok(Billie),
2248            "blik" => Ok(Blik),
2249            "boleto" => Ok(Boleto),
2250            "cashapp" => Ok(Cashapp),
2251            "crypto" => Ok(Crypto),
2252            "customer_balance" => Ok(CustomerBalance),
2253            "eps" => Ok(Eps),
2254            "fpx" => Ok(Fpx),
2255            "giropay" => Ok(Giropay),
2256            "grabpay" => Ok(Grabpay),
2257            "ideal" => Ok(Ideal),
2258            "kakao_pay" => Ok(KakaoPay),
2259            "klarna" => Ok(Klarna),
2260            "konbini" => Ok(Konbini),
2261            "kr_card" => Ok(KrCard),
2262            "link" => Ok(Link),
2263            "mb_way" => Ok(MbWay),
2264            "mobilepay" => Ok(Mobilepay),
2265            "multibanco" => Ok(Multibanco),
2266            "naver_pay" => Ok(NaverPay),
2267            "nz_bank_account" => Ok(NzBankAccount),
2268            "oxxo" => Ok(Oxxo),
2269            "p24" => Ok(P24),
2270            "pay_by_bank" => Ok(PayByBank),
2271            "payco" => Ok(Payco),
2272            "paynow" => Ok(Paynow),
2273            "paypal" => Ok(Paypal),
2274            "pix" => Ok(Pix),
2275            "promptpay" => Ok(Promptpay),
2276            "revolut_pay" => Ok(RevolutPay),
2277            "samsung_pay" => Ok(SamsungPay),
2278            "satispay" => Ok(Satispay),
2279            "sepa_debit" => Ok(SepaDebit),
2280            "sofort" => Ok(Sofort),
2281            "swish" => Ok(Swish),
2282            "twint" => Ok(Twint),
2283            "us_bank_account" => Ok(UsBankAccount),
2284            "wechat_pay" => Ok(WechatPay),
2285            "zip" => Ok(Zip),
2286            v => Ok(Unknown(v.to_owned())),
2287        }
2288    }
2289}
2290impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType {
2291    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2292        f.write_str(self.as_str())
2293    }
2294}
2295
2296impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataType {
2297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2298        f.write_str(self.as_str())
2299    }
2300}
2301impl serde::Serialize for CreatePaymentIntentPaymentMethodDataType {
2302    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2303    where
2304        S: serde::Serializer,
2305    {
2306        serializer.serialize_str(self.as_str())
2307    }
2308}
2309#[cfg(feature = "deserialize")]
2310impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataType {
2311    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2312        use std::str::FromStr;
2313        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2314        Ok(Self::from_str(&s).unwrap())
2315    }
2316}
2317/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
2318#[derive(Clone, Debug, serde::Serialize)]
2319pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount {
2320    /// Account holder type: individual or company.
2321    #[serde(skip_serializing_if = "Option::is_none")]
2322    pub account_holder_type:
2323        Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
2324    /// Account number of the bank account.
2325    #[serde(skip_serializing_if = "Option::is_none")]
2326    pub account_number: Option<String>,
2327    /// Account type: checkings or savings. Defaults to checking if omitted.
2328    #[serde(skip_serializing_if = "Option::is_none")]
2329    pub account_type: Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
2330    /// The ID of a Financial Connections Account to use as a payment method.
2331    #[serde(skip_serializing_if = "Option::is_none")]
2332    pub financial_connections_account: Option<String>,
2333    /// Routing number of the bank account.
2334    #[serde(skip_serializing_if = "Option::is_none")]
2335    pub routing_number: Option<String>,
2336}
2337impl CreatePaymentIntentPaymentMethodDataUsBankAccount {
2338    pub fn new() -> Self {
2339        Self {
2340            account_holder_type: None,
2341            account_number: None,
2342            account_type: None,
2343            financial_connections_account: None,
2344            routing_number: None,
2345        }
2346    }
2347}
2348impl Default for CreatePaymentIntentPaymentMethodDataUsBankAccount {
2349    fn default() -> Self {
2350        Self::new()
2351    }
2352}
2353/// Account holder type: individual or company.
2354#[derive(Copy, Clone, Eq, PartialEq)]
2355pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2356    Company,
2357    Individual,
2358}
2359impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2360    pub fn as_str(self) -> &'static str {
2361        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2362        match self {
2363            Company => "company",
2364            Individual => "individual",
2365        }
2366    }
2367}
2368
2369impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2370    type Err = stripe_types::StripeParseError;
2371    fn from_str(s: &str) -> Result<Self, Self::Err> {
2372        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2373        match s {
2374            "company" => Ok(Company),
2375            "individual" => Ok(Individual),
2376            _ => Err(stripe_types::StripeParseError),
2377        }
2378    }
2379}
2380impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2381    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2382        f.write_str(self.as_str())
2383    }
2384}
2385
2386impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2388        f.write_str(self.as_str())
2389    }
2390}
2391impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2392    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2393    where
2394        S: serde::Serializer,
2395    {
2396        serializer.serialize_str(self.as_str())
2397    }
2398}
2399#[cfg(feature = "deserialize")]
2400impl<'de> serde::Deserialize<'de>
2401    for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
2402{
2403    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2404        use std::str::FromStr;
2405        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2406        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
2407    }
2408}
2409/// Account type: checkings or savings. Defaults to checking if omitted.
2410#[derive(Copy, Clone, Eq, PartialEq)]
2411pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2412    Checking,
2413    Savings,
2414}
2415impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2416    pub fn as_str(self) -> &'static str {
2417        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2418        match self {
2419            Checking => "checking",
2420            Savings => "savings",
2421        }
2422    }
2423}
2424
2425impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2426    type Err = stripe_types::StripeParseError;
2427    fn from_str(s: &str) -> Result<Self, Self::Err> {
2428        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2429        match s {
2430            "checking" => Ok(Checking),
2431            "savings" => Ok(Savings),
2432            _ => Err(stripe_types::StripeParseError),
2433        }
2434    }
2435}
2436impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2438        f.write_str(self.as_str())
2439    }
2440}
2441
2442impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2444        f.write_str(self.as_str())
2445    }
2446}
2447impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2448    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2449    where
2450        S: serde::Serializer,
2451    {
2452        serializer.serialize_str(self.as_str())
2453    }
2454}
2455#[cfg(feature = "deserialize")]
2456impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2457    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2458        use std::str::FromStr;
2459        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2460        Self::from_str(&s).map_err(|_| {
2461            serde::de::Error::custom(
2462                "Unknown value for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType",
2463            )
2464        })
2465    }
2466}
2467/// Payment method-specific configuration for this PaymentIntent.
2468#[derive(Clone, Debug, serde::Serialize)]
2469pub struct CreatePaymentIntentPaymentMethodOptions {
2470    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2471    #[serde(skip_serializing_if = "Option::is_none")]
2472    pub acss_debit: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebit>,
2473    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
2474    #[serde(skip_serializing_if = "Option::is_none")]
2475    pub affirm: Option<CreatePaymentIntentPaymentMethodOptionsAffirm>,
2476    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
2477    #[serde(skip_serializing_if = "Option::is_none")]
2478    pub afterpay_clearpay: Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
2479    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
2480    #[serde(skip_serializing_if = "Option::is_none")]
2481    pub alipay: Option<CreatePaymentIntentPaymentMethodOptionsAlipay>,
2482    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
2483    #[serde(skip_serializing_if = "Option::is_none")]
2484    pub alma: Option<CreatePaymentIntentPaymentMethodOptionsAlma>,
2485    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
2486    #[serde(skip_serializing_if = "Option::is_none")]
2487    pub amazon_pay: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPay>,
2488    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
2489    #[serde(skip_serializing_if = "Option::is_none")]
2490    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
2491    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
2492    #[serde(skip_serializing_if = "Option::is_none")]
2493    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodOptionsBacsDebit>,
2494    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
2495    #[serde(skip_serializing_if = "Option::is_none")]
2496    pub bancontact: Option<CreatePaymentIntentPaymentMethodOptionsBancontact>,
2497    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
2498    #[serde(skip_serializing_if = "Option::is_none")]
2499    pub billie: Option<CreatePaymentIntentPaymentMethodOptionsBillie>,
2500    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
2501    #[serde(skip_serializing_if = "Option::is_none")]
2502    pub blik: Option<CreatePaymentIntentPaymentMethodOptionsBlik>,
2503    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
2504    #[serde(skip_serializing_if = "Option::is_none")]
2505    pub boleto: Option<CreatePaymentIntentPaymentMethodOptionsBoleto>,
2506    /// Configuration for any card payments attempted on this PaymentIntent.
2507    #[serde(skip_serializing_if = "Option::is_none")]
2508    pub card: Option<CreatePaymentIntentPaymentMethodOptionsCard>,
2509    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2510    #[serde(skip_serializing_if = "Option::is_none")]
2511    pub card_present: Option<CreatePaymentIntentPaymentMethodOptionsCardPresent>,
2512    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
2513    #[serde(skip_serializing_if = "Option::is_none")]
2514    pub cashapp: Option<CreatePaymentIntentPaymentMethodOptionsCashapp>,
2515    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
2516    #[serde(skip_serializing_if = "Option::is_none")]
2517    pub crypto: Option<CreatePaymentIntentPaymentMethodOptionsCrypto>,
2518    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
2519    #[serde(skip_serializing_if = "Option::is_none")]
2520    pub customer_balance: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalance>,
2521    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
2522    #[serde(skip_serializing_if = "Option::is_none")]
2523    pub eps: Option<CreatePaymentIntentPaymentMethodOptionsEps>,
2524    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
2525    #[serde(skip_serializing_if = "Option::is_none")]
2526    pub fpx: Option<CreatePaymentIntentPaymentMethodOptionsFpx>,
2527    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
2528    #[serde(skip_serializing_if = "Option::is_none")]
2529    pub giropay: Option<CreatePaymentIntentPaymentMethodOptionsGiropay>,
2530    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
2531    #[serde(skip_serializing_if = "Option::is_none")]
2532    pub grabpay: Option<CreatePaymentIntentPaymentMethodOptionsGrabpay>,
2533    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
2534    #[serde(skip_serializing_if = "Option::is_none")]
2535    pub ideal: Option<CreatePaymentIntentPaymentMethodOptionsIdeal>,
2536    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2537    #[serde(skip_serializing_if = "Option::is_none")]
2538    #[serde(with = "stripe_types::with_serde_json_opt")]
2539    pub interac_present: Option<miniserde::json::Value>,
2540    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
2541    #[serde(skip_serializing_if = "Option::is_none")]
2542    pub kakao_pay: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPay>,
2543    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
2544    #[serde(skip_serializing_if = "Option::is_none")]
2545    pub klarna: Option<CreatePaymentIntentPaymentMethodOptionsKlarna>,
2546    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
2547    #[serde(skip_serializing_if = "Option::is_none")]
2548    pub konbini: Option<CreatePaymentIntentPaymentMethodOptionsKonbini>,
2549    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
2550    #[serde(skip_serializing_if = "Option::is_none")]
2551    pub kr_card: Option<CreatePaymentIntentPaymentMethodOptionsKrCard>,
2552    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2553    #[serde(skip_serializing_if = "Option::is_none")]
2554    pub link: Option<CreatePaymentIntentPaymentMethodOptionsLink>,
2555    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
2556    #[serde(skip_serializing_if = "Option::is_none")]
2557    pub mb_way: Option<CreatePaymentIntentPaymentMethodOptionsMbWay>,
2558    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
2559    #[serde(skip_serializing_if = "Option::is_none")]
2560    pub mobilepay: Option<CreatePaymentIntentPaymentMethodOptionsMobilepay>,
2561    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
2562    #[serde(skip_serializing_if = "Option::is_none")]
2563    pub multibanco: Option<CreatePaymentIntentPaymentMethodOptionsMultibanco>,
2564    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
2565    #[serde(skip_serializing_if = "Option::is_none")]
2566    pub naver_pay: Option<CreatePaymentIntentPaymentMethodOptionsNaverPay>,
2567    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
2568    #[serde(skip_serializing_if = "Option::is_none")]
2569    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccount>,
2570    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
2571    #[serde(skip_serializing_if = "Option::is_none")]
2572    pub oxxo: Option<CreatePaymentIntentPaymentMethodOptionsOxxo>,
2573    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
2574    #[serde(skip_serializing_if = "Option::is_none")]
2575    pub p24: Option<CreatePaymentIntentPaymentMethodOptionsP24>,
2576    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
2577    #[serde(skip_serializing_if = "Option::is_none")]
2578    #[serde(with = "stripe_types::with_serde_json_opt")]
2579    pub pay_by_bank: Option<miniserde::json::Value>,
2580    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
2581    #[serde(skip_serializing_if = "Option::is_none")]
2582    pub payco: Option<CreatePaymentIntentPaymentMethodOptionsPayco>,
2583    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
2584    #[serde(skip_serializing_if = "Option::is_none")]
2585    pub paynow: Option<CreatePaymentIntentPaymentMethodOptionsPaynow>,
2586    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2587    #[serde(skip_serializing_if = "Option::is_none")]
2588    pub paypal: Option<CreatePaymentIntentPaymentMethodOptionsPaypal>,
2589    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
2590    #[serde(skip_serializing_if = "Option::is_none")]
2591    pub pix: Option<CreatePaymentIntentPaymentMethodOptionsPix>,
2592    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
2593    #[serde(skip_serializing_if = "Option::is_none")]
2594    pub promptpay: Option<CreatePaymentIntentPaymentMethodOptionsPromptpay>,
2595    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
2596    #[serde(skip_serializing_if = "Option::is_none")]
2597    pub revolut_pay: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPay>,
2598    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
2599    #[serde(skip_serializing_if = "Option::is_none")]
2600    pub samsung_pay: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPay>,
2601    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
2602    #[serde(skip_serializing_if = "Option::is_none")]
2603    pub satispay: Option<CreatePaymentIntentPaymentMethodOptionsSatispay>,
2604    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
2605    #[serde(skip_serializing_if = "Option::is_none")]
2606    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebit>,
2607    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
2608    #[serde(skip_serializing_if = "Option::is_none")]
2609    pub sofort: Option<CreatePaymentIntentPaymentMethodOptionsSofort>,
2610    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
2611    #[serde(skip_serializing_if = "Option::is_none")]
2612    pub swish: Option<CreatePaymentIntentPaymentMethodOptionsSwish>,
2613    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
2614    #[serde(skip_serializing_if = "Option::is_none")]
2615    pub twint: Option<CreatePaymentIntentPaymentMethodOptionsTwint>,
2616    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
2617    #[serde(skip_serializing_if = "Option::is_none")]
2618    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccount>,
2619    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
2620    #[serde(skip_serializing_if = "Option::is_none")]
2621    pub wechat_pay: Option<CreatePaymentIntentPaymentMethodOptionsWechatPay>,
2622    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
2623    #[serde(skip_serializing_if = "Option::is_none")]
2624    pub zip: Option<CreatePaymentIntentPaymentMethodOptionsZip>,
2625}
2626impl CreatePaymentIntentPaymentMethodOptions {
2627    pub fn new() -> Self {
2628        Self {
2629            acss_debit: None,
2630            affirm: None,
2631            afterpay_clearpay: None,
2632            alipay: None,
2633            alma: None,
2634            amazon_pay: None,
2635            au_becs_debit: None,
2636            bacs_debit: None,
2637            bancontact: None,
2638            billie: None,
2639            blik: None,
2640            boleto: None,
2641            card: None,
2642            card_present: None,
2643            cashapp: None,
2644            crypto: None,
2645            customer_balance: None,
2646            eps: None,
2647            fpx: None,
2648            giropay: None,
2649            grabpay: None,
2650            ideal: None,
2651            interac_present: None,
2652            kakao_pay: None,
2653            klarna: None,
2654            konbini: None,
2655            kr_card: None,
2656            link: None,
2657            mb_way: None,
2658            mobilepay: None,
2659            multibanco: None,
2660            naver_pay: None,
2661            nz_bank_account: None,
2662            oxxo: None,
2663            p24: None,
2664            pay_by_bank: None,
2665            payco: None,
2666            paynow: None,
2667            paypal: None,
2668            pix: None,
2669            promptpay: None,
2670            revolut_pay: None,
2671            samsung_pay: None,
2672            satispay: None,
2673            sepa_debit: None,
2674            sofort: None,
2675            swish: None,
2676            twint: None,
2677            us_bank_account: None,
2678            wechat_pay: None,
2679            zip: None,
2680        }
2681    }
2682}
2683impl Default for CreatePaymentIntentPaymentMethodOptions {
2684    fn default() -> Self {
2685        Self::new()
2686    }
2687}
2688/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2689#[derive(Clone, Debug, serde::Serialize)]
2690pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2691    /// Additional fields for Mandate creation
2692    #[serde(skip_serializing_if = "Option::is_none")]
2693    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2694    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2695    ///
2696    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
2697    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
2698    ///
2699    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
2700    ///
2701    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
2702    ///
2703    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2704    #[serde(skip_serializing_if = "Option::is_none")]
2705    pub setup_future_usage:
2706        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
2707    /// Controls when Stripe will attempt to debit the funds from the customer's account.
2708    /// The date must be a string in YYYY-MM-DD format.
2709    /// The date must be in the future and between 3 and 15 calendar days from now.
2710    #[serde(skip_serializing_if = "Option::is_none")]
2711    pub target_date: Option<String>,
2712    /// Bank account verification method.
2713    #[serde(skip_serializing_if = "Option::is_none")]
2714    pub verification_method:
2715        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2716}
2717impl CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2718    pub fn new() -> Self {
2719        Self {
2720            mandate_options: None,
2721            setup_future_usage: None,
2722            target_date: None,
2723            verification_method: None,
2724        }
2725    }
2726}
2727impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2728    fn default() -> Self {
2729        Self::new()
2730    }
2731}
2732/// Additional fields for Mandate creation
2733#[derive(Clone, Debug, serde::Serialize)]
2734pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2735    /// A URL for custom mandate text to render during confirmation step.
2736    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2737    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2738    #[serde(skip_serializing_if = "Option::is_none")]
2739    pub custom_mandate_url: Option<String>,
2740    /// Description of the mandate interval.
2741    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2742    #[serde(skip_serializing_if = "Option::is_none")]
2743    pub interval_description: Option<String>,
2744    /// Payment schedule for the mandate.
2745    #[serde(skip_serializing_if = "Option::is_none")]
2746    pub payment_schedule:
2747        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2748    /// Transaction type of the mandate.
2749    #[serde(skip_serializing_if = "Option::is_none")]
2750    pub transaction_type:
2751        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2752}
2753impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2754    pub fn new() -> Self {
2755        Self {
2756            custom_mandate_url: None,
2757            interval_description: None,
2758            payment_schedule: None,
2759            transaction_type: None,
2760        }
2761    }
2762}
2763impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2764    fn default() -> Self {
2765        Self::new()
2766    }
2767}
2768/// Payment schedule for the mandate.
2769#[derive(Copy, Clone, Eq, PartialEq)]
2770pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2771    Combined,
2772    Interval,
2773    Sporadic,
2774}
2775impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2776    pub fn as_str(self) -> &'static str {
2777        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2778        match self {
2779            Combined => "combined",
2780            Interval => "interval",
2781            Sporadic => "sporadic",
2782        }
2783    }
2784}
2785
2786impl std::str::FromStr
2787    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2788{
2789    type Err = stripe_types::StripeParseError;
2790    fn from_str(s: &str) -> Result<Self, Self::Err> {
2791        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2792        match s {
2793            "combined" => Ok(Combined),
2794            "interval" => Ok(Interval),
2795            "sporadic" => Ok(Sporadic),
2796            _ => Err(stripe_types::StripeParseError),
2797        }
2798    }
2799}
2800impl std::fmt::Display
2801    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2802{
2803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2804        f.write_str(self.as_str())
2805    }
2806}
2807
2808impl std::fmt::Debug
2809    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2810{
2811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2812        f.write_str(self.as_str())
2813    }
2814}
2815impl serde::Serialize
2816    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2817{
2818    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2819    where
2820        S: serde::Serializer,
2821    {
2822        serializer.serialize_str(self.as_str())
2823    }
2824}
2825#[cfg(feature = "deserialize")]
2826impl<'de> serde::Deserialize<'de>
2827    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2828{
2829    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2830        use std::str::FromStr;
2831        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2832        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
2833    }
2834}
2835/// Transaction type of the mandate.
2836#[derive(Copy, Clone, Eq, PartialEq)]
2837pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2838    Business,
2839    Personal,
2840}
2841impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2842    pub fn as_str(self) -> &'static str {
2843        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2844        match self {
2845            Business => "business",
2846            Personal => "personal",
2847        }
2848    }
2849}
2850
2851impl std::str::FromStr
2852    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2853{
2854    type Err = stripe_types::StripeParseError;
2855    fn from_str(s: &str) -> Result<Self, Self::Err> {
2856        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2857        match s {
2858            "business" => Ok(Business),
2859            "personal" => Ok(Personal),
2860            _ => Err(stripe_types::StripeParseError),
2861        }
2862    }
2863}
2864impl std::fmt::Display
2865    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2866{
2867    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2868        f.write_str(self.as_str())
2869    }
2870}
2871
2872impl std::fmt::Debug
2873    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2874{
2875    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2876        f.write_str(self.as_str())
2877    }
2878}
2879impl serde::Serialize
2880    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2881{
2882    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2883    where
2884        S: serde::Serializer,
2885    {
2886        serializer.serialize_str(self.as_str())
2887    }
2888}
2889#[cfg(feature = "deserialize")]
2890impl<'de> serde::Deserialize<'de>
2891    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2892{
2893    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2894        use std::str::FromStr;
2895        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2896        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
2897    }
2898}
2899/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2900///
2901/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
2902/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
2903///
2904/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
2905///
2906/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
2907///
2908/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2909#[derive(Copy, Clone, Eq, PartialEq)]
2910pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2911    None,
2912    OffSession,
2913    OnSession,
2914}
2915impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2916    pub fn as_str(self) -> &'static str {
2917        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
2918        match self {
2919            None => "none",
2920            OffSession => "off_session",
2921            OnSession => "on_session",
2922        }
2923    }
2924}
2925
2926impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2927    type Err = stripe_types::StripeParseError;
2928    fn from_str(s: &str) -> Result<Self, Self::Err> {
2929        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
2930        match s {
2931            "none" => Ok(None),
2932            "off_session" => Ok(OffSession),
2933            "on_session" => Ok(OnSession),
2934            _ => Err(stripe_types::StripeParseError),
2935        }
2936    }
2937}
2938impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2939    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2940        f.write_str(self.as_str())
2941    }
2942}
2943
2944impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2945    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2946        f.write_str(self.as_str())
2947    }
2948}
2949impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
2950    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2951    where
2952        S: serde::Serializer,
2953    {
2954        serializer.serialize_str(self.as_str())
2955    }
2956}
2957#[cfg(feature = "deserialize")]
2958impl<'de> serde::Deserialize<'de>
2959    for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
2960{
2961    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2962        use std::str::FromStr;
2963        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2964        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
2965    }
2966}
2967/// Bank account verification method.
2968#[derive(Copy, Clone, Eq, PartialEq)]
2969pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2970    Automatic,
2971    Instant,
2972    Microdeposits,
2973}
2974impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2975    pub fn as_str(self) -> &'static str {
2976        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2977        match self {
2978            Automatic => "automatic",
2979            Instant => "instant",
2980            Microdeposits => "microdeposits",
2981        }
2982    }
2983}
2984
2985impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2986    type Err = stripe_types::StripeParseError;
2987    fn from_str(s: &str) -> Result<Self, Self::Err> {
2988        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
2989        match s {
2990            "automatic" => Ok(Automatic),
2991            "instant" => Ok(Instant),
2992            "microdeposits" => Ok(Microdeposits),
2993            _ => Err(stripe_types::StripeParseError),
2994        }
2995    }
2996}
2997impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
2998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2999        f.write_str(self.as_str())
3000    }
3001}
3002
3003impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3005        f.write_str(self.as_str())
3006    }
3007}
3008impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3009    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3010    where
3011        S: serde::Serializer,
3012    {
3013        serializer.serialize_str(self.as_str())
3014    }
3015}
3016#[cfg(feature = "deserialize")]
3017impl<'de> serde::Deserialize<'de>
3018    for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
3019{
3020    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3021        use std::str::FromStr;
3022        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3023        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
3024    }
3025}
3026/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
3027#[derive(Clone, Debug, serde::Serialize)]
3028pub struct CreatePaymentIntentPaymentMethodOptionsAffirm {
3029    /// Controls when the funds are captured from the customer's account.
3030    ///
3031    /// 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.
3032    ///
3033    /// 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.
3034    #[serde(skip_serializing_if = "Option::is_none")]
3035    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
3036    /// Preferred language of the Affirm authorization page that the customer is redirected to.
3037    #[serde(skip_serializing_if = "Option::is_none")]
3038    pub preferred_locale: Option<String>,
3039    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3040    ///
3041    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3042    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3043    ///
3044    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3045    ///
3046    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3047    ///
3048    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3049    #[serde(skip_serializing_if = "Option::is_none")]
3050    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
3051}
3052impl CreatePaymentIntentPaymentMethodOptionsAffirm {
3053    pub fn new() -> Self {
3054        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
3055    }
3056}
3057impl Default for CreatePaymentIntentPaymentMethodOptionsAffirm {
3058    fn default() -> Self {
3059        Self::new()
3060    }
3061}
3062/// Controls when the funds are captured from the customer's account.
3063///
3064/// 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.
3065///
3066/// 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.
3067#[derive(Copy, Clone, Eq, PartialEq)]
3068pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3069    Manual,
3070}
3071impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3072    pub fn as_str(self) -> &'static str {
3073        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
3074        match self {
3075            Manual => "manual",
3076        }
3077    }
3078}
3079
3080impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3081    type Err = stripe_types::StripeParseError;
3082    fn from_str(s: &str) -> Result<Self, Self::Err> {
3083        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
3084        match s {
3085            "manual" => Ok(Manual),
3086            _ => Err(stripe_types::StripeParseError),
3087        }
3088    }
3089}
3090impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3091    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3092        f.write_str(self.as_str())
3093    }
3094}
3095
3096impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3097    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3098        f.write_str(self.as_str())
3099    }
3100}
3101impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3102    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3103    where
3104        S: serde::Serializer,
3105    {
3106        serializer.serialize_str(self.as_str())
3107    }
3108}
3109#[cfg(feature = "deserialize")]
3110impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3111    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3112        use std::str::FromStr;
3113        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3114        Self::from_str(&s).map_err(|_| {
3115            serde::de::Error::custom(
3116                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
3117            )
3118        })
3119    }
3120}
3121/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3122///
3123/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3124/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3125///
3126/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3127///
3128/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3129///
3130/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3131#[derive(Copy, Clone, Eq, PartialEq)]
3132pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3133    None,
3134}
3135impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3136    pub fn as_str(self) -> &'static str {
3137        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
3138        match self {
3139            None => "none",
3140        }
3141    }
3142}
3143
3144impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3145    type Err = stripe_types::StripeParseError;
3146    fn from_str(s: &str) -> Result<Self, Self::Err> {
3147        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
3148        match s {
3149            "none" => Ok(None),
3150            _ => Err(stripe_types::StripeParseError),
3151        }
3152    }
3153}
3154impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3156        f.write_str(self.as_str())
3157    }
3158}
3159
3160impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3162        f.write_str(self.as_str())
3163    }
3164}
3165impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3166    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3167    where
3168        S: serde::Serializer,
3169    {
3170        serializer.serialize_str(self.as_str())
3171    }
3172}
3173#[cfg(feature = "deserialize")]
3174impl<'de> serde::Deserialize<'de>
3175    for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
3176{
3177    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3178        use std::str::FromStr;
3179        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3180        Self::from_str(&s).map_err(|_| {
3181            serde::de::Error::custom(
3182                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
3183            )
3184        })
3185    }
3186}
3187/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
3188#[derive(Clone, Debug, serde::Serialize)]
3189pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3190    /// Controls when the funds are captured from the customer's account.
3191    ///
3192    /// 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.
3193    ///
3194    /// 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.
3195    #[serde(skip_serializing_if = "Option::is_none")]
3196    pub capture_method:
3197        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
3198    /// An internal identifier or reference that this payment corresponds to.
3199    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
3200    /// This field differs from the statement descriptor and item name.
3201    #[serde(skip_serializing_if = "Option::is_none")]
3202    pub reference: Option<String>,
3203    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3204    ///
3205    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3206    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3207    ///
3208    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3209    ///
3210    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3211    ///
3212    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3213    #[serde(skip_serializing_if = "Option::is_none")]
3214    pub setup_future_usage:
3215        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
3216}
3217impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3218    pub fn new() -> Self {
3219        Self { capture_method: None, reference: None, setup_future_usage: None }
3220    }
3221}
3222impl Default for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3223    fn default() -> Self {
3224        Self::new()
3225    }
3226}
3227/// Controls when the funds are captured from the customer's account.
3228///
3229/// 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.
3230///
3231/// 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.
3232#[derive(Copy, Clone, Eq, PartialEq)]
3233pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3234    Manual,
3235}
3236impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3237    pub fn as_str(self) -> &'static str {
3238        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
3239        match self {
3240            Manual => "manual",
3241        }
3242    }
3243}
3244
3245impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3246    type Err = stripe_types::StripeParseError;
3247    fn from_str(s: &str) -> Result<Self, Self::Err> {
3248        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
3249        match s {
3250            "manual" => Ok(Manual),
3251            _ => Err(stripe_types::StripeParseError),
3252        }
3253    }
3254}
3255impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3256    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3257        f.write_str(self.as_str())
3258    }
3259}
3260
3261impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3262    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3263        f.write_str(self.as_str())
3264    }
3265}
3266impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3267    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3268    where
3269        S: serde::Serializer,
3270    {
3271        serializer.serialize_str(self.as_str())
3272    }
3273}
3274#[cfg(feature = "deserialize")]
3275impl<'de> serde::Deserialize<'de>
3276    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
3277{
3278    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3279        use std::str::FromStr;
3280        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3281        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
3282    }
3283}
3284/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3285///
3286/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3287/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3288///
3289/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3290///
3291/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3292///
3293/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3294#[derive(Copy, Clone, Eq, PartialEq)]
3295pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3296    None,
3297}
3298impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3299    pub fn as_str(self) -> &'static str {
3300        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3301        match self {
3302            None => "none",
3303        }
3304    }
3305}
3306
3307impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3308    type Err = stripe_types::StripeParseError;
3309    fn from_str(s: &str) -> Result<Self, Self::Err> {
3310        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3311        match s {
3312            "none" => Ok(None),
3313            _ => Err(stripe_types::StripeParseError),
3314        }
3315    }
3316}
3317impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3318    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3319        f.write_str(self.as_str())
3320    }
3321}
3322
3323impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3324    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3325        f.write_str(self.as_str())
3326    }
3327}
3328impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3329    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3330    where
3331        S: serde::Serializer,
3332    {
3333        serializer.serialize_str(self.as_str())
3334    }
3335}
3336#[cfg(feature = "deserialize")]
3337impl<'de> serde::Deserialize<'de>
3338    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
3339{
3340    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3341        use std::str::FromStr;
3342        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3343        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
3344    }
3345}
3346/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
3347#[derive(Copy, Clone, Debug, serde::Serialize)]
3348pub struct CreatePaymentIntentPaymentMethodOptionsAlipay {
3349    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3350    ///
3351    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3352    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3353    ///
3354    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3355    ///
3356    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3357    ///
3358    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3359    #[serde(skip_serializing_if = "Option::is_none")]
3360    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
3361}
3362impl CreatePaymentIntentPaymentMethodOptionsAlipay {
3363    pub fn new() -> Self {
3364        Self { setup_future_usage: None }
3365    }
3366}
3367impl Default for CreatePaymentIntentPaymentMethodOptionsAlipay {
3368    fn default() -> Self {
3369        Self::new()
3370    }
3371}
3372/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3373///
3374/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3375/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3376///
3377/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3378///
3379/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3380///
3381/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3382#[derive(Copy, Clone, Eq, PartialEq)]
3383pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3384    None,
3385    OffSession,
3386}
3387impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3388    pub fn as_str(self) -> &'static str {
3389        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3390        match self {
3391            None => "none",
3392            OffSession => "off_session",
3393        }
3394    }
3395}
3396
3397impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3398    type Err = stripe_types::StripeParseError;
3399    fn from_str(s: &str) -> Result<Self, Self::Err> {
3400        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3401        match s {
3402            "none" => Ok(None),
3403            "off_session" => Ok(OffSession),
3404            _ => Err(stripe_types::StripeParseError),
3405        }
3406    }
3407}
3408impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3409    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3410        f.write_str(self.as_str())
3411    }
3412}
3413
3414impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3415    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3416        f.write_str(self.as_str())
3417    }
3418}
3419impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3420    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3421    where
3422        S: serde::Serializer,
3423    {
3424        serializer.serialize_str(self.as_str())
3425    }
3426}
3427#[cfg(feature = "deserialize")]
3428impl<'de> serde::Deserialize<'de>
3429    for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
3430{
3431    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3432        use std::str::FromStr;
3433        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3434        Self::from_str(&s).map_err(|_| {
3435            serde::de::Error::custom(
3436                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
3437            )
3438        })
3439    }
3440}
3441/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
3442#[derive(Copy, Clone, Debug, serde::Serialize)]
3443pub struct CreatePaymentIntentPaymentMethodOptionsAlma {
3444    /// Controls when the funds are captured from the customer's account.
3445    ///
3446    /// 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.
3447    ///
3448    /// 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.
3449    #[serde(skip_serializing_if = "Option::is_none")]
3450    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
3451}
3452impl CreatePaymentIntentPaymentMethodOptionsAlma {
3453    pub fn new() -> Self {
3454        Self { capture_method: None }
3455    }
3456}
3457impl Default for CreatePaymentIntentPaymentMethodOptionsAlma {
3458    fn default() -> Self {
3459        Self::new()
3460    }
3461}
3462/// Controls when the funds are captured from the customer's account.
3463///
3464/// 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.
3465///
3466/// 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.
3467#[derive(Copy, Clone, Eq, PartialEq)]
3468pub enum CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3469    Manual,
3470}
3471impl CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3472    pub fn as_str(self) -> &'static str {
3473        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3474        match self {
3475            Manual => "manual",
3476        }
3477    }
3478}
3479
3480impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3481    type Err = stripe_types::StripeParseError;
3482    fn from_str(s: &str) -> Result<Self, Self::Err> {
3483        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3484        match s {
3485            "manual" => Ok(Manual),
3486            _ => Err(stripe_types::StripeParseError),
3487        }
3488    }
3489}
3490impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3491    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3492        f.write_str(self.as_str())
3493    }
3494}
3495
3496impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3497    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3498        f.write_str(self.as_str())
3499    }
3500}
3501impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3502    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3503    where
3504        S: serde::Serializer,
3505    {
3506        serializer.serialize_str(self.as_str())
3507    }
3508}
3509#[cfg(feature = "deserialize")]
3510impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3511    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3512        use std::str::FromStr;
3513        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3514        Self::from_str(&s).map_err(|_| {
3515            serde::de::Error::custom(
3516                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
3517            )
3518        })
3519    }
3520}
3521/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
3522#[derive(Copy, Clone, Debug, serde::Serialize)]
3523pub struct CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3524    /// Controls when the funds are captured from the customer's account.
3525    ///
3526    /// 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.
3527    ///
3528    /// 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.
3529    #[serde(skip_serializing_if = "Option::is_none")]
3530    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
3531    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3532    ///
3533    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3534    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3535    ///
3536    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3537    ///
3538    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3539    #[serde(skip_serializing_if = "Option::is_none")]
3540    pub setup_future_usage:
3541        Option<CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
3542}
3543impl CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3544    pub fn new() -> Self {
3545        Self { capture_method: None, setup_future_usage: None }
3546    }
3547}
3548impl Default for CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3549    fn default() -> Self {
3550        Self::new()
3551    }
3552}
3553/// Controls when the funds are captured from the customer's account.
3554///
3555/// 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.
3556///
3557/// 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.
3558#[derive(Copy, Clone, Eq, PartialEq)]
3559pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3560    Manual,
3561}
3562impl CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3563    pub fn as_str(self) -> &'static str {
3564        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3565        match self {
3566            Manual => "manual",
3567        }
3568    }
3569}
3570
3571impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3572    type Err = stripe_types::StripeParseError;
3573    fn from_str(s: &str) -> Result<Self, Self::Err> {
3574        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3575        match s {
3576            "manual" => Ok(Manual),
3577            _ => Err(stripe_types::StripeParseError),
3578        }
3579    }
3580}
3581impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3582    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3583        f.write_str(self.as_str())
3584    }
3585}
3586
3587impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3589        f.write_str(self.as_str())
3590    }
3591}
3592impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3593    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3594    where
3595        S: serde::Serializer,
3596    {
3597        serializer.serialize_str(self.as_str())
3598    }
3599}
3600#[cfg(feature = "deserialize")]
3601impl<'de> serde::Deserialize<'de>
3602    for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
3603{
3604    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3605        use std::str::FromStr;
3606        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3607        Self::from_str(&s).map_err(|_| {
3608            serde::de::Error::custom(
3609                "Unknown value for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
3610            )
3611        })
3612    }
3613}
3614/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3615///
3616/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3617/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3618///
3619/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3620///
3621/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3622#[derive(Copy, Clone, Eq, PartialEq)]
3623pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3624    None,
3625    OffSession,
3626}
3627impl CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3628    pub fn as_str(self) -> &'static str {
3629        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3630        match self {
3631            None => "none",
3632            OffSession => "off_session",
3633        }
3634    }
3635}
3636
3637impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3638    type Err = stripe_types::StripeParseError;
3639    fn from_str(s: &str) -> Result<Self, Self::Err> {
3640        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3641        match s {
3642            "none" => Ok(None),
3643            "off_session" => Ok(OffSession),
3644            _ => Err(stripe_types::StripeParseError),
3645        }
3646    }
3647}
3648impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3649    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3650        f.write_str(self.as_str())
3651    }
3652}
3653
3654impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3656        f.write_str(self.as_str())
3657    }
3658}
3659impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3660    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3661    where
3662        S: serde::Serializer,
3663    {
3664        serializer.serialize_str(self.as_str())
3665    }
3666}
3667#[cfg(feature = "deserialize")]
3668impl<'de> serde::Deserialize<'de>
3669    for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
3670{
3671    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3672        use std::str::FromStr;
3673        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3674        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
3675    }
3676}
3677/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
3678#[derive(Clone, Debug, serde::Serialize)]
3679pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3680    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3681    ///
3682    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3683    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3684    ///
3685    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3686    ///
3687    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3688    ///
3689    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3690    #[serde(skip_serializing_if = "Option::is_none")]
3691    pub setup_future_usage:
3692        Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
3693    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3694    /// The date must be a string in YYYY-MM-DD format.
3695    /// The date must be in the future and between 3 and 15 calendar days from now.
3696    #[serde(skip_serializing_if = "Option::is_none")]
3697    pub target_date: Option<String>,
3698}
3699impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3700    pub fn new() -> Self {
3701        Self { setup_future_usage: None, target_date: None }
3702    }
3703}
3704impl Default for CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3705    fn default() -> Self {
3706        Self::new()
3707    }
3708}
3709/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3710///
3711/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3712/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3713///
3714/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3715///
3716/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3717///
3718/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3719#[derive(Copy, Clone, Eq, PartialEq)]
3720pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3721    None,
3722    OffSession,
3723    OnSession,
3724}
3725impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3726    pub fn as_str(self) -> &'static str {
3727        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3728        match self {
3729            None => "none",
3730            OffSession => "off_session",
3731            OnSession => "on_session",
3732        }
3733    }
3734}
3735
3736impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3737    type Err = stripe_types::StripeParseError;
3738    fn from_str(s: &str) -> Result<Self, Self::Err> {
3739        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3740        match s {
3741            "none" => Ok(None),
3742            "off_session" => Ok(OffSession),
3743            "on_session" => Ok(OnSession),
3744            _ => Err(stripe_types::StripeParseError),
3745        }
3746    }
3747}
3748impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3750        f.write_str(self.as_str())
3751    }
3752}
3753
3754impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3755    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3756        f.write_str(self.as_str())
3757    }
3758}
3759impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3760    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3761    where
3762        S: serde::Serializer,
3763    {
3764        serializer.serialize_str(self.as_str())
3765    }
3766}
3767#[cfg(feature = "deserialize")]
3768impl<'de> serde::Deserialize<'de>
3769    for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
3770{
3771    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3772        use std::str::FromStr;
3773        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3774        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
3775    }
3776}
3777/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
3778#[derive(Clone, Debug, serde::Serialize)]
3779pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3780    /// Additional fields for Mandate creation
3781    #[serde(skip_serializing_if = "Option::is_none")]
3782    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
3783    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3784    ///
3785    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3786    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3787    ///
3788    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3789    ///
3790    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3791    ///
3792    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3793    #[serde(skip_serializing_if = "Option::is_none")]
3794    pub setup_future_usage:
3795        Option<CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
3796    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3797    /// The date must be a string in YYYY-MM-DD format.
3798    /// The date must be in the future and between 3 and 15 calendar days from now.
3799    #[serde(skip_serializing_if = "Option::is_none")]
3800    pub target_date: Option<String>,
3801}
3802impl CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3803    pub fn new() -> Self {
3804        Self { mandate_options: None, setup_future_usage: None, target_date: None }
3805    }
3806}
3807impl Default for CreatePaymentIntentPaymentMethodOptionsBacsDebit {
3808    fn default() -> Self {
3809        Self::new()
3810    }
3811}
3812/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3813///
3814/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3815/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3816///
3817/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3818///
3819/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3820///
3821/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3822#[derive(Copy, Clone, Eq, PartialEq)]
3823pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3824    None,
3825    OffSession,
3826    OnSession,
3827}
3828impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3829    pub fn as_str(self) -> &'static str {
3830        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
3831        match self {
3832            None => "none",
3833            OffSession => "off_session",
3834            OnSession => "on_session",
3835        }
3836    }
3837}
3838
3839impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3840    type Err = stripe_types::StripeParseError;
3841    fn from_str(s: &str) -> Result<Self, Self::Err> {
3842        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
3843        match s {
3844            "none" => Ok(None),
3845            "off_session" => Ok(OffSession),
3846            "on_session" => Ok(OnSession),
3847            _ => Err(stripe_types::StripeParseError),
3848        }
3849    }
3850}
3851impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3852    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3853        f.write_str(self.as_str())
3854    }
3855}
3856
3857impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3858    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3859        f.write_str(self.as_str())
3860    }
3861}
3862impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
3863    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3864    where
3865        S: serde::Serializer,
3866    {
3867        serializer.serialize_str(self.as_str())
3868    }
3869}
3870#[cfg(feature = "deserialize")]
3871impl<'de> serde::Deserialize<'de>
3872    for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
3873{
3874    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3875        use std::str::FromStr;
3876        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3877        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
3878    }
3879}
3880/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
3881#[derive(Copy, Clone, Debug, serde::Serialize)]
3882pub struct CreatePaymentIntentPaymentMethodOptionsBancontact {
3883    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
3884    #[serde(skip_serializing_if = "Option::is_none")]
3885    pub preferred_language:
3886        Option<CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
3887    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3888    ///
3889    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3890    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3891    ///
3892    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3893    ///
3894    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3895    ///
3896    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3897    #[serde(skip_serializing_if = "Option::is_none")]
3898    pub setup_future_usage:
3899        Option<CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
3900}
3901impl CreatePaymentIntentPaymentMethodOptionsBancontact {
3902    pub fn new() -> Self {
3903        Self { preferred_language: None, setup_future_usage: None }
3904    }
3905}
3906impl Default for CreatePaymentIntentPaymentMethodOptionsBancontact {
3907    fn default() -> Self {
3908        Self::new()
3909    }
3910}
3911/// Preferred language of the Bancontact authorization page that the customer is redirected to.
3912#[derive(Copy, Clone, Eq, PartialEq)]
3913pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3914    De,
3915    En,
3916    Fr,
3917    Nl,
3918}
3919impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3920    pub fn as_str(self) -> &'static str {
3921        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
3922        match self {
3923            De => "de",
3924            En => "en",
3925            Fr => "fr",
3926            Nl => "nl",
3927        }
3928    }
3929}
3930
3931impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3932    type Err = stripe_types::StripeParseError;
3933    fn from_str(s: &str) -> Result<Self, Self::Err> {
3934        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
3935        match s {
3936            "de" => Ok(De),
3937            "en" => Ok(En),
3938            "fr" => Ok(Fr),
3939            "nl" => Ok(Nl),
3940            _ => Err(stripe_types::StripeParseError),
3941        }
3942    }
3943}
3944impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3945    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3946        f.write_str(self.as_str())
3947    }
3948}
3949
3950impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3952        f.write_str(self.as_str())
3953    }
3954}
3955impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
3956    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3957    where
3958        S: serde::Serializer,
3959    {
3960        serializer.serialize_str(self.as_str())
3961    }
3962}
3963#[cfg(feature = "deserialize")]
3964impl<'de> serde::Deserialize<'de>
3965    for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
3966{
3967    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3968        use std::str::FromStr;
3969        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3970        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
3971    }
3972}
3973/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3974///
3975/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3976/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3977///
3978/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3979///
3980/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3981///
3982/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3983#[derive(Copy, Clone, Eq, PartialEq)]
3984pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3985    None,
3986    OffSession,
3987}
3988impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3989    pub fn as_str(self) -> &'static str {
3990        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
3991        match self {
3992            None => "none",
3993            OffSession => "off_session",
3994        }
3995    }
3996}
3997
3998impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
3999    type Err = stripe_types::StripeParseError;
4000    fn from_str(s: &str) -> Result<Self, Self::Err> {
4001        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
4002        match s {
4003            "none" => Ok(None),
4004            "off_session" => Ok(OffSession),
4005            _ => Err(stripe_types::StripeParseError),
4006        }
4007    }
4008}
4009impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4010    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4011        f.write_str(self.as_str())
4012    }
4013}
4014
4015impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4017        f.write_str(self.as_str())
4018    }
4019}
4020impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4021    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4022    where
4023        S: serde::Serializer,
4024    {
4025        serializer.serialize_str(self.as_str())
4026    }
4027}
4028#[cfg(feature = "deserialize")]
4029impl<'de> serde::Deserialize<'de>
4030    for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
4031{
4032    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4033        use std::str::FromStr;
4034        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4035        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
4036    }
4037}
4038/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
4039#[derive(Copy, Clone, Debug, serde::Serialize)]
4040pub struct CreatePaymentIntentPaymentMethodOptionsBillie {
4041    /// Controls when the funds are captured from the customer's account.
4042    ///
4043    /// 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.
4044    ///
4045    /// 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.
4046    #[serde(skip_serializing_if = "Option::is_none")]
4047    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
4048}
4049impl CreatePaymentIntentPaymentMethodOptionsBillie {
4050    pub fn new() -> Self {
4051        Self { capture_method: None }
4052    }
4053}
4054impl Default for CreatePaymentIntentPaymentMethodOptionsBillie {
4055    fn default() -> Self {
4056        Self::new()
4057    }
4058}
4059/// Controls when the funds are captured from the customer's account.
4060///
4061/// 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.
4062///
4063/// 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.
4064#[derive(Copy, Clone, Eq, PartialEq)]
4065pub enum CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4066    Manual,
4067}
4068impl CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4069    pub fn as_str(self) -> &'static str {
4070        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
4071        match self {
4072            Manual => "manual",
4073        }
4074    }
4075}
4076
4077impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4078    type Err = stripe_types::StripeParseError;
4079    fn from_str(s: &str) -> Result<Self, Self::Err> {
4080        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
4081        match s {
4082            "manual" => Ok(Manual),
4083            _ => Err(stripe_types::StripeParseError),
4084        }
4085    }
4086}
4087impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4088    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4089        f.write_str(self.as_str())
4090    }
4091}
4092
4093impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4094    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4095        f.write_str(self.as_str())
4096    }
4097}
4098impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4099    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4100    where
4101        S: serde::Serializer,
4102    {
4103        serializer.serialize_str(self.as_str())
4104    }
4105}
4106#[cfg(feature = "deserialize")]
4107impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4108    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4109        use std::str::FromStr;
4110        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4111        Self::from_str(&s).map_err(|_| {
4112            serde::de::Error::custom(
4113                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod",
4114            )
4115        })
4116    }
4117}
4118/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
4119#[derive(Clone, Debug, serde::Serialize)]
4120pub struct CreatePaymentIntentPaymentMethodOptionsBlik {
4121    /// The 6-digit BLIK code that a customer has generated using their banking application.
4122    /// Can only be set on confirmation.
4123    #[serde(skip_serializing_if = "Option::is_none")]
4124    pub code: Option<String>,
4125    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4126    ///
4127    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4128    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4129    ///
4130    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4131    ///
4132    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4133    ///
4134    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4135    #[serde(skip_serializing_if = "Option::is_none")]
4136    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
4137}
4138impl CreatePaymentIntentPaymentMethodOptionsBlik {
4139    pub fn new() -> Self {
4140        Self { code: None, setup_future_usage: None }
4141    }
4142}
4143impl Default for CreatePaymentIntentPaymentMethodOptionsBlik {
4144    fn default() -> Self {
4145        Self::new()
4146    }
4147}
4148/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4149///
4150/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4151/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4152///
4153/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4154///
4155/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4156///
4157/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4158#[derive(Copy, Clone, Eq, PartialEq)]
4159pub enum CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4160    None,
4161}
4162impl CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4163    pub fn as_str(self) -> &'static str {
4164        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
4165        match self {
4166            None => "none",
4167        }
4168    }
4169}
4170
4171impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4172    type Err = stripe_types::StripeParseError;
4173    fn from_str(s: &str) -> Result<Self, Self::Err> {
4174        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
4175        match s {
4176            "none" => Ok(None),
4177            _ => Err(stripe_types::StripeParseError),
4178        }
4179    }
4180}
4181impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4182    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4183        f.write_str(self.as_str())
4184    }
4185}
4186
4187impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4188    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4189        f.write_str(self.as_str())
4190    }
4191}
4192impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4193    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4194    where
4195        S: serde::Serializer,
4196    {
4197        serializer.serialize_str(self.as_str())
4198    }
4199}
4200#[cfg(feature = "deserialize")]
4201impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4202    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4203        use std::str::FromStr;
4204        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4205        Self::from_str(&s).map_err(|_| {
4206            serde::de::Error::custom(
4207                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
4208            )
4209        })
4210    }
4211}
4212/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
4213#[derive(Copy, Clone, Debug, serde::Serialize)]
4214pub struct CreatePaymentIntentPaymentMethodOptionsBoleto {
4215    /// The number of calendar days before a Boleto voucher expires.
4216    /// 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.
4217    #[serde(skip_serializing_if = "Option::is_none")]
4218    pub expires_after_days: Option<u32>,
4219    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4220    ///
4221    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4222    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4223    ///
4224    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4225    ///
4226    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4227    ///
4228    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4229    #[serde(skip_serializing_if = "Option::is_none")]
4230    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
4231}
4232impl CreatePaymentIntentPaymentMethodOptionsBoleto {
4233    pub fn new() -> Self {
4234        Self { expires_after_days: None, setup_future_usage: None }
4235    }
4236}
4237impl Default for CreatePaymentIntentPaymentMethodOptionsBoleto {
4238    fn default() -> Self {
4239        Self::new()
4240    }
4241}
4242/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4243///
4244/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4245/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4246///
4247/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4248///
4249/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4250///
4251/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4252#[derive(Copy, Clone, Eq, PartialEq)]
4253pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4254    None,
4255    OffSession,
4256    OnSession,
4257}
4258impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4259    pub fn as_str(self) -> &'static str {
4260        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
4261        match self {
4262            None => "none",
4263            OffSession => "off_session",
4264            OnSession => "on_session",
4265        }
4266    }
4267}
4268
4269impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4270    type Err = stripe_types::StripeParseError;
4271    fn from_str(s: &str) -> Result<Self, Self::Err> {
4272        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
4273        match s {
4274            "none" => Ok(None),
4275            "off_session" => Ok(OffSession),
4276            "on_session" => Ok(OnSession),
4277            _ => Err(stripe_types::StripeParseError),
4278        }
4279    }
4280}
4281impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4283        f.write_str(self.as_str())
4284    }
4285}
4286
4287impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4289        f.write_str(self.as_str())
4290    }
4291}
4292impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4293    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4294    where
4295        S: serde::Serializer,
4296    {
4297        serializer.serialize_str(self.as_str())
4298    }
4299}
4300#[cfg(feature = "deserialize")]
4301impl<'de> serde::Deserialize<'de>
4302    for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
4303{
4304    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4305        use std::str::FromStr;
4306        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4307        Self::from_str(&s).map_err(|_| {
4308            serde::de::Error::custom(
4309                "Unknown value for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
4310            )
4311        })
4312    }
4313}
4314/// Configuration for any card payments attempted on this PaymentIntent.
4315#[derive(Clone, Debug, serde::Serialize)]
4316pub struct CreatePaymentIntentPaymentMethodOptionsCard {
4317    /// Controls when the funds are captured from the customer's account.
4318    ///
4319    /// 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.
4320    ///
4321    /// 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.
4322    #[serde(skip_serializing_if = "Option::is_none")]
4323    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
4324    /// A single-use `cvc_update` Token that represents a card CVC value.
4325    /// When provided, the CVC value will be verified during the card payment attempt.
4326    /// This parameter can only be provided during confirmation.
4327    #[serde(skip_serializing_if = "Option::is_none")]
4328    pub cvc_token: Option<String>,
4329    /// Installment configuration for payments attempted on this PaymentIntent.
4330    ///
4331    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4332    #[serde(skip_serializing_if = "Option::is_none")]
4333    pub installments: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallments>,
4334    /// Configuration options for setting up an eMandate for cards issued in India.
4335    #[serde(skip_serializing_if = "Option::is_none")]
4336    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
4337    /// When specified, this parameter indicates that a transaction will be marked
4338    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
4339    /// parameter can only be provided during confirmation.
4340    #[serde(skip_serializing_if = "Option::is_none")]
4341    pub moto: Option<bool>,
4342    /// Selected network to process this PaymentIntent on.
4343    /// Depends on the available networks of the card attached to the PaymentIntent.
4344    /// Can be only set confirm-time.
4345    #[serde(skip_serializing_if = "Option::is_none")]
4346    pub network: Option<CreatePaymentIntentPaymentMethodOptionsCardNetwork>,
4347    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4348    #[serde(skip_serializing_if = "Option::is_none")]
4349    pub request_extended_authorization:
4350        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
4351    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
4352    #[serde(skip_serializing_if = "Option::is_none")]
4353    pub request_incremental_authorization:
4354        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
4355    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
4356    #[serde(skip_serializing_if = "Option::is_none")]
4357    pub request_multicapture:
4358        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
4359    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
4360    #[serde(skip_serializing_if = "Option::is_none")]
4361    pub request_overcapture: Option<CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
4362    /// 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).
4363    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
4364    /// If not provided, this value defaults to `automatic`.
4365    /// 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.
4366    #[serde(skip_serializing_if = "Option::is_none")]
4367    pub request_three_d_secure:
4368        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
4369    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
4370    /// using the cvc_token parameter).
4371    #[serde(skip_serializing_if = "Option::is_none")]
4372    pub require_cvc_recollection: Option<bool>,
4373    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4374    ///
4375    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4376    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4377    ///
4378    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4379    ///
4380    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4381    ///
4382    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4383    #[serde(skip_serializing_if = "Option::is_none")]
4384    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
4385    /// Provides information about a card payment that customers see on their statements.
4386    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
4387    /// Maximum 22 characters.
4388    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
4389    #[serde(skip_serializing_if = "Option::is_none")]
4390    pub statement_descriptor_suffix_kana: Option<String>,
4391    /// Provides information about a card payment that customers see on their statements.
4392    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
4393    /// Maximum 17 characters.
4394    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
4395    #[serde(skip_serializing_if = "Option::is_none")]
4396    pub statement_descriptor_suffix_kanji: Option<String>,
4397    /// If 3D Secure authentication was performed with a third-party provider,
4398    /// the authentication details to use for this payment.
4399    #[serde(skip_serializing_if = "Option::is_none")]
4400    pub three_d_secure: Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
4401}
4402impl CreatePaymentIntentPaymentMethodOptionsCard {
4403    pub fn new() -> Self {
4404        Self {
4405            capture_method: None,
4406            cvc_token: None,
4407            installments: None,
4408            mandate_options: None,
4409            moto: None,
4410            network: None,
4411            request_extended_authorization: None,
4412            request_incremental_authorization: None,
4413            request_multicapture: None,
4414            request_overcapture: None,
4415            request_three_d_secure: None,
4416            require_cvc_recollection: None,
4417            setup_future_usage: None,
4418            statement_descriptor_suffix_kana: None,
4419            statement_descriptor_suffix_kanji: None,
4420            three_d_secure: None,
4421        }
4422    }
4423}
4424impl Default for CreatePaymentIntentPaymentMethodOptionsCard {
4425    fn default() -> Self {
4426        Self::new()
4427    }
4428}
4429/// Controls when the funds are captured from the customer's account.
4430///
4431/// 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.
4432///
4433/// 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.
4434#[derive(Copy, Clone, Eq, PartialEq)]
4435pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4436    Manual,
4437}
4438impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4439    pub fn as_str(self) -> &'static str {
4440        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4441        match self {
4442            Manual => "manual",
4443        }
4444    }
4445}
4446
4447impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4448    type Err = stripe_types::StripeParseError;
4449    fn from_str(s: &str) -> Result<Self, Self::Err> {
4450        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4451        match s {
4452            "manual" => Ok(Manual),
4453            _ => Err(stripe_types::StripeParseError),
4454        }
4455    }
4456}
4457impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4458    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4459        f.write_str(self.as_str())
4460    }
4461}
4462
4463impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4464    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4465        f.write_str(self.as_str())
4466    }
4467}
4468impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4469    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4470    where
4471        S: serde::Serializer,
4472    {
4473        serializer.serialize_str(self.as_str())
4474    }
4475}
4476#[cfg(feature = "deserialize")]
4477impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4478    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4479        use std::str::FromStr;
4480        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4481        Self::from_str(&s).map_err(|_| {
4482            serde::de::Error::custom(
4483                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod",
4484            )
4485        })
4486    }
4487}
4488/// Installment configuration for payments attempted on this PaymentIntent.
4489///
4490/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4491#[derive(Copy, Clone, Debug, serde::Serialize)]
4492pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4493    /// Setting to true enables installments for this PaymentIntent.
4494    /// This will cause the response to contain a list of available installment plans.
4495    /// Setting to false will prevent any selected plan from applying to a charge.
4496    #[serde(skip_serializing_if = "Option::is_none")]
4497    pub enabled: Option<bool>,
4498    /// The selected installment plan to use for this payment attempt.
4499    /// This parameter can only be provided during confirmation.
4500    #[serde(skip_serializing_if = "Option::is_none")]
4501    pub plan: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
4502}
4503impl CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4504    pub fn new() -> Self {
4505        Self { enabled: None, plan: None }
4506    }
4507}
4508impl Default for CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4509    fn default() -> Self {
4510        Self::new()
4511    }
4512}
4513/// The selected installment plan to use for this payment attempt.
4514/// This parameter can only be provided during confirmation.
4515#[derive(Copy, Clone, Debug, serde::Serialize)]
4516pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4517    /// For `fixed_count` installment plans, this is required.
4518    /// It represents the number of installment payments your customer will make to their credit card.
4519    #[serde(skip_serializing_if = "Option::is_none")]
4520    pub count: Option<u64>,
4521    /// For `fixed_count` installment plans, this is required.
4522    /// It represents the interval between installment payments your customer will make to their credit card.
4523    /// One of `month`.
4524    #[serde(skip_serializing_if = "Option::is_none")]
4525    pub interval: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
4526    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4527    #[serde(rename = "type")]
4528    pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
4529}
4530impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4531    pub fn new(
4532        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
4533    ) -> Self {
4534        Self { count: None, interval: None, type_: type_.into() }
4535    }
4536}
4537/// For `fixed_count` installment plans, this is required.
4538/// It represents the interval between installment payments your customer will make to their credit card.
4539/// One of `month`.
4540#[derive(Copy, Clone, Eq, PartialEq)]
4541pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4542    Month,
4543}
4544impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4545    pub fn as_str(self) -> &'static str {
4546        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4547        match self {
4548            Month => "month",
4549        }
4550    }
4551}
4552
4553impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4554    type Err = stripe_types::StripeParseError;
4555    fn from_str(s: &str) -> Result<Self, Self::Err> {
4556        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4557        match s {
4558            "month" => Ok(Month),
4559            _ => Err(stripe_types::StripeParseError),
4560        }
4561    }
4562}
4563impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4564    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4565        f.write_str(self.as_str())
4566    }
4567}
4568
4569impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4571        f.write_str(self.as_str())
4572    }
4573}
4574impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4575    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4576    where
4577        S: serde::Serializer,
4578    {
4579        serializer.serialize_str(self.as_str())
4580    }
4581}
4582#[cfg(feature = "deserialize")]
4583impl<'de> serde::Deserialize<'de>
4584    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
4585{
4586    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4587        use std::str::FromStr;
4588        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4589        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
4590    }
4591}
4592/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4593#[derive(Copy, Clone, Eq, PartialEq)]
4594pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4595    Bonus,
4596    FixedCount,
4597    Revolving,
4598}
4599impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4600    pub fn as_str(self) -> &'static str {
4601        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4602        match self {
4603            Bonus => "bonus",
4604            FixedCount => "fixed_count",
4605            Revolving => "revolving",
4606        }
4607    }
4608}
4609
4610impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4611    type Err = stripe_types::StripeParseError;
4612    fn from_str(s: &str) -> Result<Self, Self::Err> {
4613        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4614        match s {
4615            "bonus" => Ok(Bonus),
4616            "fixed_count" => Ok(FixedCount),
4617            "revolving" => Ok(Revolving),
4618            _ => Err(stripe_types::StripeParseError),
4619        }
4620    }
4621}
4622impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4623    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4624        f.write_str(self.as_str())
4625    }
4626}
4627
4628impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4629    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4630        f.write_str(self.as_str())
4631    }
4632}
4633impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4634    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4635    where
4636        S: serde::Serializer,
4637    {
4638        serializer.serialize_str(self.as_str())
4639    }
4640}
4641#[cfg(feature = "deserialize")]
4642impl<'de> serde::Deserialize<'de>
4643    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
4644{
4645    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4646        use std::str::FromStr;
4647        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4648        Self::from_str(&s).map_err(|_| {
4649            serde::de::Error::custom(
4650                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType",
4651            )
4652        })
4653    }
4654}
4655/// Configuration options for setting up an eMandate for cards issued in India.
4656#[derive(Clone, Debug, serde::Serialize)]
4657pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4658    /// Amount to be charged for future payments.
4659    pub amount: i64,
4660    /// One of `fixed` or `maximum`.
4661    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4662    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4663    pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
4664    /// A description of the mandate or subscription that is meant to be displayed to the customer.
4665    #[serde(skip_serializing_if = "Option::is_none")]
4666    pub description: Option<String>,
4667    /// End date of the mandate or subscription.
4668    /// If not provided, the mandate will be active until canceled.
4669    /// If provided, end date should be after start date.
4670    #[serde(skip_serializing_if = "Option::is_none")]
4671    pub end_date: Option<stripe_types::Timestamp>,
4672    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4673    pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
4674    /// The number of intervals between payments.
4675    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
4676    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
4677    /// This parameter is optional when `interval=sporadic`.
4678    #[serde(skip_serializing_if = "Option::is_none")]
4679    pub interval_count: Option<u64>,
4680    /// Unique identifier for the mandate or subscription.
4681    pub reference: String,
4682    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
4683    pub start_date: stripe_types::Timestamp,
4684    /// Specifies the type of mandates supported. Possible values are `india`.
4685    #[serde(skip_serializing_if = "Option::is_none")]
4686    pub supported_types:
4687        Option<Vec<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
4688}
4689impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4690    pub fn new(
4691        amount: impl Into<i64>,
4692        amount_type: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
4693        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
4694        reference: impl Into<String>,
4695        start_date: impl Into<stripe_types::Timestamp>,
4696    ) -> Self {
4697        Self {
4698            amount: amount.into(),
4699            amount_type: amount_type.into(),
4700            description: None,
4701            end_date: None,
4702            interval: interval.into(),
4703            interval_count: None,
4704            reference: reference.into(),
4705            start_date: start_date.into(),
4706            supported_types: None,
4707        }
4708    }
4709}
4710/// One of `fixed` or `maximum`.
4711/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4712/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4713#[derive(Copy, Clone, Eq, PartialEq)]
4714pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4715    Fixed,
4716    Maximum,
4717}
4718impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4719    pub fn as_str(self) -> &'static str {
4720        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
4721        match self {
4722            Fixed => "fixed",
4723            Maximum => "maximum",
4724        }
4725    }
4726}
4727
4728impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4729    type Err = stripe_types::StripeParseError;
4730    fn from_str(s: &str) -> Result<Self, Self::Err> {
4731        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
4732        match s {
4733            "fixed" => Ok(Fixed),
4734            "maximum" => Ok(Maximum),
4735            _ => Err(stripe_types::StripeParseError),
4736        }
4737    }
4738}
4739impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4741        f.write_str(self.as_str())
4742    }
4743}
4744
4745impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4746    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4747        f.write_str(self.as_str())
4748    }
4749}
4750impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
4751    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4752    where
4753        S: serde::Serializer,
4754    {
4755        serializer.serialize_str(self.as_str())
4756    }
4757}
4758#[cfg(feature = "deserialize")]
4759impl<'de> serde::Deserialize<'de>
4760    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
4761{
4762    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4763        use std::str::FromStr;
4764        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4765        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
4766    }
4767}
4768/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4769#[derive(Copy, Clone, Eq, PartialEq)]
4770pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4771    Day,
4772    Month,
4773    Sporadic,
4774    Week,
4775    Year,
4776}
4777impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4778    pub fn as_str(self) -> &'static str {
4779        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
4780        match self {
4781            Day => "day",
4782            Month => "month",
4783            Sporadic => "sporadic",
4784            Week => "week",
4785            Year => "year",
4786        }
4787    }
4788}
4789
4790impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4791    type Err = stripe_types::StripeParseError;
4792    fn from_str(s: &str) -> Result<Self, Self::Err> {
4793        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
4794        match s {
4795            "day" => Ok(Day),
4796            "month" => Ok(Month),
4797            "sporadic" => Ok(Sporadic),
4798            "week" => Ok(Week),
4799            "year" => Ok(Year),
4800            _ => Err(stripe_types::StripeParseError),
4801        }
4802    }
4803}
4804impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4806        f.write_str(self.as_str())
4807    }
4808}
4809
4810impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4812        f.write_str(self.as_str())
4813    }
4814}
4815impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
4816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4817    where
4818        S: serde::Serializer,
4819    {
4820        serializer.serialize_str(self.as_str())
4821    }
4822}
4823#[cfg(feature = "deserialize")]
4824impl<'de> serde::Deserialize<'de>
4825    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
4826{
4827    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4828        use std::str::FromStr;
4829        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4830        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
4831    }
4832}
4833/// Specifies the type of mandates supported. Possible values are `india`.
4834#[derive(Copy, Clone, Eq, PartialEq)]
4835pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4836    India,
4837}
4838impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4839    pub fn as_str(self) -> &'static str {
4840        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
4841        match self {
4842            India => "india",
4843        }
4844    }
4845}
4846
4847impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4848    type Err = stripe_types::StripeParseError;
4849    fn from_str(s: &str) -> Result<Self, Self::Err> {
4850        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
4851        match s {
4852            "india" => Ok(India),
4853            _ => Err(stripe_types::StripeParseError),
4854        }
4855    }
4856}
4857impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4858    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4859        f.write_str(self.as_str())
4860    }
4861}
4862
4863impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4865        f.write_str(self.as_str())
4866    }
4867}
4868impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
4869    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4870    where
4871        S: serde::Serializer,
4872    {
4873        serializer.serialize_str(self.as_str())
4874    }
4875}
4876#[cfg(feature = "deserialize")]
4877impl<'de> serde::Deserialize<'de>
4878    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
4879{
4880    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4881        use std::str::FromStr;
4882        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4883        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
4884    }
4885}
4886/// Selected network to process this PaymentIntent on.
4887/// Depends on the available networks of the card attached to the PaymentIntent.
4888/// Can be only set confirm-time.
4889#[derive(Copy, Clone, Eq, PartialEq)]
4890pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4891    Amex,
4892    CartesBancaires,
4893    Diners,
4894    Discover,
4895    EftposAu,
4896    Girocard,
4897    Interac,
4898    Jcb,
4899    Link,
4900    Mastercard,
4901    Unionpay,
4902    Unknown,
4903    Visa,
4904}
4905impl CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4906    pub fn as_str(self) -> &'static str {
4907        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
4908        match self {
4909            Amex => "amex",
4910            CartesBancaires => "cartes_bancaires",
4911            Diners => "diners",
4912            Discover => "discover",
4913            EftposAu => "eftpos_au",
4914            Girocard => "girocard",
4915            Interac => "interac",
4916            Jcb => "jcb",
4917            Link => "link",
4918            Mastercard => "mastercard",
4919            Unionpay => "unionpay",
4920            Unknown => "unknown",
4921            Visa => "visa",
4922        }
4923    }
4924}
4925
4926impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4927    type Err = stripe_types::StripeParseError;
4928    fn from_str(s: &str) -> Result<Self, Self::Err> {
4929        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
4930        match s {
4931            "amex" => Ok(Amex),
4932            "cartes_bancaires" => Ok(CartesBancaires),
4933            "diners" => Ok(Diners),
4934            "discover" => Ok(Discover),
4935            "eftpos_au" => Ok(EftposAu),
4936            "girocard" => Ok(Girocard),
4937            "interac" => Ok(Interac),
4938            "jcb" => Ok(Jcb),
4939            "link" => Ok(Link),
4940            "mastercard" => Ok(Mastercard),
4941            "unionpay" => Ok(Unionpay),
4942            "unknown" => Ok(Unknown),
4943            "visa" => Ok(Visa),
4944            _ => Err(stripe_types::StripeParseError),
4945        }
4946    }
4947}
4948impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4949    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4950        f.write_str(self.as_str())
4951    }
4952}
4953
4954impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4956        f.write_str(self.as_str())
4957    }
4958}
4959impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4960    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4961    where
4962        S: serde::Serializer,
4963    {
4964        serializer.serialize_str(self.as_str())
4965    }
4966}
4967#[cfg(feature = "deserialize")]
4968impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
4969    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4970        use std::str::FromStr;
4971        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4972        Self::from_str(&s).map_err(|_| {
4973            serde::de::Error::custom(
4974                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardNetwork",
4975            )
4976        })
4977    }
4978}
4979/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4980#[derive(Copy, Clone, Eq, PartialEq)]
4981pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4982    IfAvailable,
4983    Never,
4984}
4985impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4986    pub fn as_str(self) -> &'static str {
4987        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
4988        match self {
4989            IfAvailable => "if_available",
4990            Never => "never",
4991        }
4992    }
4993}
4994
4995impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
4996    type Err = stripe_types::StripeParseError;
4997    fn from_str(s: &str) -> Result<Self, Self::Err> {
4998        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
4999        match s {
5000            "if_available" => Ok(IfAvailable),
5001            "never" => Ok(Never),
5002            _ => Err(stripe_types::StripeParseError),
5003        }
5004    }
5005}
5006impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5007    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5008        f.write_str(self.as_str())
5009    }
5010}
5011
5012impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5013    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5014        f.write_str(self.as_str())
5015    }
5016}
5017impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5018    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5019    where
5020        S: serde::Serializer,
5021    {
5022        serializer.serialize_str(self.as_str())
5023    }
5024}
5025#[cfg(feature = "deserialize")]
5026impl<'de> serde::Deserialize<'de>
5027    for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
5028{
5029    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5030        use std::str::FromStr;
5031        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5032        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
5033    }
5034}
5035/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
5036#[derive(Copy, Clone, Eq, PartialEq)]
5037pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
5038    IfAvailable,
5039    Never,
5040}
5041impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
5042    pub fn as_str(self) -> &'static str {
5043        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
5044        match self {
5045            IfAvailable => "if_available",
5046            Never => "never",
5047        }
5048    }
5049}
5050
5051impl std::str::FromStr
5052    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5053{
5054    type Err = stripe_types::StripeParseError;
5055    fn from_str(s: &str) -> Result<Self, Self::Err> {
5056        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
5057        match s {
5058            "if_available" => Ok(IfAvailable),
5059            "never" => Ok(Never),
5060            _ => Err(stripe_types::StripeParseError),
5061        }
5062    }
5063}
5064impl std::fmt::Display
5065    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5066{
5067    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5068        f.write_str(self.as_str())
5069    }
5070}
5071
5072impl std::fmt::Debug
5073    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5074{
5075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5076        f.write_str(self.as_str())
5077    }
5078}
5079impl serde::Serialize
5080    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5081{
5082    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5083    where
5084        S: serde::Serializer,
5085    {
5086        serializer.serialize_str(self.as_str())
5087    }
5088}
5089#[cfg(feature = "deserialize")]
5090impl<'de> serde::Deserialize<'de>
5091    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5092{
5093    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5094        use std::str::FromStr;
5095        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5096        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
5097    }
5098}
5099/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
5100#[derive(Copy, Clone, Eq, PartialEq)]
5101pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5102    IfAvailable,
5103    Never,
5104}
5105impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5106    pub fn as_str(self) -> &'static str {
5107        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
5108        match self {
5109            IfAvailable => "if_available",
5110            Never => "never",
5111        }
5112    }
5113}
5114
5115impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5116    type Err = stripe_types::StripeParseError;
5117    fn from_str(s: &str) -> Result<Self, Self::Err> {
5118        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
5119        match s {
5120            "if_available" => Ok(IfAvailable),
5121            "never" => Ok(Never),
5122            _ => Err(stripe_types::StripeParseError),
5123        }
5124    }
5125}
5126impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5127    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5128        f.write_str(self.as_str())
5129    }
5130}
5131
5132impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5133    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5134        f.write_str(self.as_str())
5135    }
5136}
5137impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5138    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5139    where
5140        S: serde::Serializer,
5141    {
5142        serializer.serialize_str(self.as_str())
5143    }
5144}
5145#[cfg(feature = "deserialize")]
5146impl<'de> serde::Deserialize<'de>
5147    for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
5148{
5149    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5150        use std::str::FromStr;
5151        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5152        Self::from_str(&s).map_err(|_| {
5153            serde::de::Error::custom(
5154                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture",
5155            )
5156        })
5157    }
5158}
5159/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
5160#[derive(Copy, Clone, Eq, PartialEq)]
5161pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5162    IfAvailable,
5163    Never,
5164}
5165impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5166    pub fn as_str(self) -> &'static str {
5167        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
5168        match self {
5169            IfAvailable => "if_available",
5170            Never => "never",
5171        }
5172    }
5173}
5174
5175impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5176    type Err = stripe_types::StripeParseError;
5177    fn from_str(s: &str) -> Result<Self, Self::Err> {
5178        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
5179        match s {
5180            "if_available" => Ok(IfAvailable),
5181            "never" => Ok(Never),
5182            _ => Err(stripe_types::StripeParseError),
5183        }
5184    }
5185}
5186impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5187    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5188        f.write_str(self.as_str())
5189    }
5190}
5191
5192impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5193    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5194        f.write_str(self.as_str())
5195    }
5196}
5197impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5198    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5199    where
5200        S: serde::Serializer,
5201    {
5202        serializer.serialize_str(self.as_str())
5203    }
5204}
5205#[cfg(feature = "deserialize")]
5206impl<'de> serde::Deserialize<'de>
5207    for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
5208{
5209    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5210        use std::str::FromStr;
5211        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5212        Self::from_str(&s).map_err(|_| {
5213            serde::de::Error::custom(
5214                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture",
5215            )
5216        })
5217    }
5218}
5219/// 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).
5220/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
5221/// If not provided, this value defaults to `automatic`.
5222/// 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.
5223#[derive(Copy, Clone, Eq, PartialEq)]
5224pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5225    Any,
5226    Automatic,
5227    Challenge,
5228}
5229impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5230    pub fn as_str(self) -> &'static str {
5231        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
5232        match self {
5233            Any => "any",
5234            Automatic => "automatic",
5235            Challenge => "challenge",
5236        }
5237    }
5238}
5239
5240impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5241    type Err = stripe_types::StripeParseError;
5242    fn from_str(s: &str) -> Result<Self, Self::Err> {
5243        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
5244        match s {
5245            "any" => Ok(Any),
5246            "automatic" => Ok(Automatic),
5247            "challenge" => Ok(Challenge),
5248            _ => Err(stripe_types::StripeParseError),
5249        }
5250    }
5251}
5252impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5253    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5254        f.write_str(self.as_str())
5255    }
5256}
5257
5258impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5260        f.write_str(self.as_str())
5261    }
5262}
5263impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5264    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5265    where
5266        S: serde::Serializer,
5267    {
5268        serializer.serialize_str(self.as_str())
5269    }
5270}
5271#[cfg(feature = "deserialize")]
5272impl<'de> serde::Deserialize<'de>
5273    for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
5274{
5275    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5276        use std::str::FromStr;
5277        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5278        Self::from_str(&s).map_err(|_| {
5279            serde::de::Error::custom(
5280                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
5281            )
5282        })
5283    }
5284}
5285/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5286///
5287/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5288/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5289///
5290/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5291///
5292/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5293///
5294/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
5295#[derive(Copy, Clone, Eq, PartialEq)]
5296pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5297    None,
5298    OffSession,
5299    OnSession,
5300}
5301impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5302    pub fn as_str(self) -> &'static str {
5303        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5304        match self {
5305            None => "none",
5306            OffSession => "off_session",
5307            OnSession => "on_session",
5308        }
5309    }
5310}
5311
5312impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5313    type Err = stripe_types::StripeParseError;
5314    fn from_str(s: &str) -> Result<Self, Self::Err> {
5315        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5316        match s {
5317            "none" => Ok(None),
5318            "off_session" => Ok(OffSession),
5319            "on_session" => Ok(OnSession),
5320            _ => Err(stripe_types::StripeParseError),
5321        }
5322    }
5323}
5324impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5325    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5326        f.write_str(self.as_str())
5327    }
5328}
5329
5330impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5331    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5332        f.write_str(self.as_str())
5333    }
5334}
5335impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5336    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5337    where
5338        S: serde::Serializer,
5339    {
5340        serializer.serialize_str(self.as_str())
5341    }
5342}
5343#[cfg(feature = "deserialize")]
5344impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5345    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5346        use std::str::FromStr;
5347        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5348        Self::from_str(&s).map_err(|_| {
5349            serde::de::Error::custom(
5350                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
5351            )
5352        })
5353    }
5354}
5355/// If 3D Secure authentication was performed with a third-party provider,
5356/// the authentication details to use for this payment.
5357#[derive(Clone, Debug, serde::Serialize)]
5358pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5359    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5360    #[serde(skip_serializing_if = "Option::is_none")]
5361    pub ares_trans_status:
5362        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
5363    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
5364    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
5365    /// (Most 3D Secure providers will return the base64-encoded version, which
5366    /// is what you should specify here.)
5367    pub cryptogram: String,
5368    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5369    /// provider and indicates what degree of authentication was performed.
5370    #[serde(skip_serializing_if = "Option::is_none")]
5371    pub electronic_commerce_indicator:
5372        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
5373    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
5374    #[serde(skip_serializing_if = "Option::is_none")]
5375    pub exemption_indicator:
5376        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
5377    /// Network specific 3DS fields. Network specific arguments require an
5378    /// explicit card brand choice. The parameter `payment_method_options.card.network``
5379    /// must be populated accordingly
5380    #[serde(skip_serializing_if = "Option::is_none")]
5381    pub network_options:
5382        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
5383    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
5384    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
5385    #[serde(skip_serializing_if = "Option::is_none")]
5386    pub requestor_challenge_indicator: Option<String>,
5387    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
5388    /// Transaction ID (dsTransID).
5389    pub transaction_id: String,
5390    /// The version of 3D Secure that was performed.
5391    pub version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
5392}
5393impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5394    pub fn new(
5395        cryptogram: impl Into<String>,
5396        transaction_id: impl Into<String>,
5397        version: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
5398    ) -> Self {
5399        Self {
5400            ares_trans_status: None,
5401            cryptogram: cryptogram.into(),
5402            electronic_commerce_indicator: None,
5403            exemption_indicator: None,
5404            network_options: None,
5405            requestor_challenge_indicator: None,
5406            transaction_id: transaction_id.into(),
5407            version: version.into(),
5408        }
5409    }
5410}
5411/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5412#[derive(Copy, Clone, Eq, PartialEq)]
5413pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5414    A,
5415    C,
5416    I,
5417    N,
5418    R,
5419    U,
5420    Y,
5421}
5422impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5423    pub fn as_str(self) -> &'static str {
5424        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5425        match self {
5426            A => "A",
5427            C => "C",
5428            I => "I",
5429            N => "N",
5430            R => "R",
5431            U => "U",
5432            Y => "Y",
5433        }
5434    }
5435}
5436
5437impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5438    type Err = stripe_types::StripeParseError;
5439    fn from_str(s: &str) -> Result<Self, Self::Err> {
5440        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5441        match s {
5442            "A" => Ok(A),
5443            "C" => Ok(C),
5444            "I" => Ok(I),
5445            "N" => Ok(N),
5446            "R" => Ok(R),
5447            "U" => Ok(U),
5448            "Y" => Ok(Y),
5449            _ => Err(stripe_types::StripeParseError),
5450        }
5451    }
5452}
5453impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5454    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5455        f.write_str(self.as_str())
5456    }
5457}
5458
5459impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5460    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5461        f.write_str(self.as_str())
5462    }
5463}
5464impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5465    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5466    where
5467        S: serde::Serializer,
5468    {
5469        serializer.serialize_str(self.as_str())
5470    }
5471}
5472#[cfg(feature = "deserialize")]
5473impl<'de> serde::Deserialize<'de>
5474    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
5475{
5476    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5477        use std::str::FromStr;
5478        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5479        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
5480    }
5481}
5482/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5483/// provider and indicates what degree of authentication was performed.
5484#[derive(Copy, Clone, Eq, PartialEq)]
5485pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5486    V01,
5487    V02,
5488    V05,
5489    V06,
5490    V07,
5491}
5492impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5493    pub fn as_str(self) -> &'static str {
5494        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5495        match self {
5496            V01 => "01",
5497            V02 => "02",
5498            V05 => "05",
5499            V06 => "06",
5500            V07 => "07",
5501        }
5502    }
5503}
5504
5505impl std::str::FromStr
5506    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5507{
5508    type Err = stripe_types::StripeParseError;
5509    fn from_str(s: &str) -> Result<Self, Self::Err> {
5510        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5511        match s {
5512            "01" => Ok(V01),
5513            "02" => Ok(V02),
5514            "05" => Ok(V05),
5515            "06" => Ok(V06),
5516            "07" => Ok(V07),
5517            _ => Err(stripe_types::StripeParseError),
5518        }
5519    }
5520}
5521impl std::fmt::Display
5522    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5523{
5524    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5525        f.write_str(self.as_str())
5526    }
5527}
5528
5529impl std::fmt::Debug
5530    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5531{
5532    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5533        f.write_str(self.as_str())
5534    }
5535}
5536impl serde::Serialize
5537    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5538{
5539    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5540    where
5541        S: serde::Serializer,
5542    {
5543        serializer.serialize_str(self.as_str())
5544    }
5545}
5546#[cfg(feature = "deserialize")]
5547impl<'de> serde::Deserialize<'de>
5548    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5549{
5550    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5551        use std::str::FromStr;
5552        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5553        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
5554    }
5555}
5556/// The exemption requested via 3DS and accepted by the issuer at authentication time.
5557#[derive(Copy, Clone, Eq, PartialEq)]
5558pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5559    LowRisk,
5560    None,
5561}
5562impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5563    pub fn as_str(self) -> &'static str {
5564        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5565        match self {
5566            LowRisk => "low_risk",
5567            None => "none",
5568        }
5569    }
5570}
5571
5572impl std::str::FromStr
5573    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5574{
5575    type Err = stripe_types::StripeParseError;
5576    fn from_str(s: &str) -> Result<Self, Self::Err> {
5577        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5578        match s {
5579            "low_risk" => Ok(LowRisk),
5580            "none" => Ok(None),
5581            _ => Err(stripe_types::StripeParseError),
5582        }
5583    }
5584}
5585impl std::fmt::Display
5586    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5587{
5588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5589        f.write_str(self.as_str())
5590    }
5591}
5592
5593impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5595        f.write_str(self.as_str())
5596    }
5597}
5598impl serde::Serialize
5599    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5600{
5601    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5602    where
5603        S: serde::Serializer,
5604    {
5605        serializer.serialize_str(self.as_str())
5606    }
5607}
5608#[cfg(feature = "deserialize")]
5609impl<'de> serde::Deserialize<'de>
5610    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
5611{
5612    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5613        use std::str::FromStr;
5614        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5615        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
5616    }
5617}
5618/// Network specific 3DS fields. Network specific arguments require an
5619/// explicit card brand choice. The parameter `payment_method_options.card.network``
5620/// must be populated accordingly
5621#[derive(Clone, Debug, serde::Serialize)]
5622pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5623    /// Cartes Bancaires-specific 3DS fields.
5624    #[serde(skip_serializing_if = "Option::is_none")]
5625    pub cartes_bancaires: Option<
5626        CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
5627    >,
5628}
5629impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5630    pub fn new() -> Self {
5631        Self { cartes_bancaires: None }
5632    }
5633}
5634impl Default for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
5635    fn default() -> Self {
5636        Self::new()
5637    }
5638}
5639/// Cartes Bancaires-specific 3DS fields.
5640#[derive(Clone, Debug, serde::Serialize)]
5641pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
5642    /// The cryptogram calculation algorithm used by the card Issuer's ACS
5643    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
5644    /// messageExtension: CB-AVALGO
5645pub cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
5646    /// The exemption indicator returned from Cartes Bancaires in the ARes.
5647    /// message extension: CB-EXEMPTION; string (4 characters)
5648    /// This is a 3 byte bitmap (low significant byte first and most significant
5649    /// bit first) that has been Base64 encoded
5650#[serde(skip_serializing_if = "Option::is_none")]
5651pub cb_exemption: Option<String>,
5652    /// The risk score returned from Cartes Bancaires in the ARes.
5653    /// message extension: CB-SCORE; numeric value 0-99
5654#[serde(skip_serializing_if = "Option::is_none")]
5655pub cb_score: Option<i64>,
5656
5657}
5658impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
5659    pub fn new(
5660        cb_avalgo: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
5661    ) -> Self {
5662        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
5663    }
5664}
5665/// The cryptogram calculation algorithm used by the card Issuer's ACS
5666/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
5667/// messageExtension: CB-AVALGO
5668#[derive(Copy, Clone, Eq, PartialEq)]
5669pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5670{
5671    V0,
5672    V1,
5673    V2,
5674    V3,
5675    V4,
5676    A,
5677}
5678impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
5679    pub fn as_str(self) -> &'static str {
5680        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
5681        match self {
5682            V0 => "0",
5683            V1 => "1",
5684            V2 => "2",
5685            V3 => "3",
5686            V4 => "4",
5687            A => "A",
5688        }
5689    }
5690}
5691
5692impl std::str::FromStr
5693    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5694{
5695    type Err = stripe_types::StripeParseError;
5696    fn from_str(s: &str) -> Result<Self, Self::Err> {
5697        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
5698        match s {
5699            "0" => Ok(V0),
5700            "1" => Ok(V1),
5701            "2" => Ok(V2),
5702            "3" => Ok(V3),
5703            "4" => Ok(V4),
5704            "A" => Ok(A),
5705            _ => Err(stripe_types::StripeParseError),
5706        }
5707    }
5708}
5709impl std::fmt::Display
5710    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5711{
5712    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5713        f.write_str(self.as_str())
5714    }
5715}
5716
5717impl std::fmt::Debug
5718    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5719{
5720    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5721        f.write_str(self.as_str())
5722    }
5723}
5724impl serde::Serialize
5725    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5726{
5727    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5728    where
5729        S: serde::Serializer,
5730    {
5731        serializer.serialize_str(self.as_str())
5732    }
5733}
5734#[cfg(feature = "deserialize")]
5735impl<'de> serde::Deserialize<'de>
5736    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
5737{
5738    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5739        use std::str::FromStr;
5740        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5741        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
5742    }
5743}
5744/// The version of 3D Secure that was performed.
5745#[derive(Copy, Clone, Eq, PartialEq)]
5746pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5747    V1_0_2,
5748    V2_1_0,
5749    V2_2_0,
5750}
5751impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5752    pub fn as_str(self) -> &'static str {
5753        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
5754        match self {
5755            V1_0_2 => "1.0.2",
5756            V2_1_0 => "2.1.0",
5757            V2_2_0 => "2.2.0",
5758        }
5759    }
5760}
5761
5762impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5763    type Err = stripe_types::StripeParseError;
5764    fn from_str(s: &str) -> Result<Self, Self::Err> {
5765        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
5766        match s {
5767            "1.0.2" => Ok(V1_0_2),
5768            "2.1.0" => Ok(V2_1_0),
5769            "2.2.0" => Ok(V2_2_0),
5770            _ => Err(stripe_types::StripeParseError),
5771        }
5772    }
5773}
5774impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5775    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5776        f.write_str(self.as_str())
5777    }
5778}
5779
5780impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5781    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5782        f.write_str(self.as_str())
5783    }
5784}
5785impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
5786    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5787    where
5788        S: serde::Serializer,
5789    {
5790        serializer.serialize_str(self.as_str())
5791    }
5792}
5793#[cfg(feature = "deserialize")]
5794impl<'de> serde::Deserialize<'de>
5795    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
5796{
5797    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5798        use std::str::FromStr;
5799        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5800        Self::from_str(&s).map_err(|_| {
5801            serde::de::Error::custom(
5802                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
5803            )
5804        })
5805    }
5806}
5807/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
5808#[derive(Copy, Clone, Debug, serde::Serialize)]
5809pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent {
5810    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
5811    #[serde(skip_serializing_if = "Option::is_none")]
5812    pub request_extended_authorization: Option<bool>,
5813    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
5814    /// 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.
5815    #[serde(skip_serializing_if = "Option::is_none")]
5816    pub request_incremental_authorization_support: Option<bool>,
5817    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
5818    #[serde(skip_serializing_if = "Option::is_none")]
5819    pub routing: Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
5820}
5821impl CreatePaymentIntentPaymentMethodOptionsCardPresent {
5822    pub fn new() -> Self {
5823        Self {
5824            request_extended_authorization: None,
5825            request_incremental_authorization_support: None,
5826            routing: None,
5827        }
5828    }
5829}
5830impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresent {
5831    fn default() -> Self {
5832        Self::new()
5833    }
5834}
5835/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
5836#[derive(Copy, Clone, Debug, serde::Serialize)]
5837pub struct CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5838    /// Routing requested priority
5839    #[serde(skip_serializing_if = "Option::is_none")]
5840    pub requested_priority:
5841        Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
5842}
5843impl CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5844    pub fn new() -> Self {
5845        Self { requested_priority: None }
5846    }
5847}
5848impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
5849    fn default() -> Self {
5850        Self::new()
5851    }
5852}
5853/// Routing requested priority
5854#[derive(Copy, Clone, Eq, PartialEq)]
5855pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
5856    Domestic,
5857    International,
5858}
5859impl CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
5860    pub fn as_str(self) -> &'static str {
5861        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
5862        match self {
5863            Domestic => "domestic",
5864            International => "international",
5865        }
5866    }
5867}
5868
5869impl std::str::FromStr
5870    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5871{
5872    type Err = stripe_types::StripeParseError;
5873    fn from_str(s: &str) -> Result<Self, Self::Err> {
5874        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
5875        match s {
5876            "domestic" => Ok(Domestic),
5877            "international" => Ok(International),
5878            _ => Err(stripe_types::StripeParseError),
5879        }
5880    }
5881}
5882impl std::fmt::Display
5883    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5884{
5885    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5886        f.write_str(self.as_str())
5887    }
5888}
5889
5890impl std::fmt::Debug
5891    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5892{
5893    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5894        f.write_str(self.as_str())
5895    }
5896}
5897impl serde::Serialize
5898    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5899{
5900    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5901    where
5902        S: serde::Serializer,
5903    {
5904        serializer.serialize_str(self.as_str())
5905    }
5906}
5907#[cfg(feature = "deserialize")]
5908impl<'de> serde::Deserialize<'de>
5909    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
5910{
5911    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5912        use std::str::FromStr;
5913        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5914        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
5915    }
5916}
5917/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
5918#[derive(Copy, Clone, Debug, serde::Serialize)]
5919pub struct CreatePaymentIntentPaymentMethodOptionsCashapp {
5920    /// Controls when the funds are captured from the customer's account.
5921    ///
5922    /// 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.
5923    ///
5924    /// 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.
5925    #[serde(skip_serializing_if = "Option::is_none")]
5926    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
5927    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5928    ///
5929    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5930    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5931    ///
5932    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5933    ///
5934    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5935    ///
5936    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
5937    #[serde(skip_serializing_if = "Option::is_none")]
5938    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
5939}
5940impl CreatePaymentIntentPaymentMethodOptionsCashapp {
5941    pub fn new() -> Self {
5942        Self { capture_method: None, setup_future_usage: None }
5943    }
5944}
5945impl Default for CreatePaymentIntentPaymentMethodOptionsCashapp {
5946    fn default() -> Self {
5947        Self::new()
5948    }
5949}
5950/// Controls when the funds are captured from the customer's account.
5951///
5952/// 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.
5953///
5954/// 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.
5955#[derive(Copy, Clone, Eq, PartialEq)]
5956pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5957    Manual,
5958}
5959impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5960    pub fn as_str(self) -> &'static str {
5961        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
5962        match self {
5963            Manual => "manual",
5964        }
5965    }
5966}
5967
5968impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5969    type Err = stripe_types::StripeParseError;
5970    fn from_str(s: &str) -> Result<Self, Self::Err> {
5971        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
5972        match s {
5973            "manual" => Ok(Manual),
5974            _ => Err(stripe_types::StripeParseError),
5975        }
5976    }
5977}
5978impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5979    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5980        f.write_str(self.as_str())
5981    }
5982}
5983
5984impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5985    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5986        f.write_str(self.as_str())
5987    }
5988}
5989impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5990    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5991    where
5992        S: serde::Serializer,
5993    {
5994        serializer.serialize_str(self.as_str())
5995    }
5996}
5997#[cfg(feature = "deserialize")]
5998impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
5999    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6000        use std::str::FromStr;
6001        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6002        Self::from_str(&s).map_err(|_| {
6003            serde::de::Error::custom(
6004                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod",
6005            )
6006        })
6007    }
6008}
6009/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6010///
6011/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6012/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6013///
6014/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6015///
6016/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6017///
6018/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6019#[derive(Copy, Clone, Eq, PartialEq)]
6020pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6021    None,
6022    OffSession,
6023    OnSession,
6024}
6025impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6026    pub fn as_str(self) -> &'static str {
6027        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
6028        match self {
6029            None => "none",
6030            OffSession => "off_session",
6031            OnSession => "on_session",
6032        }
6033    }
6034}
6035
6036impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6037    type Err = stripe_types::StripeParseError;
6038    fn from_str(s: &str) -> Result<Self, Self::Err> {
6039        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
6040        match s {
6041            "none" => Ok(None),
6042            "off_session" => Ok(OffSession),
6043            "on_session" => Ok(OnSession),
6044            _ => Err(stripe_types::StripeParseError),
6045        }
6046    }
6047}
6048impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6050        f.write_str(self.as_str())
6051    }
6052}
6053
6054impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6055    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6056        f.write_str(self.as_str())
6057    }
6058}
6059impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6060    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6061    where
6062        S: serde::Serializer,
6063    {
6064        serializer.serialize_str(self.as_str())
6065    }
6066}
6067#[cfg(feature = "deserialize")]
6068impl<'de> serde::Deserialize<'de>
6069    for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
6070{
6071    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6072        use std::str::FromStr;
6073        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6074        Self::from_str(&s).map_err(|_| {
6075            serde::de::Error::custom(
6076                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
6077            )
6078        })
6079    }
6080}
6081/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
6082#[derive(Copy, Clone, Debug, serde::Serialize)]
6083pub struct CreatePaymentIntentPaymentMethodOptionsCrypto {
6084    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6085    ///
6086    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6087    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6088    ///
6089    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6090    ///
6091    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6092    ///
6093    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6094    #[serde(skip_serializing_if = "Option::is_none")]
6095    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
6096}
6097impl CreatePaymentIntentPaymentMethodOptionsCrypto {
6098    pub fn new() -> Self {
6099        Self { setup_future_usage: None }
6100    }
6101}
6102impl Default for CreatePaymentIntentPaymentMethodOptionsCrypto {
6103    fn default() -> Self {
6104        Self::new()
6105    }
6106}
6107/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6108///
6109/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6110/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6111///
6112/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6113///
6114/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6115///
6116/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6117#[derive(Copy, Clone, Eq, PartialEq)]
6118pub enum CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6119    None,
6120}
6121impl CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6122    pub fn as_str(self) -> &'static str {
6123        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
6124        match self {
6125            None => "none",
6126        }
6127    }
6128}
6129
6130impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6131    type Err = stripe_types::StripeParseError;
6132    fn from_str(s: &str) -> Result<Self, Self::Err> {
6133        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
6134        match s {
6135            "none" => Ok(None),
6136            _ => Err(stripe_types::StripeParseError),
6137        }
6138    }
6139}
6140impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6141    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6142        f.write_str(self.as_str())
6143    }
6144}
6145
6146impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6147    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6148        f.write_str(self.as_str())
6149    }
6150}
6151impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6152    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6153    where
6154        S: serde::Serializer,
6155    {
6156        serializer.serialize_str(self.as_str())
6157    }
6158}
6159#[cfg(feature = "deserialize")]
6160impl<'de> serde::Deserialize<'de>
6161    for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
6162{
6163    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6164        use std::str::FromStr;
6165        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6166        Self::from_str(&s).map_err(|_| {
6167            serde::de::Error::custom(
6168                "Unknown value for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
6169            )
6170        })
6171    }
6172}
6173/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
6174#[derive(Clone, Debug, serde::Serialize)]
6175pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6176    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
6177    #[serde(skip_serializing_if = "Option::is_none")]
6178    pub bank_transfer: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
6179    /// The funding method type to be used when there are not enough funds in the customer balance.
6180    /// Permitted values include: `bank_transfer`.
6181    #[serde(skip_serializing_if = "Option::is_none")]
6182    pub funding_type: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
6183    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6184    ///
6185    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6186    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6187    ///
6188    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6189    ///
6190    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6191    ///
6192    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6193    #[serde(skip_serializing_if = "Option::is_none")]
6194    pub setup_future_usage:
6195        Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
6196}
6197impl CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6198    pub fn new() -> Self {
6199        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
6200    }
6201}
6202impl Default for CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6203    fn default() -> Self {
6204        Self::new()
6205    }
6206}
6207/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
6208#[derive(Clone, Debug, serde::Serialize)]
6209pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
6210    /// Configuration for the eu_bank_transfer funding type.
6211    #[serde(skip_serializing_if = "Option::is_none")]
6212    pub eu_bank_transfer: Option<EuBankTransferParams>,
6213    /// List of address types that should be returned in the financial_addresses response.
6214    /// If not specified, all valid types will be returned.
6215    ///
6216    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
6217    #[serde(skip_serializing_if = "Option::is_none")]
6218    pub requested_address_types: Option<
6219        Vec<
6220            CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
6221        >,
6222    >,
6223    /// 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`.
6224    #[serde(rename = "type")]
6225    pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
6226}
6227impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
6228    pub fn new(
6229        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
6230    ) -> Self {
6231        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
6232    }
6233}
6234/// List of address types that should be returned in the financial_addresses response.
6235/// If not specified, all valid types will be returned.
6236///
6237/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
6238#[derive(Copy, Clone, Eq, PartialEq)]
6239pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
6240    Aba,
6241    Iban,
6242    Sepa,
6243    SortCode,
6244    Spei,
6245    Swift,
6246    Zengin,
6247}
6248impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
6249    pub fn as_str(self) -> &'static str {
6250        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
6251        match self {
6252            Aba => "aba",
6253            Iban => "iban",
6254            Sepa => "sepa",
6255            SortCode => "sort_code",
6256            Spei => "spei",
6257            Swift => "swift",
6258            Zengin => "zengin",
6259        }
6260    }
6261}
6262
6263impl std::str::FromStr
6264    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6265{
6266    type Err = stripe_types::StripeParseError;
6267    fn from_str(s: &str) -> Result<Self, Self::Err> {
6268        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
6269        match s {
6270            "aba" => Ok(Aba),
6271            "iban" => Ok(Iban),
6272            "sepa" => Ok(Sepa),
6273            "sort_code" => Ok(SortCode),
6274            "spei" => Ok(Spei),
6275            "swift" => Ok(Swift),
6276            "zengin" => Ok(Zengin),
6277            _ => Err(stripe_types::StripeParseError),
6278        }
6279    }
6280}
6281impl std::fmt::Display
6282    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6283{
6284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6285        f.write_str(self.as_str())
6286    }
6287}
6288
6289impl std::fmt::Debug
6290    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6291{
6292    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6293        f.write_str(self.as_str())
6294    }
6295}
6296impl serde::Serialize
6297    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6298{
6299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6300    where
6301        S: serde::Serializer,
6302    {
6303        serializer.serialize_str(self.as_str())
6304    }
6305}
6306#[cfg(feature = "deserialize")]
6307impl<'de> serde::Deserialize<'de>
6308    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6309{
6310    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6311        use std::str::FromStr;
6312        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6313        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
6314    }
6315}
6316/// 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`.
6317#[derive(Copy, Clone, Eq, PartialEq)]
6318pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6319    EuBankTransfer,
6320    GbBankTransfer,
6321    JpBankTransfer,
6322    MxBankTransfer,
6323    UsBankTransfer,
6324}
6325impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6326    pub fn as_str(self) -> &'static str {
6327        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6328        match self {
6329            EuBankTransfer => "eu_bank_transfer",
6330            GbBankTransfer => "gb_bank_transfer",
6331            JpBankTransfer => "jp_bank_transfer",
6332            MxBankTransfer => "mx_bank_transfer",
6333            UsBankTransfer => "us_bank_transfer",
6334        }
6335    }
6336}
6337
6338impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6339    type Err = stripe_types::StripeParseError;
6340    fn from_str(s: &str) -> Result<Self, Self::Err> {
6341        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6342        match s {
6343            "eu_bank_transfer" => Ok(EuBankTransfer),
6344            "gb_bank_transfer" => Ok(GbBankTransfer),
6345            "jp_bank_transfer" => Ok(JpBankTransfer),
6346            "mx_bank_transfer" => Ok(MxBankTransfer),
6347            "us_bank_transfer" => Ok(UsBankTransfer),
6348            _ => Err(stripe_types::StripeParseError),
6349        }
6350    }
6351}
6352impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6354        f.write_str(self.as_str())
6355    }
6356}
6357
6358impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6359    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6360        f.write_str(self.as_str())
6361    }
6362}
6363impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6364    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6365    where
6366        S: serde::Serializer,
6367    {
6368        serializer.serialize_str(self.as_str())
6369    }
6370}
6371#[cfg(feature = "deserialize")]
6372impl<'de> serde::Deserialize<'de>
6373    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
6374{
6375    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6376        use std::str::FromStr;
6377        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6378        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
6379    }
6380}
6381/// The funding method type to be used when there are not enough funds in the customer balance.
6382/// Permitted values include: `bank_transfer`.
6383#[derive(Copy, Clone, Eq, PartialEq)]
6384pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6385    BankTransfer,
6386}
6387impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6388    pub fn as_str(self) -> &'static str {
6389        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6390        match self {
6391            BankTransfer => "bank_transfer",
6392        }
6393    }
6394}
6395
6396impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6397    type Err = stripe_types::StripeParseError;
6398    fn from_str(s: &str) -> Result<Self, Self::Err> {
6399        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6400        match s {
6401            "bank_transfer" => Ok(BankTransfer),
6402            _ => Err(stripe_types::StripeParseError),
6403        }
6404    }
6405}
6406impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6407    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6408        f.write_str(self.as_str())
6409    }
6410}
6411
6412impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6413    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6414        f.write_str(self.as_str())
6415    }
6416}
6417impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6418    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6419    where
6420        S: serde::Serializer,
6421    {
6422        serializer.serialize_str(self.as_str())
6423    }
6424}
6425#[cfg(feature = "deserialize")]
6426impl<'de> serde::Deserialize<'de>
6427    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
6428{
6429    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6430        use std::str::FromStr;
6431        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6432        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
6433    }
6434}
6435/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6436///
6437/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6438/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6439///
6440/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6441///
6442/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6443///
6444/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6445#[derive(Copy, Clone, Eq, PartialEq)]
6446pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6447    None,
6448}
6449impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6450    pub fn as_str(self) -> &'static str {
6451        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
6452        match self {
6453            None => "none",
6454        }
6455    }
6456}
6457
6458impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6459    type Err = stripe_types::StripeParseError;
6460    fn from_str(s: &str) -> Result<Self, Self::Err> {
6461        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
6462        match s {
6463            "none" => Ok(None),
6464            _ => Err(stripe_types::StripeParseError),
6465        }
6466    }
6467}
6468impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6469    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6470        f.write_str(self.as_str())
6471    }
6472}
6473
6474impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6475    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6476        f.write_str(self.as_str())
6477    }
6478}
6479impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
6480    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6481    where
6482        S: serde::Serializer,
6483    {
6484        serializer.serialize_str(self.as_str())
6485    }
6486}
6487#[cfg(feature = "deserialize")]
6488impl<'de> serde::Deserialize<'de>
6489    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
6490{
6491    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6492        use std::str::FromStr;
6493        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6494        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
6495    }
6496}
6497/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
6498#[derive(Copy, Clone, Debug, serde::Serialize)]
6499pub struct CreatePaymentIntentPaymentMethodOptionsEps {
6500    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6501    ///
6502    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6503    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6504    ///
6505    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6506    ///
6507    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6508    ///
6509    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6510    #[serde(skip_serializing_if = "Option::is_none")]
6511    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
6512}
6513impl CreatePaymentIntentPaymentMethodOptionsEps {
6514    pub fn new() -> Self {
6515        Self { setup_future_usage: None }
6516    }
6517}
6518impl Default for CreatePaymentIntentPaymentMethodOptionsEps {
6519    fn default() -> Self {
6520        Self::new()
6521    }
6522}
6523/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6524///
6525/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6526/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6527///
6528/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6529///
6530/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6531///
6532/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6533#[derive(Copy, Clone, Eq, PartialEq)]
6534pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6535    None,
6536}
6537impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6538    pub fn as_str(self) -> &'static str {
6539        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
6540        match self {
6541            None => "none",
6542        }
6543    }
6544}
6545
6546impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6547    type Err = stripe_types::StripeParseError;
6548    fn from_str(s: &str) -> Result<Self, Self::Err> {
6549        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
6550        match s {
6551            "none" => Ok(None),
6552            _ => Err(stripe_types::StripeParseError),
6553        }
6554    }
6555}
6556impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6557    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6558        f.write_str(self.as_str())
6559    }
6560}
6561
6562impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6563    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6564        f.write_str(self.as_str())
6565    }
6566}
6567impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6568    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6569    where
6570        S: serde::Serializer,
6571    {
6572        serializer.serialize_str(self.as_str())
6573    }
6574}
6575#[cfg(feature = "deserialize")]
6576impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
6577    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6578        use std::str::FromStr;
6579        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6580        Self::from_str(&s).map_err(|_| {
6581            serde::de::Error::custom(
6582                "Unknown value for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
6583            )
6584        })
6585    }
6586}
6587/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
6588#[derive(Copy, Clone, Debug, serde::Serialize)]
6589pub struct CreatePaymentIntentPaymentMethodOptionsFpx {
6590    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6591    ///
6592    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6593    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6594    ///
6595    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6596    ///
6597    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6598    ///
6599    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6600    #[serde(skip_serializing_if = "Option::is_none")]
6601    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
6602}
6603impl CreatePaymentIntentPaymentMethodOptionsFpx {
6604    pub fn new() -> Self {
6605        Self { setup_future_usage: None }
6606    }
6607}
6608impl Default for CreatePaymentIntentPaymentMethodOptionsFpx {
6609    fn default() -> Self {
6610        Self::new()
6611    }
6612}
6613/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6614///
6615/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6616/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6617///
6618/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6619///
6620/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6621///
6622/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6623#[derive(Copy, Clone, Eq, PartialEq)]
6624pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6625    None,
6626}
6627impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6628    pub fn as_str(self) -> &'static str {
6629        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
6630        match self {
6631            None => "none",
6632        }
6633    }
6634}
6635
6636impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6637    type Err = stripe_types::StripeParseError;
6638    fn from_str(s: &str) -> Result<Self, Self::Err> {
6639        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
6640        match s {
6641            "none" => Ok(None),
6642            _ => Err(stripe_types::StripeParseError),
6643        }
6644    }
6645}
6646impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6648        f.write_str(self.as_str())
6649    }
6650}
6651
6652impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6653    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6654        f.write_str(self.as_str())
6655    }
6656}
6657impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6658    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6659    where
6660        S: serde::Serializer,
6661    {
6662        serializer.serialize_str(self.as_str())
6663    }
6664}
6665#[cfg(feature = "deserialize")]
6666impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
6667    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6668        use std::str::FromStr;
6669        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6670        Self::from_str(&s).map_err(|_| {
6671            serde::de::Error::custom(
6672                "Unknown value for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
6673            )
6674        })
6675    }
6676}
6677/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
6678#[derive(Copy, Clone, Debug, serde::Serialize)]
6679pub struct CreatePaymentIntentPaymentMethodOptionsGiropay {
6680    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6681    ///
6682    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6683    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6684    ///
6685    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6686    ///
6687    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6688    ///
6689    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6690    #[serde(skip_serializing_if = "Option::is_none")]
6691    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
6692}
6693impl CreatePaymentIntentPaymentMethodOptionsGiropay {
6694    pub fn new() -> Self {
6695        Self { setup_future_usage: None }
6696    }
6697}
6698impl Default for CreatePaymentIntentPaymentMethodOptionsGiropay {
6699    fn default() -> Self {
6700        Self::new()
6701    }
6702}
6703/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6704///
6705/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6706/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6707///
6708/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6709///
6710/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6711///
6712/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6713#[derive(Copy, Clone, Eq, PartialEq)]
6714pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6715    None,
6716}
6717impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6718    pub fn as_str(self) -> &'static str {
6719        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
6720        match self {
6721            None => "none",
6722        }
6723    }
6724}
6725
6726impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6727    type Err = stripe_types::StripeParseError;
6728    fn from_str(s: &str) -> Result<Self, Self::Err> {
6729        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
6730        match s {
6731            "none" => Ok(None),
6732            _ => Err(stripe_types::StripeParseError),
6733        }
6734    }
6735}
6736impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6737    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6738        f.write_str(self.as_str())
6739    }
6740}
6741
6742impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6743    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6744        f.write_str(self.as_str())
6745    }
6746}
6747impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
6748    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6749    where
6750        S: serde::Serializer,
6751    {
6752        serializer.serialize_str(self.as_str())
6753    }
6754}
6755#[cfg(feature = "deserialize")]
6756impl<'de> serde::Deserialize<'de>
6757    for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
6758{
6759    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6760        use std::str::FromStr;
6761        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6762        Self::from_str(&s).map_err(|_| {
6763            serde::de::Error::custom(
6764                "Unknown value for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
6765            )
6766        })
6767    }
6768}
6769/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
6770#[derive(Copy, Clone, Debug, serde::Serialize)]
6771pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay {
6772    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6773    ///
6774    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6775    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6776    ///
6777    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6778    ///
6779    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6780    ///
6781    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6782    #[serde(skip_serializing_if = "Option::is_none")]
6783    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
6784}
6785impl CreatePaymentIntentPaymentMethodOptionsGrabpay {
6786    pub fn new() -> Self {
6787        Self { setup_future_usage: None }
6788    }
6789}
6790impl Default for CreatePaymentIntentPaymentMethodOptionsGrabpay {
6791    fn default() -> Self {
6792        Self::new()
6793    }
6794}
6795/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6796///
6797/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6798/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6799///
6800/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6801///
6802/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6803///
6804/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6805#[derive(Copy, Clone, Eq, PartialEq)]
6806pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6807    None,
6808}
6809impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6810    pub fn as_str(self) -> &'static str {
6811        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
6812        match self {
6813            None => "none",
6814        }
6815    }
6816}
6817
6818impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6819    type Err = stripe_types::StripeParseError;
6820    fn from_str(s: &str) -> Result<Self, Self::Err> {
6821        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
6822        match s {
6823            "none" => Ok(None),
6824            _ => Err(stripe_types::StripeParseError),
6825        }
6826    }
6827}
6828impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6829    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6830        f.write_str(self.as_str())
6831    }
6832}
6833
6834impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6835    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6836        f.write_str(self.as_str())
6837    }
6838}
6839impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
6840    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6841    where
6842        S: serde::Serializer,
6843    {
6844        serializer.serialize_str(self.as_str())
6845    }
6846}
6847#[cfg(feature = "deserialize")]
6848impl<'de> serde::Deserialize<'de>
6849    for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
6850{
6851    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6852        use std::str::FromStr;
6853        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6854        Self::from_str(&s).map_err(|_| {
6855            serde::de::Error::custom(
6856                "Unknown value for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
6857            )
6858        })
6859    }
6860}
6861/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
6862#[derive(Copy, Clone, Debug, serde::Serialize)]
6863pub struct CreatePaymentIntentPaymentMethodOptionsIdeal {
6864    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6865    ///
6866    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6867    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6868    ///
6869    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6870    ///
6871    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6872    ///
6873    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6874    #[serde(skip_serializing_if = "Option::is_none")]
6875    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
6876}
6877impl CreatePaymentIntentPaymentMethodOptionsIdeal {
6878    pub fn new() -> Self {
6879        Self { setup_future_usage: None }
6880    }
6881}
6882impl Default for CreatePaymentIntentPaymentMethodOptionsIdeal {
6883    fn default() -> Self {
6884        Self::new()
6885    }
6886}
6887/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6888///
6889/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6890/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6891///
6892/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6893///
6894/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6895///
6896/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6897#[derive(Copy, Clone, Eq, PartialEq)]
6898pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6899    None,
6900    OffSession,
6901}
6902impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6903    pub fn as_str(self) -> &'static str {
6904        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
6905        match self {
6906            None => "none",
6907            OffSession => "off_session",
6908        }
6909    }
6910}
6911
6912impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6913    type Err = stripe_types::StripeParseError;
6914    fn from_str(s: &str) -> Result<Self, Self::Err> {
6915        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
6916        match s {
6917            "none" => Ok(None),
6918            "off_session" => Ok(OffSession),
6919            _ => Err(stripe_types::StripeParseError),
6920        }
6921    }
6922}
6923impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6924    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6925        f.write_str(self.as_str())
6926    }
6927}
6928
6929impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6930    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6931        f.write_str(self.as_str())
6932    }
6933}
6934impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6935    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6936    where
6937        S: serde::Serializer,
6938    {
6939        serializer.serialize_str(self.as_str())
6940    }
6941}
6942#[cfg(feature = "deserialize")]
6943impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
6944    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6945        use std::str::FromStr;
6946        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6947        Self::from_str(&s).map_err(|_| {
6948            serde::de::Error::custom(
6949                "Unknown value for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
6950            )
6951        })
6952    }
6953}
6954/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
6955#[derive(Copy, Clone, Debug, serde::Serialize)]
6956pub struct CreatePaymentIntentPaymentMethodOptionsKakaoPay {
6957    /// Controls when the funds are captured from the customer's account.
6958    ///
6959    /// 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.
6960    ///
6961    /// 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.
6962    #[serde(skip_serializing_if = "Option::is_none")]
6963    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
6964    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6965    ///
6966    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6967    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6968    ///
6969    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6970    ///
6971    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6972    #[serde(skip_serializing_if = "Option::is_none")]
6973    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
6974}
6975impl CreatePaymentIntentPaymentMethodOptionsKakaoPay {
6976    pub fn new() -> Self {
6977        Self { capture_method: None, setup_future_usage: None }
6978    }
6979}
6980impl Default for CreatePaymentIntentPaymentMethodOptionsKakaoPay {
6981    fn default() -> Self {
6982        Self::new()
6983    }
6984}
6985/// Controls when the funds are captured from the customer's account.
6986///
6987/// 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.
6988///
6989/// 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.
6990#[derive(Copy, Clone, Eq, PartialEq)]
6991pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6992    Manual,
6993}
6994impl CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
6995    pub fn as_str(self) -> &'static str {
6996        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
6997        match self {
6998            Manual => "manual",
6999        }
7000    }
7001}
7002
7003impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7004    type Err = stripe_types::StripeParseError;
7005    fn from_str(s: &str) -> Result<Self, Self::Err> {
7006        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
7007        match s {
7008            "manual" => Ok(Manual),
7009            _ => Err(stripe_types::StripeParseError),
7010        }
7011    }
7012}
7013impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7015        f.write_str(self.as_str())
7016    }
7017}
7018
7019impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7021        f.write_str(self.as_str())
7022    }
7023}
7024impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7025    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7026    where
7027        S: serde::Serializer,
7028    {
7029        serializer.serialize_str(self.as_str())
7030    }
7031}
7032#[cfg(feature = "deserialize")]
7033impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7034    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7035        use std::str::FromStr;
7036        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7037        Self::from_str(&s).map_err(|_| {
7038            serde::de::Error::custom(
7039                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
7040            )
7041        })
7042    }
7043}
7044/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7045///
7046/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7047/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7048///
7049/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7050///
7051/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7052#[derive(Copy, Clone, Eq, PartialEq)]
7053pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7054    None,
7055    OffSession,
7056}
7057impl CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7058    pub fn as_str(self) -> &'static str {
7059        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
7060        match self {
7061            None => "none",
7062            OffSession => "off_session",
7063        }
7064    }
7065}
7066
7067impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7068    type Err = stripe_types::StripeParseError;
7069    fn from_str(s: &str) -> Result<Self, Self::Err> {
7070        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
7071        match s {
7072            "none" => Ok(None),
7073            "off_session" => Ok(OffSession),
7074            _ => Err(stripe_types::StripeParseError),
7075        }
7076    }
7077}
7078impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7079    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7080        f.write_str(self.as_str())
7081    }
7082}
7083
7084impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7085    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7086        f.write_str(self.as_str())
7087    }
7088}
7089impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7090    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7091    where
7092        S: serde::Serializer,
7093    {
7094        serializer.serialize_str(self.as_str())
7095    }
7096}
7097#[cfg(feature = "deserialize")]
7098impl<'de> serde::Deserialize<'de>
7099    for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
7100{
7101    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7102        use std::str::FromStr;
7103        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7104        Self::from_str(&s).map_err(|_| {
7105            serde::de::Error::custom(
7106                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage",
7107            )
7108        })
7109    }
7110}
7111/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
7112#[derive(Clone, Debug, serde::Serialize)]
7113pub struct CreatePaymentIntentPaymentMethodOptionsKlarna {
7114    /// Controls when the funds are captured from the customer's account.
7115    ///
7116    /// 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.
7117    ///
7118    /// 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.
7119    #[serde(skip_serializing_if = "Option::is_none")]
7120    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
7121    /// On-demand details if setting up or charging an on-demand payment.
7122    #[serde(skip_serializing_if = "Option::is_none")]
7123    pub on_demand: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
7124    /// Preferred language of the Klarna authorization page that the customer is redirected to
7125    #[serde(skip_serializing_if = "Option::is_none")]
7126    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7127    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7128    ///
7129    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7130    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7131    ///
7132    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7133    ///
7134    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7135    ///
7136    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7137    #[serde(skip_serializing_if = "Option::is_none")]
7138    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
7139    /// Subscription details if setting up or charging a subscription.
7140    #[serde(skip_serializing_if = "Option::is_none")]
7141    pub subscriptions: Option<Vec<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7142}
7143impl CreatePaymentIntentPaymentMethodOptionsKlarna {
7144    pub fn new() -> Self {
7145        Self {
7146            capture_method: None,
7147            on_demand: None,
7148            preferred_locale: None,
7149            setup_future_usage: None,
7150            subscriptions: None,
7151        }
7152    }
7153}
7154impl Default for CreatePaymentIntentPaymentMethodOptionsKlarna {
7155    fn default() -> Self {
7156        Self::new()
7157    }
7158}
7159/// Controls when the funds are captured from the customer's account.
7160///
7161/// 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.
7162///
7163/// 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.
7164#[derive(Copy, Clone, Eq, PartialEq)]
7165pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7166    Manual,
7167}
7168impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7169    pub fn as_str(self) -> &'static str {
7170        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
7171        match self {
7172            Manual => "manual",
7173        }
7174    }
7175}
7176
7177impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7178    type Err = stripe_types::StripeParseError;
7179    fn from_str(s: &str) -> Result<Self, Self::Err> {
7180        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
7181        match s {
7182            "manual" => Ok(Manual),
7183            _ => Err(stripe_types::StripeParseError),
7184        }
7185    }
7186}
7187impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7188    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7189        f.write_str(self.as_str())
7190    }
7191}
7192
7193impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7194    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7195        f.write_str(self.as_str())
7196    }
7197}
7198impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7199    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7200    where
7201        S: serde::Serializer,
7202    {
7203        serializer.serialize_str(self.as_str())
7204    }
7205}
7206#[cfg(feature = "deserialize")]
7207impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7208    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7209        use std::str::FromStr;
7210        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7211        Self::from_str(&s).map_err(|_| {
7212            serde::de::Error::custom(
7213                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
7214            )
7215        })
7216    }
7217}
7218/// On-demand details if setting up or charging an on-demand payment.
7219#[derive(Copy, Clone, Debug, serde::Serialize)]
7220pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7221    /// Your average amount value.
7222    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7223    #[serde(skip_serializing_if = "Option::is_none")]
7224    pub average_amount: Option<i64>,
7225    /// The maximum value you may charge a customer per purchase.
7226    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7227    #[serde(skip_serializing_if = "Option::is_none")]
7228    pub maximum_amount: Option<i64>,
7229    /// The lowest or minimum value you may charge a customer per purchase.
7230    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7231    #[serde(skip_serializing_if = "Option::is_none")]
7232    pub minimum_amount: Option<i64>,
7233    /// Interval at which the customer is making purchases
7234    #[serde(skip_serializing_if = "Option::is_none")]
7235    pub purchase_interval:
7236        Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7237    /// The number of `purchase_interval` between charges
7238    #[serde(skip_serializing_if = "Option::is_none")]
7239    pub purchase_interval_count: Option<u64>,
7240}
7241impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7242    pub fn new() -> Self {
7243        Self {
7244            average_amount: None,
7245            maximum_amount: None,
7246            minimum_amount: None,
7247            purchase_interval: None,
7248            purchase_interval_count: None,
7249        }
7250    }
7251}
7252impl Default for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7253    fn default() -> Self {
7254        Self::new()
7255    }
7256}
7257/// Interval at which the customer is making purchases
7258#[derive(Copy, Clone, Eq, PartialEq)]
7259pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7260    Day,
7261    Month,
7262    Week,
7263    Year,
7264}
7265impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7266    pub fn as_str(self) -> &'static str {
7267        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7268        match self {
7269            Day => "day",
7270            Month => "month",
7271            Week => "week",
7272            Year => "year",
7273        }
7274    }
7275}
7276
7277impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7278    type Err = stripe_types::StripeParseError;
7279    fn from_str(s: &str) -> Result<Self, Self::Err> {
7280        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7281        match s {
7282            "day" => Ok(Day),
7283            "month" => Ok(Month),
7284            "week" => Ok(Week),
7285            "year" => Ok(Year),
7286            _ => Err(stripe_types::StripeParseError),
7287        }
7288    }
7289}
7290impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7291    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7292        f.write_str(self.as_str())
7293    }
7294}
7295
7296impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7298        f.write_str(self.as_str())
7299    }
7300}
7301impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7302    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7303    where
7304        S: serde::Serializer,
7305    {
7306        serializer.serialize_str(self.as_str())
7307    }
7308}
7309#[cfg(feature = "deserialize")]
7310impl<'de> serde::Deserialize<'de>
7311    for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7312{
7313    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7314        use std::str::FromStr;
7315        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7316        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
7317    }
7318}
7319/// Preferred language of the Klarna authorization page that the customer is redirected to
7320#[derive(Clone, Eq, PartialEq)]
7321#[non_exhaustive]
7322pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7323    CsMinusCz,
7324    DaMinusDk,
7325    DeMinusAt,
7326    DeMinusCh,
7327    DeMinusDe,
7328    ElMinusGr,
7329    EnMinusAt,
7330    EnMinusAu,
7331    EnMinusBe,
7332    EnMinusCa,
7333    EnMinusCh,
7334    EnMinusCz,
7335    EnMinusDe,
7336    EnMinusDk,
7337    EnMinusEs,
7338    EnMinusFi,
7339    EnMinusFr,
7340    EnMinusGb,
7341    EnMinusGr,
7342    EnMinusIe,
7343    EnMinusIt,
7344    EnMinusNl,
7345    EnMinusNo,
7346    EnMinusNz,
7347    EnMinusPl,
7348    EnMinusPt,
7349    EnMinusRo,
7350    EnMinusSe,
7351    EnMinusUs,
7352    EsMinusEs,
7353    EsMinusUs,
7354    FiMinusFi,
7355    FrMinusBe,
7356    FrMinusCa,
7357    FrMinusCh,
7358    FrMinusFr,
7359    ItMinusCh,
7360    ItMinusIt,
7361    NbMinusNo,
7362    NlMinusBe,
7363    NlMinusNl,
7364    PlMinusPl,
7365    PtMinusPt,
7366    RoMinusRo,
7367    SvMinusFi,
7368    SvMinusSe,
7369    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7370    Unknown(String),
7371}
7372impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7373    pub fn as_str(&self) -> &str {
7374        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7375        match self {
7376            CsMinusCz => "cs-CZ",
7377            DaMinusDk => "da-DK",
7378            DeMinusAt => "de-AT",
7379            DeMinusCh => "de-CH",
7380            DeMinusDe => "de-DE",
7381            ElMinusGr => "el-GR",
7382            EnMinusAt => "en-AT",
7383            EnMinusAu => "en-AU",
7384            EnMinusBe => "en-BE",
7385            EnMinusCa => "en-CA",
7386            EnMinusCh => "en-CH",
7387            EnMinusCz => "en-CZ",
7388            EnMinusDe => "en-DE",
7389            EnMinusDk => "en-DK",
7390            EnMinusEs => "en-ES",
7391            EnMinusFi => "en-FI",
7392            EnMinusFr => "en-FR",
7393            EnMinusGb => "en-GB",
7394            EnMinusGr => "en-GR",
7395            EnMinusIe => "en-IE",
7396            EnMinusIt => "en-IT",
7397            EnMinusNl => "en-NL",
7398            EnMinusNo => "en-NO",
7399            EnMinusNz => "en-NZ",
7400            EnMinusPl => "en-PL",
7401            EnMinusPt => "en-PT",
7402            EnMinusRo => "en-RO",
7403            EnMinusSe => "en-SE",
7404            EnMinusUs => "en-US",
7405            EsMinusEs => "es-ES",
7406            EsMinusUs => "es-US",
7407            FiMinusFi => "fi-FI",
7408            FrMinusBe => "fr-BE",
7409            FrMinusCa => "fr-CA",
7410            FrMinusCh => "fr-CH",
7411            FrMinusFr => "fr-FR",
7412            ItMinusCh => "it-CH",
7413            ItMinusIt => "it-IT",
7414            NbMinusNo => "nb-NO",
7415            NlMinusBe => "nl-BE",
7416            NlMinusNl => "nl-NL",
7417            PlMinusPl => "pl-PL",
7418            PtMinusPt => "pt-PT",
7419            RoMinusRo => "ro-RO",
7420            SvMinusFi => "sv-FI",
7421            SvMinusSe => "sv-SE",
7422            Unknown(v) => v,
7423        }
7424    }
7425}
7426
7427impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7428    type Err = std::convert::Infallible;
7429    fn from_str(s: &str) -> Result<Self, Self::Err> {
7430        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
7431        match s {
7432            "cs-CZ" => Ok(CsMinusCz),
7433            "da-DK" => Ok(DaMinusDk),
7434            "de-AT" => Ok(DeMinusAt),
7435            "de-CH" => Ok(DeMinusCh),
7436            "de-DE" => Ok(DeMinusDe),
7437            "el-GR" => Ok(ElMinusGr),
7438            "en-AT" => Ok(EnMinusAt),
7439            "en-AU" => Ok(EnMinusAu),
7440            "en-BE" => Ok(EnMinusBe),
7441            "en-CA" => Ok(EnMinusCa),
7442            "en-CH" => Ok(EnMinusCh),
7443            "en-CZ" => Ok(EnMinusCz),
7444            "en-DE" => Ok(EnMinusDe),
7445            "en-DK" => Ok(EnMinusDk),
7446            "en-ES" => Ok(EnMinusEs),
7447            "en-FI" => Ok(EnMinusFi),
7448            "en-FR" => Ok(EnMinusFr),
7449            "en-GB" => Ok(EnMinusGb),
7450            "en-GR" => Ok(EnMinusGr),
7451            "en-IE" => Ok(EnMinusIe),
7452            "en-IT" => Ok(EnMinusIt),
7453            "en-NL" => Ok(EnMinusNl),
7454            "en-NO" => Ok(EnMinusNo),
7455            "en-NZ" => Ok(EnMinusNz),
7456            "en-PL" => Ok(EnMinusPl),
7457            "en-PT" => Ok(EnMinusPt),
7458            "en-RO" => Ok(EnMinusRo),
7459            "en-SE" => Ok(EnMinusSe),
7460            "en-US" => Ok(EnMinusUs),
7461            "es-ES" => Ok(EsMinusEs),
7462            "es-US" => Ok(EsMinusUs),
7463            "fi-FI" => Ok(FiMinusFi),
7464            "fr-BE" => Ok(FrMinusBe),
7465            "fr-CA" => Ok(FrMinusCa),
7466            "fr-CH" => Ok(FrMinusCh),
7467            "fr-FR" => Ok(FrMinusFr),
7468            "it-CH" => Ok(ItMinusCh),
7469            "it-IT" => Ok(ItMinusIt),
7470            "nb-NO" => Ok(NbMinusNo),
7471            "nl-BE" => Ok(NlMinusBe),
7472            "nl-NL" => Ok(NlMinusNl),
7473            "pl-PL" => Ok(PlMinusPl),
7474            "pt-PT" => Ok(PtMinusPt),
7475            "ro-RO" => Ok(RoMinusRo),
7476            "sv-FI" => Ok(SvMinusFi),
7477            "sv-SE" => Ok(SvMinusSe),
7478            v => Ok(Unknown(v.to_owned())),
7479        }
7480    }
7481}
7482impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7483    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7484        f.write_str(self.as_str())
7485    }
7486}
7487
7488impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7489    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7490        f.write_str(self.as_str())
7491    }
7492}
7493impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7494    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7495    where
7496        S: serde::Serializer,
7497    {
7498        serializer.serialize_str(self.as_str())
7499    }
7500}
7501#[cfg(feature = "deserialize")]
7502impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
7503    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7504        use std::str::FromStr;
7505        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7506        Ok(Self::from_str(&s).unwrap())
7507    }
7508}
7509/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7510///
7511/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7512/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7513///
7514/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7515///
7516/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7517///
7518/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7519#[derive(Copy, Clone, Eq, PartialEq)]
7520pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7521    None,
7522    OffSession,
7523    OnSession,
7524}
7525impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7526    pub fn as_str(self) -> &'static str {
7527        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
7528        match self {
7529            None => "none",
7530            OffSession => "off_session",
7531            OnSession => "on_session",
7532        }
7533    }
7534}
7535
7536impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7537    type Err = stripe_types::StripeParseError;
7538    fn from_str(s: &str) -> Result<Self, Self::Err> {
7539        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
7540        match s {
7541            "none" => Ok(None),
7542            "off_session" => Ok(OffSession),
7543            "on_session" => Ok(OnSession),
7544            _ => Err(stripe_types::StripeParseError),
7545        }
7546    }
7547}
7548impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7549    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7550        f.write_str(self.as_str())
7551    }
7552}
7553
7554impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7555    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7556        f.write_str(self.as_str())
7557    }
7558}
7559impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
7560    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7561    where
7562        S: serde::Serializer,
7563    {
7564        serializer.serialize_str(self.as_str())
7565    }
7566}
7567#[cfg(feature = "deserialize")]
7568impl<'de> serde::Deserialize<'de>
7569    for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
7570{
7571    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7572        use std::str::FromStr;
7573        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7574        Self::from_str(&s).map_err(|_| {
7575            serde::de::Error::custom(
7576                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
7577            )
7578        })
7579    }
7580}
7581/// Subscription details if setting up or charging a subscription.
7582#[derive(Clone, Debug, serde::Serialize)]
7583pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
7584    /// Unit of time between subscription charges.
7585    pub interval: CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
7586    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
7587    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
7588    #[serde(skip_serializing_if = "Option::is_none")]
7589    pub interval_count: Option<u64>,
7590    /// Name for subscription.
7591    #[serde(skip_serializing_if = "Option::is_none")]
7592    pub name: Option<String>,
7593    /// Describes the upcoming charge for this subscription.
7594    #[serde(skip_serializing_if = "Option::is_none")]
7595    pub next_billing: Option<SubscriptionNextBillingParam>,
7596    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
7597    /// Use a value that persists across subscription charges.
7598    pub reference: String,
7599}
7600impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
7601    pub fn new(
7602        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
7603        reference: impl Into<String>,
7604    ) -> Self {
7605        Self {
7606            interval: interval.into(),
7607            interval_count: None,
7608            name: None,
7609            next_billing: None,
7610            reference: reference.into(),
7611        }
7612    }
7613}
7614/// Unit of time between subscription charges.
7615#[derive(Copy, Clone, Eq, PartialEq)]
7616pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7617    Day,
7618    Month,
7619    Week,
7620    Year,
7621}
7622impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7623    pub fn as_str(self) -> &'static str {
7624        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7625        match self {
7626            Day => "day",
7627            Month => "month",
7628            Week => "week",
7629            Year => "year",
7630        }
7631    }
7632}
7633
7634impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7635    type Err = stripe_types::StripeParseError;
7636    fn from_str(s: &str) -> Result<Self, Self::Err> {
7637        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
7638        match s {
7639            "day" => Ok(Day),
7640            "month" => Ok(Month),
7641            "week" => Ok(Week),
7642            "year" => Ok(Year),
7643            _ => Err(stripe_types::StripeParseError),
7644        }
7645    }
7646}
7647impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7648    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7649        f.write_str(self.as_str())
7650    }
7651}
7652
7653impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7655        f.write_str(self.as_str())
7656    }
7657}
7658impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
7659    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7660    where
7661        S: serde::Serializer,
7662    {
7663        serializer.serialize_str(self.as_str())
7664    }
7665}
7666#[cfg(feature = "deserialize")]
7667impl<'de> serde::Deserialize<'de>
7668    for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
7669{
7670    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7671        use std::str::FromStr;
7672        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7673        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
7674    }
7675}
7676/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
7677#[derive(Clone, Debug, serde::Serialize)]
7678pub struct CreatePaymentIntentPaymentMethodOptionsKonbini {
7679    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
7680    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
7681    /// We recommend to use the customer's phone number.
7682    #[serde(skip_serializing_if = "Option::is_none")]
7683    pub confirmation_number: Option<String>,
7684    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
7685    /// 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.
7686    /// Defaults to 3 days.
7687    #[serde(skip_serializing_if = "Option::is_none")]
7688    pub expires_after_days: Option<u32>,
7689    /// The timestamp at which the Konbini payment instructions will expire.
7690    /// Only one of `expires_after_days` or `expires_at` may be set.
7691    #[serde(skip_serializing_if = "Option::is_none")]
7692    pub expires_at: Option<stripe_types::Timestamp>,
7693    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
7694    #[serde(skip_serializing_if = "Option::is_none")]
7695    pub product_description: Option<String>,
7696    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7697    ///
7698    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7699    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7700    ///
7701    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7702    ///
7703    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7704    ///
7705    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7706    #[serde(skip_serializing_if = "Option::is_none")]
7707    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
7708}
7709impl CreatePaymentIntentPaymentMethodOptionsKonbini {
7710    pub fn new() -> Self {
7711        Self {
7712            confirmation_number: None,
7713            expires_after_days: None,
7714            expires_at: None,
7715            product_description: None,
7716            setup_future_usage: None,
7717        }
7718    }
7719}
7720impl Default for CreatePaymentIntentPaymentMethodOptionsKonbini {
7721    fn default() -> Self {
7722        Self::new()
7723    }
7724}
7725/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7726///
7727/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7728/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7729///
7730/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7731///
7732/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7733///
7734/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7735#[derive(Copy, Clone, Eq, PartialEq)]
7736pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7737    None,
7738}
7739impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7740    pub fn as_str(self) -> &'static str {
7741        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
7742        match self {
7743            None => "none",
7744        }
7745    }
7746}
7747
7748impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7749    type Err = stripe_types::StripeParseError;
7750    fn from_str(s: &str) -> Result<Self, Self::Err> {
7751        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
7752        match s {
7753            "none" => Ok(None),
7754            _ => Err(stripe_types::StripeParseError),
7755        }
7756    }
7757}
7758impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7759    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7760        f.write_str(self.as_str())
7761    }
7762}
7763
7764impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7765    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7766        f.write_str(self.as_str())
7767    }
7768}
7769impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
7770    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7771    where
7772        S: serde::Serializer,
7773    {
7774        serializer.serialize_str(self.as_str())
7775    }
7776}
7777#[cfg(feature = "deserialize")]
7778impl<'de> serde::Deserialize<'de>
7779    for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
7780{
7781    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7782        use std::str::FromStr;
7783        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7784        Self::from_str(&s).map_err(|_| {
7785            serde::de::Error::custom(
7786                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
7787            )
7788        })
7789    }
7790}
7791/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
7792#[derive(Copy, Clone, Debug, serde::Serialize)]
7793pub struct CreatePaymentIntentPaymentMethodOptionsKrCard {
7794    /// Controls when the funds are captured from the customer's account.
7795    ///
7796    /// 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.
7797    ///
7798    /// 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.
7799    #[serde(skip_serializing_if = "Option::is_none")]
7800    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
7801    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7802    ///
7803    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7804    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7805    ///
7806    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7807    ///
7808    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7809    #[serde(skip_serializing_if = "Option::is_none")]
7810    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
7811}
7812impl CreatePaymentIntentPaymentMethodOptionsKrCard {
7813    pub fn new() -> Self {
7814        Self { capture_method: None, setup_future_usage: None }
7815    }
7816}
7817impl Default for CreatePaymentIntentPaymentMethodOptionsKrCard {
7818    fn default() -> Self {
7819        Self::new()
7820    }
7821}
7822/// Controls when the funds are captured from the customer's account.
7823///
7824/// 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.
7825///
7826/// 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.
7827#[derive(Copy, Clone, Eq, PartialEq)]
7828pub enum CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7829    Manual,
7830}
7831impl CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7832    pub fn as_str(self) -> &'static str {
7833        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
7834        match self {
7835            Manual => "manual",
7836        }
7837    }
7838}
7839
7840impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7841    type Err = stripe_types::StripeParseError;
7842    fn from_str(s: &str) -> Result<Self, Self::Err> {
7843        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
7844        match s {
7845            "manual" => Ok(Manual),
7846            _ => Err(stripe_types::StripeParseError),
7847        }
7848    }
7849}
7850impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7852        f.write_str(self.as_str())
7853    }
7854}
7855
7856impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7858        f.write_str(self.as_str())
7859    }
7860}
7861impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7862    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7863    where
7864        S: serde::Serializer,
7865    {
7866        serializer.serialize_str(self.as_str())
7867    }
7868}
7869#[cfg(feature = "deserialize")]
7870impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
7871    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7872        use std::str::FromStr;
7873        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7874        Self::from_str(&s).map_err(|_| {
7875            serde::de::Error::custom(
7876                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
7877            )
7878        })
7879    }
7880}
7881/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7882///
7883/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7884/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7885///
7886/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7887///
7888/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7889#[derive(Copy, Clone, Eq, PartialEq)]
7890pub enum CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7891    None,
7892    OffSession,
7893}
7894impl CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7895    pub fn as_str(self) -> &'static str {
7896        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
7897        match self {
7898            None => "none",
7899            OffSession => "off_session",
7900        }
7901    }
7902}
7903
7904impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7905    type Err = stripe_types::StripeParseError;
7906    fn from_str(s: &str) -> Result<Self, Self::Err> {
7907        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
7908        match s {
7909            "none" => Ok(None),
7910            "off_session" => Ok(OffSession),
7911            _ => Err(stripe_types::StripeParseError),
7912        }
7913    }
7914}
7915impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7916    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7917        f.write_str(self.as_str())
7918    }
7919}
7920
7921impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7922    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7923        f.write_str(self.as_str())
7924    }
7925}
7926impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
7927    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7928    where
7929        S: serde::Serializer,
7930    {
7931        serializer.serialize_str(self.as_str())
7932    }
7933}
7934#[cfg(feature = "deserialize")]
7935impl<'de> serde::Deserialize<'de>
7936    for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
7937{
7938    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7939        use std::str::FromStr;
7940        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7941        Self::from_str(&s).map_err(|_| {
7942            serde::de::Error::custom(
7943                "Unknown value for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
7944            )
7945        })
7946    }
7947}
7948/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
7949#[derive(Clone, Debug, serde::Serialize)]
7950pub struct CreatePaymentIntentPaymentMethodOptionsLink {
7951    /// Controls when the funds are captured from the customer's account.
7952    ///
7953    /// 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.
7954    ///
7955    /// 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.
7956    #[serde(skip_serializing_if = "Option::is_none")]
7957    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
7958    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
7959    #[serde(skip_serializing_if = "Option::is_none")]
7960    pub persistent_token: Option<String>,
7961    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7962    ///
7963    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7964    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7965    ///
7966    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7967    ///
7968    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7969    ///
7970    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7971    #[serde(skip_serializing_if = "Option::is_none")]
7972    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
7973}
7974impl CreatePaymentIntentPaymentMethodOptionsLink {
7975    pub fn new() -> Self {
7976        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
7977    }
7978}
7979impl Default for CreatePaymentIntentPaymentMethodOptionsLink {
7980    fn default() -> Self {
7981        Self::new()
7982    }
7983}
7984/// Controls when the funds are captured from the customer's account.
7985///
7986/// 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.
7987///
7988/// 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.
7989#[derive(Copy, Clone, Eq, PartialEq)]
7990pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7991    Manual,
7992}
7993impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
7994    pub fn as_str(self) -> &'static str {
7995        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
7996        match self {
7997            Manual => "manual",
7998        }
7999    }
8000}
8001
8002impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8003    type Err = stripe_types::StripeParseError;
8004    fn from_str(s: &str) -> Result<Self, Self::Err> {
8005        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
8006        match s {
8007            "manual" => Ok(Manual),
8008            _ => Err(stripe_types::StripeParseError),
8009        }
8010    }
8011}
8012impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8013    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8014        f.write_str(self.as_str())
8015    }
8016}
8017
8018impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8019    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8020        f.write_str(self.as_str())
8021    }
8022}
8023impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8024    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8025    where
8026        S: serde::Serializer,
8027    {
8028        serializer.serialize_str(self.as_str())
8029    }
8030}
8031#[cfg(feature = "deserialize")]
8032impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8033    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8034        use std::str::FromStr;
8035        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8036        Self::from_str(&s).map_err(|_| {
8037            serde::de::Error::custom(
8038                "Unknown value for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod",
8039            )
8040        })
8041    }
8042}
8043/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8044///
8045/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8046/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8047///
8048/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8049///
8050/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8051///
8052/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8053#[derive(Copy, Clone, Eq, PartialEq)]
8054pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8055    None,
8056    OffSession,
8057}
8058impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8059    pub fn as_str(self) -> &'static str {
8060        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
8061        match self {
8062            None => "none",
8063            OffSession => "off_session",
8064        }
8065    }
8066}
8067
8068impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8069    type Err = stripe_types::StripeParseError;
8070    fn from_str(s: &str) -> Result<Self, Self::Err> {
8071        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
8072        match s {
8073            "none" => Ok(None),
8074            "off_session" => Ok(OffSession),
8075            _ => Err(stripe_types::StripeParseError),
8076        }
8077    }
8078}
8079impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8080    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8081        f.write_str(self.as_str())
8082    }
8083}
8084
8085impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8086    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8087        f.write_str(self.as_str())
8088    }
8089}
8090impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8092    where
8093        S: serde::Serializer,
8094    {
8095        serializer.serialize_str(self.as_str())
8096    }
8097}
8098#[cfg(feature = "deserialize")]
8099impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8100    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8101        use std::str::FromStr;
8102        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8103        Self::from_str(&s).map_err(|_| {
8104            serde::de::Error::custom(
8105                "Unknown value for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
8106            )
8107        })
8108    }
8109}
8110/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
8111#[derive(Copy, Clone, Debug, serde::Serialize)]
8112pub struct CreatePaymentIntentPaymentMethodOptionsMbWay {
8113    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8114    ///
8115    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8116    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8117    ///
8118    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8119    ///
8120    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8121    ///
8122    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8123    #[serde(skip_serializing_if = "Option::is_none")]
8124    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
8125}
8126impl CreatePaymentIntentPaymentMethodOptionsMbWay {
8127    pub fn new() -> Self {
8128        Self { setup_future_usage: None }
8129    }
8130}
8131impl Default for CreatePaymentIntentPaymentMethodOptionsMbWay {
8132    fn default() -> Self {
8133        Self::new()
8134    }
8135}
8136/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8137///
8138/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8139/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8140///
8141/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8142///
8143/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8144///
8145/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8146#[derive(Copy, Clone, Eq, PartialEq)]
8147pub enum CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8148    None,
8149}
8150impl CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8151    pub fn as_str(self) -> &'static str {
8152        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
8153        match self {
8154            None => "none",
8155        }
8156    }
8157}
8158
8159impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8160    type Err = stripe_types::StripeParseError;
8161    fn from_str(s: &str) -> Result<Self, Self::Err> {
8162        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
8163        match s {
8164            "none" => Ok(None),
8165            _ => Err(stripe_types::StripeParseError),
8166        }
8167    }
8168}
8169impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8171        f.write_str(self.as_str())
8172    }
8173}
8174
8175impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8176    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8177        f.write_str(self.as_str())
8178    }
8179}
8180impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8181    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8182    where
8183        S: serde::Serializer,
8184    {
8185        serializer.serialize_str(self.as_str())
8186    }
8187}
8188#[cfg(feature = "deserialize")]
8189impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8190    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8191        use std::str::FromStr;
8192        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8193        Self::from_str(&s).map_err(|_| {
8194            serde::de::Error::custom(
8195                "Unknown value for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
8196            )
8197        })
8198    }
8199}
8200/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
8201#[derive(Copy, Clone, Debug, serde::Serialize)]
8202pub struct CreatePaymentIntentPaymentMethodOptionsMobilepay {
8203    /// Controls when the funds are captured from the customer's account.
8204    ///
8205    /// 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.
8206    ///
8207    /// 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.
8208    #[serde(skip_serializing_if = "Option::is_none")]
8209    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
8210    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8211    ///
8212    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8213    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8214    ///
8215    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8216    ///
8217    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8218    ///
8219    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8220    #[serde(skip_serializing_if = "Option::is_none")]
8221    pub setup_future_usage:
8222        Option<CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
8223}
8224impl CreatePaymentIntentPaymentMethodOptionsMobilepay {
8225    pub fn new() -> Self {
8226        Self { capture_method: None, setup_future_usage: None }
8227    }
8228}
8229impl Default for CreatePaymentIntentPaymentMethodOptionsMobilepay {
8230    fn default() -> Self {
8231        Self::new()
8232    }
8233}
8234/// Controls when the funds are captured from the customer's account.
8235///
8236/// 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.
8237///
8238/// 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.
8239#[derive(Copy, Clone, Eq, PartialEq)]
8240pub enum CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8241    Manual,
8242}
8243impl CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8244    pub fn as_str(self) -> &'static str {
8245        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
8246        match self {
8247            Manual => "manual",
8248        }
8249    }
8250}
8251
8252impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8253    type Err = stripe_types::StripeParseError;
8254    fn from_str(s: &str) -> Result<Self, Self::Err> {
8255        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
8256        match s {
8257            "manual" => Ok(Manual),
8258            _ => Err(stripe_types::StripeParseError),
8259        }
8260    }
8261}
8262impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8263    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8264        f.write_str(self.as_str())
8265    }
8266}
8267
8268impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8269    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8270        f.write_str(self.as_str())
8271    }
8272}
8273impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8274    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8275    where
8276        S: serde::Serializer,
8277    {
8278        serializer.serialize_str(self.as_str())
8279    }
8280}
8281#[cfg(feature = "deserialize")]
8282impl<'de> serde::Deserialize<'de>
8283    for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
8284{
8285    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8286        use std::str::FromStr;
8287        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8288        Self::from_str(&s).map_err(|_| {
8289            serde::de::Error::custom(
8290                "Unknown value for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
8291            )
8292        })
8293    }
8294}
8295/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8296///
8297/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8298/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8299///
8300/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8301///
8302/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8303///
8304/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8305#[derive(Copy, Clone, Eq, PartialEq)]
8306pub enum CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8307    None,
8308}
8309impl CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8310    pub fn as_str(self) -> &'static str {
8311        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
8312        match self {
8313            None => "none",
8314        }
8315    }
8316}
8317
8318impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8319    type Err = stripe_types::StripeParseError;
8320    fn from_str(s: &str) -> Result<Self, Self::Err> {
8321        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
8322        match s {
8323            "none" => Ok(None),
8324            _ => Err(stripe_types::StripeParseError),
8325        }
8326    }
8327}
8328impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8329    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8330        f.write_str(self.as_str())
8331    }
8332}
8333
8334impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8336        f.write_str(self.as_str())
8337    }
8338}
8339impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
8340    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8341    where
8342        S: serde::Serializer,
8343    {
8344        serializer.serialize_str(self.as_str())
8345    }
8346}
8347#[cfg(feature = "deserialize")]
8348impl<'de> serde::Deserialize<'de>
8349    for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
8350{
8351    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8352        use std::str::FromStr;
8353        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8354        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
8355    }
8356}
8357/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
8358#[derive(Copy, Clone, Debug, serde::Serialize)]
8359pub struct CreatePaymentIntentPaymentMethodOptionsMultibanco {
8360    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8361    ///
8362    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8363    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8364    ///
8365    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8366    ///
8367    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8368    ///
8369    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8370    #[serde(skip_serializing_if = "Option::is_none")]
8371    pub setup_future_usage:
8372        Option<CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
8373}
8374impl CreatePaymentIntentPaymentMethodOptionsMultibanco {
8375    pub fn new() -> Self {
8376        Self { setup_future_usage: None }
8377    }
8378}
8379impl Default for CreatePaymentIntentPaymentMethodOptionsMultibanco {
8380    fn default() -> Self {
8381        Self::new()
8382    }
8383}
8384/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8385///
8386/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8387/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8388///
8389/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8390///
8391/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8392///
8393/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8394#[derive(Copy, Clone, Eq, PartialEq)]
8395pub enum CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8396    None,
8397}
8398impl CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8399    pub fn as_str(self) -> &'static str {
8400        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
8401        match self {
8402            None => "none",
8403        }
8404    }
8405}
8406
8407impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8408    type Err = stripe_types::StripeParseError;
8409    fn from_str(s: &str) -> Result<Self, Self::Err> {
8410        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
8411        match s {
8412            "none" => Ok(None),
8413            _ => Err(stripe_types::StripeParseError),
8414        }
8415    }
8416}
8417impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8419        f.write_str(self.as_str())
8420    }
8421}
8422
8423impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8424    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8425        f.write_str(self.as_str())
8426    }
8427}
8428impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
8429    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8430    where
8431        S: serde::Serializer,
8432    {
8433        serializer.serialize_str(self.as_str())
8434    }
8435}
8436#[cfg(feature = "deserialize")]
8437impl<'de> serde::Deserialize<'de>
8438    for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
8439{
8440    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8441        use std::str::FromStr;
8442        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8443        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
8444    }
8445}
8446/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
8447#[derive(Copy, Clone, Debug, serde::Serialize)]
8448pub struct CreatePaymentIntentPaymentMethodOptionsNaverPay {
8449    /// Controls when the funds are captured from the customer's account.
8450    ///
8451    /// 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.
8452    ///
8453    /// 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.
8454    #[serde(skip_serializing_if = "Option::is_none")]
8455    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
8456    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8457    ///
8458    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8459    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8460    ///
8461    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8462    ///
8463    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8464    #[serde(skip_serializing_if = "Option::is_none")]
8465    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
8466}
8467impl CreatePaymentIntentPaymentMethodOptionsNaverPay {
8468    pub fn new() -> Self {
8469        Self { capture_method: None, setup_future_usage: None }
8470    }
8471}
8472impl Default for CreatePaymentIntentPaymentMethodOptionsNaverPay {
8473    fn default() -> Self {
8474        Self::new()
8475    }
8476}
8477/// Controls when the funds are captured from the customer's account.
8478///
8479/// 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.
8480///
8481/// 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.
8482#[derive(Copy, Clone, Eq, PartialEq)]
8483pub enum CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8484    Manual,
8485}
8486impl CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8487    pub fn as_str(self) -> &'static str {
8488        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
8489        match self {
8490            Manual => "manual",
8491        }
8492    }
8493}
8494
8495impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8496    type Err = stripe_types::StripeParseError;
8497    fn from_str(s: &str) -> Result<Self, Self::Err> {
8498        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
8499        match s {
8500            "manual" => Ok(Manual),
8501            _ => Err(stripe_types::StripeParseError),
8502        }
8503    }
8504}
8505impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8506    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8507        f.write_str(self.as_str())
8508    }
8509}
8510
8511impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8512    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8513        f.write_str(self.as_str())
8514    }
8515}
8516impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8517    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8518    where
8519        S: serde::Serializer,
8520    {
8521        serializer.serialize_str(self.as_str())
8522    }
8523}
8524#[cfg(feature = "deserialize")]
8525impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
8526    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8527        use std::str::FromStr;
8528        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8529        Self::from_str(&s).map_err(|_| {
8530            serde::de::Error::custom(
8531                "Unknown value for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
8532            )
8533        })
8534    }
8535}
8536/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8537///
8538/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8539/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8540///
8541/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8542///
8543/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8544#[derive(Copy, Clone, Eq, PartialEq)]
8545pub enum CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8546    None,
8547    OffSession,
8548}
8549impl CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8550    pub fn as_str(self) -> &'static str {
8551        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
8552        match self {
8553            None => "none",
8554            OffSession => "off_session",
8555        }
8556    }
8557}
8558
8559impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8560    type Err = stripe_types::StripeParseError;
8561    fn from_str(s: &str) -> Result<Self, Self::Err> {
8562        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
8563        match s {
8564            "none" => Ok(None),
8565            "off_session" => Ok(OffSession),
8566            _ => Err(stripe_types::StripeParseError),
8567        }
8568    }
8569}
8570impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8571    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8572        f.write_str(self.as_str())
8573    }
8574}
8575
8576impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8577    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8578        f.write_str(self.as_str())
8579    }
8580}
8581impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
8582    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8583    where
8584        S: serde::Serializer,
8585    {
8586        serializer.serialize_str(self.as_str())
8587    }
8588}
8589#[cfg(feature = "deserialize")]
8590impl<'de> serde::Deserialize<'de>
8591    for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
8592{
8593    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8594        use std::str::FromStr;
8595        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8596        Self::from_str(&s).map_err(|_| {
8597            serde::de::Error::custom(
8598                "Unknown value for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage",
8599            )
8600        })
8601    }
8602}
8603/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
8604#[derive(Clone, Debug, serde::Serialize)]
8605pub struct CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8606    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8607    ///
8608    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8609    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8610    ///
8611    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8612    ///
8613    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8614    ///
8615    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8616    #[serde(skip_serializing_if = "Option::is_none")]
8617    pub setup_future_usage:
8618        Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
8619    /// Controls when Stripe will attempt to debit the funds from the customer's account.
8620    /// The date must be a string in YYYY-MM-DD format.
8621    /// The date must be in the future and between 3 and 15 calendar days from now.
8622    #[serde(skip_serializing_if = "Option::is_none")]
8623    pub target_date: Option<String>,
8624}
8625impl CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8626    pub fn new() -> Self {
8627        Self { setup_future_usage: None, target_date: None }
8628    }
8629}
8630impl Default for CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
8631    fn default() -> Self {
8632        Self::new()
8633    }
8634}
8635/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8636///
8637/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8638/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8639///
8640/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8641///
8642/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8643///
8644/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8645#[derive(Copy, Clone, Eq, PartialEq)]
8646pub enum CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8647    None,
8648    OffSession,
8649    OnSession,
8650}
8651impl CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8652    pub fn as_str(self) -> &'static str {
8653        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
8654        match self {
8655            None => "none",
8656            OffSession => "off_session",
8657            OnSession => "on_session",
8658        }
8659    }
8660}
8661
8662impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8663    type Err = stripe_types::StripeParseError;
8664    fn from_str(s: &str) -> Result<Self, Self::Err> {
8665        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
8666        match s {
8667            "none" => Ok(None),
8668            "off_session" => Ok(OffSession),
8669            "on_session" => Ok(OnSession),
8670            _ => Err(stripe_types::StripeParseError),
8671        }
8672    }
8673}
8674impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8675    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8676        f.write_str(self.as_str())
8677    }
8678}
8679
8680impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8681    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8682        f.write_str(self.as_str())
8683    }
8684}
8685impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
8686    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8687    where
8688        S: serde::Serializer,
8689    {
8690        serializer.serialize_str(self.as_str())
8691    }
8692}
8693#[cfg(feature = "deserialize")]
8694impl<'de> serde::Deserialize<'de>
8695    for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
8696{
8697    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8698        use std::str::FromStr;
8699        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8700        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
8701    }
8702}
8703/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
8704#[derive(Copy, Clone, Debug, serde::Serialize)]
8705pub struct CreatePaymentIntentPaymentMethodOptionsOxxo {
8706    /// The number of calendar days before an OXXO voucher expires.
8707    /// 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.
8708    #[serde(skip_serializing_if = "Option::is_none")]
8709    pub expires_after_days: Option<u32>,
8710    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8711    ///
8712    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8713    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8714    ///
8715    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8716    ///
8717    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8718    ///
8719    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8720    #[serde(skip_serializing_if = "Option::is_none")]
8721    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
8722}
8723impl CreatePaymentIntentPaymentMethodOptionsOxxo {
8724    pub fn new() -> Self {
8725        Self { expires_after_days: None, setup_future_usage: None }
8726    }
8727}
8728impl Default for CreatePaymentIntentPaymentMethodOptionsOxxo {
8729    fn default() -> Self {
8730        Self::new()
8731    }
8732}
8733/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8734///
8735/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8736/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8737///
8738/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8739///
8740/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8741///
8742/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8743#[derive(Copy, Clone, Eq, PartialEq)]
8744pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8745    None,
8746}
8747impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8748    pub fn as_str(self) -> &'static str {
8749        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
8750        match self {
8751            None => "none",
8752        }
8753    }
8754}
8755
8756impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8757    type Err = stripe_types::StripeParseError;
8758    fn from_str(s: &str) -> Result<Self, Self::Err> {
8759        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
8760        match s {
8761            "none" => Ok(None),
8762            _ => Err(stripe_types::StripeParseError),
8763        }
8764    }
8765}
8766impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8767    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8768        f.write_str(self.as_str())
8769    }
8770}
8771
8772impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8773    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8774        f.write_str(self.as_str())
8775    }
8776}
8777impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8778    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8779    where
8780        S: serde::Serializer,
8781    {
8782        serializer.serialize_str(self.as_str())
8783    }
8784}
8785#[cfg(feature = "deserialize")]
8786impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
8787    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8788        use std::str::FromStr;
8789        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8790        Self::from_str(&s).map_err(|_| {
8791            serde::de::Error::custom(
8792                "Unknown value for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
8793            )
8794        })
8795    }
8796}
8797/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
8798#[derive(Copy, Clone, Debug, serde::Serialize)]
8799pub struct CreatePaymentIntentPaymentMethodOptionsP24 {
8800    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8801    ///
8802    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8803    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8804    ///
8805    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8806    ///
8807    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8808    ///
8809    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8810    #[serde(skip_serializing_if = "Option::is_none")]
8811    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
8812    /// Confirm that the payer has accepted the P24 terms and conditions.
8813    #[serde(skip_serializing_if = "Option::is_none")]
8814    pub tos_shown_and_accepted: Option<bool>,
8815}
8816impl CreatePaymentIntentPaymentMethodOptionsP24 {
8817    pub fn new() -> Self {
8818        Self { setup_future_usage: None, tos_shown_and_accepted: None }
8819    }
8820}
8821impl Default for CreatePaymentIntentPaymentMethodOptionsP24 {
8822    fn default() -> Self {
8823        Self::new()
8824    }
8825}
8826/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8827///
8828/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8829/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8830///
8831/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8832///
8833/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8834///
8835/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8836#[derive(Copy, Clone, Eq, PartialEq)]
8837pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8838    None,
8839}
8840impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8841    pub fn as_str(self) -> &'static str {
8842        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
8843        match self {
8844            None => "none",
8845        }
8846    }
8847}
8848
8849impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8850    type Err = stripe_types::StripeParseError;
8851    fn from_str(s: &str) -> Result<Self, Self::Err> {
8852        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
8853        match s {
8854            "none" => Ok(None),
8855            _ => Err(stripe_types::StripeParseError),
8856        }
8857    }
8858}
8859impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8860    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8861        f.write_str(self.as_str())
8862    }
8863}
8864
8865impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8867        f.write_str(self.as_str())
8868    }
8869}
8870impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8871    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8872    where
8873        S: serde::Serializer,
8874    {
8875        serializer.serialize_str(self.as_str())
8876    }
8877}
8878#[cfg(feature = "deserialize")]
8879impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
8880    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8881        use std::str::FromStr;
8882        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8883        Self::from_str(&s).map_err(|_| {
8884            serde::de::Error::custom(
8885                "Unknown value for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
8886            )
8887        })
8888    }
8889}
8890/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
8891#[derive(Copy, Clone, Debug, serde::Serialize)]
8892pub struct CreatePaymentIntentPaymentMethodOptionsPayco {
8893    /// Controls when the funds are captured from the customer's account.
8894    ///
8895    /// 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.
8896    ///
8897    /// 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.
8898    #[serde(skip_serializing_if = "Option::is_none")]
8899    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
8900}
8901impl CreatePaymentIntentPaymentMethodOptionsPayco {
8902    pub fn new() -> Self {
8903        Self { capture_method: None }
8904    }
8905}
8906impl Default for CreatePaymentIntentPaymentMethodOptionsPayco {
8907    fn default() -> Self {
8908        Self::new()
8909    }
8910}
8911/// Controls when the funds are captured from the customer's account.
8912///
8913/// 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.
8914///
8915/// 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.
8916#[derive(Copy, Clone, Eq, PartialEq)]
8917pub enum CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8918    Manual,
8919}
8920impl CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8921    pub fn as_str(self) -> &'static str {
8922        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
8923        match self {
8924            Manual => "manual",
8925        }
8926    }
8927}
8928
8929impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8930    type Err = stripe_types::StripeParseError;
8931    fn from_str(s: &str) -> Result<Self, Self::Err> {
8932        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
8933        match s {
8934            "manual" => Ok(Manual),
8935            _ => Err(stripe_types::StripeParseError),
8936        }
8937    }
8938}
8939impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8940    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8941        f.write_str(self.as_str())
8942    }
8943}
8944
8945impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8946    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8947        f.write_str(self.as_str())
8948    }
8949}
8950impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8951    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8952    where
8953        S: serde::Serializer,
8954    {
8955        serializer.serialize_str(self.as_str())
8956    }
8957}
8958#[cfg(feature = "deserialize")]
8959impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
8960    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8961        use std::str::FromStr;
8962        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8963        Self::from_str(&s).map_err(|_| {
8964            serde::de::Error::custom(
8965                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
8966            )
8967        })
8968    }
8969}
8970/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
8971#[derive(Copy, Clone, Debug, serde::Serialize)]
8972pub struct CreatePaymentIntentPaymentMethodOptionsPaynow {
8973    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8974    ///
8975    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8976    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8977    ///
8978    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8979    ///
8980    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8981    ///
8982    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8983    #[serde(skip_serializing_if = "Option::is_none")]
8984    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
8985}
8986impl CreatePaymentIntentPaymentMethodOptionsPaynow {
8987    pub fn new() -> Self {
8988        Self { setup_future_usage: None }
8989    }
8990}
8991impl Default for CreatePaymentIntentPaymentMethodOptionsPaynow {
8992    fn default() -> Self {
8993        Self::new()
8994    }
8995}
8996/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8997///
8998/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8999/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9000///
9001/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9002///
9003/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9004///
9005/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9006#[derive(Copy, Clone, Eq, PartialEq)]
9007pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9008    None,
9009}
9010impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9011    pub fn as_str(self) -> &'static str {
9012        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
9013        match self {
9014            None => "none",
9015        }
9016    }
9017}
9018
9019impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9020    type Err = stripe_types::StripeParseError;
9021    fn from_str(s: &str) -> Result<Self, Self::Err> {
9022        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
9023        match s {
9024            "none" => Ok(None),
9025            _ => Err(stripe_types::StripeParseError),
9026        }
9027    }
9028}
9029impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9030    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9031        f.write_str(self.as_str())
9032    }
9033}
9034
9035impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9036    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9037        f.write_str(self.as_str())
9038    }
9039}
9040impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9041    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9042    where
9043        S: serde::Serializer,
9044    {
9045        serializer.serialize_str(self.as_str())
9046    }
9047}
9048#[cfg(feature = "deserialize")]
9049impl<'de> serde::Deserialize<'de>
9050    for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
9051{
9052    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9053        use std::str::FromStr;
9054        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9055        Self::from_str(&s).map_err(|_| {
9056            serde::de::Error::custom(
9057                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
9058            )
9059        })
9060    }
9061}
9062/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
9063#[derive(Clone, Debug, serde::Serialize)]
9064pub struct CreatePaymentIntentPaymentMethodOptionsPaypal {
9065    /// Controls when the funds will be captured from the customer's account.
9066    #[serde(skip_serializing_if = "Option::is_none")]
9067    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
9068    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
9069    #[serde(skip_serializing_if = "Option::is_none")]
9070    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
9071    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
9072    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
9073    #[serde(skip_serializing_if = "Option::is_none")]
9074    pub reference: Option<String>,
9075    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
9076    #[serde(skip_serializing_if = "Option::is_none")]
9077    pub risk_correlation_id: Option<String>,
9078    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9079    ///
9080    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9081    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9082    ///
9083    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9084    ///
9085    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9086    ///
9087    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9088    #[serde(skip_serializing_if = "Option::is_none")]
9089    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
9090}
9091impl CreatePaymentIntentPaymentMethodOptionsPaypal {
9092    pub fn new() -> Self {
9093        Self {
9094            capture_method: None,
9095            preferred_locale: None,
9096            reference: None,
9097            risk_correlation_id: None,
9098            setup_future_usage: None,
9099        }
9100    }
9101}
9102impl Default for CreatePaymentIntentPaymentMethodOptionsPaypal {
9103    fn default() -> Self {
9104        Self::new()
9105    }
9106}
9107/// Controls when the funds will be captured from the customer's account.
9108#[derive(Copy, Clone, Eq, PartialEq)]
9109pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9110    Manual,
9111}
9112impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9113    pub fn as_str(self) -> &'static str {
9114        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
9115        match self {
9116            Manual => "manual",
9117        }
9118    }
9119}
9120
9121impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9122    type Err = stripe_types::StripeParseError;
9123    fn from_str(s: &str) -> Result<Self, Self::Err> {
9124        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
9125        match s {
9126            "manual" => Ok(Manual),
9127            _ => Err(stripe_types::StripeParseError),
9128        }
9129    }
9130}
9131impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9132    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9133        f.write_str(self.as_str())
9134    }
9135}
9136
9137impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9138    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9139        f.write_str(self.as_str())
9140    }
9141}
9142impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9143    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9144    where
9145        S: serde::Serializer,
9146    {
9147        serializer.serialize_str(self.as_str())
9148    }
9149}
9150#[cfg(feature = "deserialize")]
9151impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9152    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9153        use std::str::FromStr;
9154        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9155        Self::from_str(&s).map_err(|_| {
9156            serde::de::Error::custom(
9157                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
9158            )
9159        })
9160    }
9161}
9162/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
9163#[derive(Clone, Eq, PartialEq)]
9164#[non_exhaustive]
9165pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9166    CsMinusCz,
9167    DaMinusDk,
9168    DeMinusAt,
9169    DeMinusDe,
9170    DeMinusLu,
9171    ElMinusGr,
9172    EnMinusGb,
9173    EnMinusUs,
9174    EsMinusEs,
9175    FiMinusFi,
9176    FrMinusBe,
9177    FrMinusFr,
9178    FrMinusLu,
9179    HuMinusHu,
9180    ItMinusIt,
9181    NlMinusBe,
9182    NlMinusNl,
9183    PlMinusPl,
9184    PtMinusPt,
9185    SkMinusSk,
9186    SvMinusSe,
9187    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9188    Unknown(String),
9189}
9190impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9191    pub fn as_str(&self) -> &str {
9192        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
9193        match self {
9194            CsMinusCz => "cs-CZ",
9195            DaMinusDk => "da-DK",
9196            DeMinusAt => "de-AT",
9197            DeMinusDe => "de-DE",
9198            DeMinusLu => "de-LU",
9199            ElMinusGr => "el-GR",
9200            EnMinusGb => "en-GB",
9201            EnMinusUs => "en-US",
9202            EsMinusEs => "es-ES",
9203            FiMinusFi => "fi-FI",
9204            FrMinusBe => "fr-BE",
9205            FrMinusFr => "fr-FR",
9206            FrMinusLu => "fr-LU",
9207            HuMinusHu => "hu-HU",
9208            ItMinusIt => "it-IT",
9209            NlMinusBe => "nl-BE",
9210            NlMinusNl => "nl-NL",
9211            PlMinusPl => "pl-PL",
9212            PtMinusPt => "pt-PT",
9213            SkMinusSk => "sk-SK",
9214            SvMinusSe => "sv-SE",
9215            Unknown(v) => v,
9216        }
9217    }
9218}
9219
9220impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9221    type Err = std::convert::Infallible;
9222    fn from_str(s: &str) -> Result<Self, Self::Err> {
9223        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
9224        match s {
9225            "cs-CZ" => Ok(CsMinusCz),
9226            "da-DK" => Ok(DaMinusDk),
9227            "de-AT" => Ok(DeMinusAt),
9228            "de-DE" => Ok(DeMinusDe),
9229            "de-LU" => Ok(DeMinusLu),
9230            "el-GR" => Ok(ElMinusGr),
9231            "en-GB" => Ok(EnMinusGb),
9232            "en-US" => Ok(EnMinusUs),
9233            "es-ES" => Ok(EsMinusEs),
9234            "fi-FI" => Ok(FiMinusFi),
9235            "fr-BE" => Ok(FrMinusBe),
9236            "fr-FR" => Ok(FrMinusFr),
9237            "fr-LU" => Ok(FrMinusLu),
9238            "hu-HU" => Ok(HuMinusHu),
9239            "it-IT" => Ok(ItMinusIt),
9240            "nl-BE" => Ok(NlMinusBe),
9241            "nl-NL" => Ok(NlMinusNl),
9242            "pl-PL" => Ok(PlMinusPl),
9243            "pt-PT" => Ok(PtMinusPt),
9244            "sk-SK" => Ok(SkMinusSk),
9245            "sv-SE" => Ok(SvMinusSe),
9246            v => Ok(Unknown(v.to_owned())),
9247        }
9248    }
9249}
9250impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9252        f.write_str(self.as_str())
9253    }
9254}
9255
9256impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9257    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9258        f.write_str(self.as_str())
9259    }
9260}
9261impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9262    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9263    where
9264        S: serde::Serializer,
9265    {
9266        serializer.serialize_str(self.as_str())
9267    }
9268}
9269#[cfg(feature = "deserialize")]
9270impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
9271    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9272        use std::str::FromStr;
9273        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9274        Ok(Self::from_str(&s).unwrap())
9275    }
9276}
9277/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9278///
9279/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9280/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9281///
9282/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9283///
9284/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9285///
9286/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9287#[derive(Copy, Clone, Eq, PartialEq)]
9288pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9289    None,
9290    OffSession,
9291}
9292impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9293    pub fn as_str(self) -> &'static str {
9294        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
9295        match self {
9296            None => "none",
9297            OffSession => "off_session",
9298        }
9299    }
9300}
9301
9302impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9303    type Err = stripe_types::StripeParseError;
9304    fn from_str(s: &str) -> Result<Self, Self::Err> {
9305        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
9306        match s {
9307            "none" => Ok(None),
9308            "off_session" => Ok(OffSession),
9309            _ => Err(stripe_types::StripeParseError),
9310        }
9311    }
9312}
9313impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9315        f.write_str(self.as_str())
9316    }
9317}
9318
9319impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9320    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9321        f.write_str(self.as_str())
9322    }
9323}
9324impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
9325    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9326    where
9327        S: serde::Serializer,
9328    {
9329        serializer.serialize_str(self.as_str())
9330    }
9331}
9332#[cfg(feature = "deserialize")]
9333impl<'de> serde::Deserialize<'de>
9334    for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
9335{
9336    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9337        use std::str::FromStr;
9338        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9339        Self::from_str(&s).map_err(|_| {
9340            serde::de::Error::custom(
9341                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
9342            )
9343        })
9344    }
9345}
9346/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
9347#[derive(Copy, Clone, Debug, serde::Serialize)]
9348pub struct CreatePaymentIntentPaymentMethodOptionsPix {
9349    /// Determines if the amount includes the IOF tax. Defaults to `never`.
9350    #[serde(skip_serializing_if = "Option::is_none")]
9351    pub amount_includes_iof: Option<CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
9352    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
9353    /// Defaults to 86400 seconds.
9354    #[serde(skip_serializing_if = "Option::is_none")]
9355    pub expires_after_seconds: Option<i64>,
9356    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
9357    /// Defaults to 1 day in the future.
9358    #[serde(skip_serializing_if = "Option::is_none")]
9359    pub expires_at: Option<stripe_types::Timestamp>,
9360    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9361    ///
9362    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9363    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9364    ///
9365    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9366    ///
9367    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9368    ///
9369    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9370    #[serde(skip_serializing_if = "Option::is_none")]
9371    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
9372}
9373impl CreatePaymentIntentPaymentMethodOptionsPix {
9374    pub fn new() -> Self {
9375        Self {
9376            amount_includes_iof: None,
9377            expires_after_seconds: None,
9378            expires_at: None,
9379            setup_future_usage: None,
9380        }
9381    }
9382}
9383impl Default for CreatePaymentIntentPaymentMethodOptionsPix {
9384    fn default() -> Self {
9385        Self::new()
9386    }
9387}
9388/// Determines if the amount includes the IOF tax. Defaults to `never`.
9389#[derive(Copy, Clone, Eq, PartialEq)]
9390pub enum CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9391    Always,
9392    Never,
9393}
9394impl CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9395    pub fn as_str(self) -> &'static str {
9396        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
9397        match self {
9398            Always => "always",
9399            Never => "never",
9400        }
9401    }
9402}
9403
9404impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9405    type Err = stripe_types::StripeParseError;
9406    fn from_str(s: &str) -> Result<Self, Self::Err> {
9407        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
9408        match s {
9409            "always" => Ok(Always),
9410            "never" => Ok(Never),
9411            _ => Err(stripe_types::StripeParseError),
9412        }
9413    }
9414}
9415impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9416    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9417        f.write_str(self.as_str())
9418    }
9419}
9420
9421impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9422    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9423        f.write_str(self.as_str())
9424    }
9425}
9426impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9427    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9428    where
9429        S: serde::Serializer,
9430    {
9431        serializer.serialize_str(self.as_str())
9432    }
9433}
9434#[cfg(feature = "deserialize")]
9435impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
9436    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9437        use std::str::FromStr;
9438        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9439        Self::from_str(&s).map_err(|_| {
9440            serde::de::Error::custom(
9441                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
9442            )
9443        })
9444    }
9445}
9446/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9447///
9448/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9449/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9450///
9451/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9452///
9453/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9454///
9455/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9456#[derive(Copy, Clone, Eq, PartialEq)]
9457pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9458    None,
9459}
9460impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9461    pub fn as_str(self) -> &'static str {
9462        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
9463        match self {
9464            None => "none",
9465        }
9466    }
9467}
9468
9469impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9470    type Err = stripe_types::StripeParseError;
9471    fn from_str(s: &str) -> Result<Self, Self::Err> {
9472        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
9473        match s {
9474            "none" => Ok(None),
9475            _ => Err(stripe_types::StripeParseError),
9476        }
9477    }
9478}
9479impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9480    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9481        f.write_str(self.as_str())
9482    }
9483}
9484
9485impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9486    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9487        f.write_str(self.as_str())
9488    }
9489}
9490impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9491    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9492    where
9493        S: serde::Serializer,
9494    {
9495        serializer.serialize_str(self.as_str())
9496    }
9497}
9498#[cfg(feature = "deserialize")]
9499impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
9500    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9501        use std::str::FromStr;
9502        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9503        Self::from_str(&s).map_err(|_| {
9504            serde::de::Error::custom(
9505                "Unknown value for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
9506            )
9507        })
9508    }
9509}
9510/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
9511#[derive(Copy, Clone, Debug, serde::Serialize)]
9512pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay {
9513    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9514    ///
9515    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9516    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9517    ///
9518    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9519    ///
9520    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9521    ///
9522    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9523    #[serde(skip_serializing_if = "Option::is_none")]
9524    pub setup_future_usage:
9525        Option<CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
9526}
9527impl CreatePaymentIntentPaymentMethodOptionsPromptpay {
9528    pub fn new() -> Self {
9529        Self { setup_future_usage: None }
9530    }
9531}
9532impl Default for CreatePaymentIntentPaymentMethodOptionsPromptpay {
9533    fn default() -> Self {
9534        Self::new()
9535    }
9536}
9537/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9538///
9539/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9540/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9541///
9542/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9543///
9544/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9545///
9546/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9547#[derive(Copy, Clone, Eq, PartialEq)]
9548pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9549    None,
9550}
9551impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9552    pub fn as_str(self) -> &'static str {
9553        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
9554        match self {
9555            None => "none",
9556        }
9557    }
9558}
9559
9560impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9561    type Err = stripe_types::StripeParseError;
9562    fn from_str(s: &str) -> Result<Self, Self::Err> {
9563        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
9564        match s {
9565            "none" => Ok(None),
9566            _ => Err(stripe_types::StripeParseError),
9567        }
9568    }
9569}
9570impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9571    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9572        f.write_str(self.as_str())
9573    }
9574}
9575
9576impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9577    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9578        f.write_str(self.as_str())
9579    }
9580}
9581impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
9582    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9583    where
9584        S: serde::Serializer,
9585    {
9586        serializer.serialize_str(self.as_str())
9587    }
9588}
9589#[cfg(feature = "deserialize")]
9590impl<'de> serde::Deserialize<'de>
9591    for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
9592{
9593    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9594        use std::str::FromStr;
9595        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9596        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
9597    }
9598}
9599/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
9600#[derive(Copy, Clone, Debug, serde::Serialize)]
9601pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9602    /// Controls when the funds are captured from the customer's account.
9603    ///
9604    /// 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.
9605    ///
9606    /// 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.
9607    #[serde(skip_serializing_if = "Option::is_none")]
9608    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
9609    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9610    ///
9611    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9612    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9613    ///
9614    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9615    ///
9616    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9617    #[serde(skip_serializing_if = "Option::is_none")]
9618    pub setup_future_usage:
9619        Option<CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
9620}
9621impl CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9622    pub fn new() -> Self {
9623        Self { capture_method: None, setup_future_usage: None }
9624    }
9625}
9626impl Default for CreatePaymentIntentPaymentMethodOptionsRevolutPay {
9627    fn default() -> Self {
9628        Self::new()
9629    }
9630}
9631/// Controls when the funds are captured from the customer's account.
9632///
9633/// 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.
9634///
9635/// 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.
9636#[derive(Copy, Clone, Eq, PartialEq)]
9637pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9638    Manual,
9639}
9640impl CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9641    pub fn as_str(self) -> &'static str {
9642        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
9643        match self {
9644            Manual => "manual",
9645        }
9646    }
9647}
9648
9649impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9650    type Err = stripe_types::StripeParseError;
9651    fn from_str(s: &str) -> Result<Self, Self::Err> {
9652        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
9653        match s {
9654            "manual" => Ok(Manual),
9655            _ => Err(stripe_types::StripeParseError),
9656        }
9657    }
9658}
9659impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9660    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9661        f.write_str(self.as_str())
9662    }
9663}
9664
9665impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9666    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9667        f.write_str(self.as_str())
9668    }
9669}
9670impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
9671    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9672    where
9673        S: serde::Serializer,
9674    {
9675        serializer.serialize_str(self.as_str())
9676    }
9677}
9678#[cfg(feature = "deserialize")]
9679impl<'de> serde::Deserialize<'de>
9680    for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
9681{
9682    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9683        use std::str::FromStr;
9684        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9685        Self::from_str(&s).map_err(|_| {
9686            serde::de::Error::custom(
9687                "Unknown value for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
9688            )
9689        })
9690    }
9691}
9692/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9693///
9694/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9695/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9696///
9697/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9698///
9699/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9700#[derive(Copy, Clone, Eq, PartialEq)]
9701pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9702    None,
9703    OffSession,
9704}
9705impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9706    pub fn as_str(self) -> &'static str {
9707        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
9708        match self {
9709            None => "none",
9710            OffSession => "off_session",
9711        }
9712    }
9713}
9714
9715impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9716    type Err = stripe_types::StripeParseError;
9717    fn from_str(s: &str) -> Result<Self, Self::Err> {
9718        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
9719        match s {
9720            "none" => Ok(None),
9721            "off_session" => Ok(OffSession),
9722            _ => Err(stripe_types::StripeParseError),
9723        }
9724    }
9725}
9726impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9727    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9728        f.write_str(self.as_str())
9729    }
9730}
9731
9732impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9733    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9734        f.write_str(self.as_str())
9735    }
9736}
9737impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
9738    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9739    where
9740        S: serde::Serializer,
9741    {
9742        serializer.serialize_str(self.as_str())
9743    }
9744}
9745#[cfg(feature = "deserialize")]
9746impl<'de> serde::Deserialize<'de>
9747    for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
9748{
9749    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9750        use std::str::FromStr;
9751        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9752        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
9753    }
9754}
9755/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
9756#[derive(Copy, Clone, Debug, serde::Serialize)]
9757pub struct CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9758    /// Controls when the funds are captured from the customer's account.
9759    ///
9760    /// 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.
9761    ///
9762    /// 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.
9763    #[serde(skip_serializing_if = "Option::is_none")]
9764    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
9765}
9766impl CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9767    pub fn new() -> Self {
9768        Self { capture_method: None }
9769    }
9770}
9771impl Default for CreatePaymentIntentPaymentMethodOptionsSamsungPay {
9772    fn default() -> Self {
9773        Self::new()
9774    }
9775}
9776/// Controls when the funds are captured from the customer's account.
9777///
9778/// 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.
9779///
9780/// 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.
9781#[derive(Copy, Clone, Eq, PartialEq)]
9782pub enum CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9783    Manual,
9784}
9785impl CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9786    pub fn as_str(self) -> &'static str {
9787        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
9788        match self {
9789            Manual => "manual",
9790        }
9791    }
9792}
9793
9794impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
9795    type Err = stripe_types::StripeParseError;
9796    fn from_str(s: &str) -> Result<Self, Self::Err> {
9797        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
9798        match s {
9799            "manual" => Ok(Manual),
9800            _ => Err(stripe_types::StripeParseError),
9801        }
9802    }
9803}
9804impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
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 CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
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 CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
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 CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
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(|_| {
9831            serde::de::Error::custom(
9832                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
9833            )
9834        })
9835    }
9836}
9837/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
9838#[derive(Copy, Clone, Debug, serde::Serialize)]
9839pub struct CreatePaymentIntentPaymentMethodOptionsSatispay {
9840    /// Controls when the funds are captured from the customer's account.
9841    ///
9842    /// 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.
9843    ///
9844    /// 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.
9845    #[serde(skip_serializing_if = "Option::is_none")]
9846    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
9847}
9848impl CreatePaymentIntentPaymentMethodOptionsSatispay {
9849    pub fn new() -> Self {
9850        Self { capture_method: None }
9851    }
9852}
9853impl Default for CreatePaymentIntentPaymentMethodOptionsSatispay {
9854    fn default() -> Self {
9855        Self::new()
9856    }
9857}
9858/// Controls when the funds are captured from the customer's account.
9859///
9860/// 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.
9861///
9862/// 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.
9863#[derive(Copy, Clone, Eq, PartialEq)]
9864pub enum CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9865    Manual,
9866}
9867impl CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9868    pub fn as_str(self) -> &'static str {
9869        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
9870        match self {
9871            Manual => "manual",
9872        }
9873    }
9874}
9875
9876impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9877    type Err = stripe_types::StripeParseError;
9878    fn from_str(s: &str) -> Result<Self, Self::Err> {
9879        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
9880        match s {
9881            "manual" => Ok(Manual),
9882            _ => Err(stripe_types::StripeParseError),
9883        }
9884    }
9885}
9886impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9887    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9888        f.write_str(self.as_str())
9889    }
9890}
9891
9892impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9893    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9894        f.write_str(self.as_str())
9895    }
9896}
9897impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9898    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9899    where
9900        S: serde::Serializer,
9901    {
9902        serializer.serialize_str(self.as_str())
9903    }
9904}
9905#[cfg(feature = "deserialize")]
9906impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
9907    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9908        use std::str::FromStr;
9909        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9910        Self::from_str(&s).map_err(|_| {
9911            serde::de::Error::custom(
9912                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
9913            )
9914        })
9915    }
9916}
9917/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
9918#[derive(Clone, Debug, serde::Serialize)]
9919pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9920    /// Additional fields for Mandate creation
9921    #[serde(skip_serializing_if = "Option::is_none")]
9922    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
9923    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9924    ///
9925    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9926    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9927    ///
9928    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9929    ///
9930    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9931    ///
9932    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9933    #[serde(skip_serializing_if = "Option::is_none")]
9934    pub setup_future_usage:
9935        Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
9936    /// Controls when Stripe will attempt to debit the funds from the customer's account.
9937    /// The date must be a string in YYYY-MM-DD format.
9938    /// The date must be in the future and between 3 and 15 calendar days from now.
9939    #[serde(skip_serializing_if = "Option::is_none")]
9940    pub target_date: Option<String>,
9941}
9942impl CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9943    pub fn new() -> Self {
9944        Self { mandate_options: None, setup_future_usage: None, target_date: None }
9945    }
9946}
9947impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebit {
9948    fn default() -> Self {
9949        Self::new()
9950    }
9951}
9952/// Additional fields for Mandate creation
9953#[derive(Clone, Debug, serde::Serialize)]
9954pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
9955    /// Prefix used to generate the Mandate reference.
9956    /// Must be at most 12 characters long.
9957    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
9958    /// Cannot begin with 'STRIPE'.
9959    #[serde(skip_serializing_if = "Option::is_none")]
9960    pub reference_prefix: Option<String>,
9961}
9962impl CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
9963    pub fn new() -> Self {
9964        Self { reference_prefix: None }
9965    }
9966}
9967impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
9968    fn default() -> Self {
9969        Self::new()
9970    }
9971}
9972/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9973///
9974/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9975/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9976///
9977/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9978///
9979/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9980///
9981/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9982#[derive(Copy, Clone, Eq, PartialEq)]
9983pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9984    None,
9985    OffSession,
9986    OnSession,
9987}
9988impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
9989    pub fn as_str(self) -> &'static str {
9990        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
9991        match self {
9992            None => "none",
9993            OffSession => "off_session",
9994            OnSession => "on_session",
9995        }
9996    }
9997}
9998
9999impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10000    type Err = stripe_types::StripeParseError;
10001    fn from_str(s: &str) -> Result<Self, Self::Err> {
10002        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
10003        match s {
10004            "none" => Ok(None),
10005            "off_session" => Ok(OffSession),
10006            "on_session" => Ok(OnSession),
10007            _ => Err(stripe_types::StripeParseError),
10008        }
10009    }
10010}
10011impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10012    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10013        f.write_str(self.as_str())
10014    }
10015}
10016
10017impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10018    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10019        f.write_str(self.as_str())
10020    }
10021}
10022impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10023    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10024    where
10025        S: serde::Serializer,
10026    {
10027        serializer.serialize_str(self.as_str())
10028    }
10029}
10030#[cfg(feature = "deserialize")]
10031impl<'de> serde::Deserialize<'de>
10032    for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
10033{
10034    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10035        use std::str::FromStr;
10036        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10037        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
10038    }
10039}
10040/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
10041#[derive(Copy, Clone, Debug, serde::Serialize)]
10042pub struct CreatePaymentIntentPaymentMethodOptionsSofort {
10043    /// Language shown to the payer on redirect.
10044    #[serde(skip_serializing_if = "Option::is_none")]
10045    pub preferred_language: Option<CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
10046    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10047    ///
10048    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10049    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10050    ///
10051    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10052    ///
10053    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10054    ///
10055    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10056    #[serde(skip_serializing_if = "Option::is_none")]
10057    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
10058}
10059impl CreatePaymentIntentPaymentMethodOptionsSofort {
10060    pub fn new() -> Self {
10061        Self { preferred_language: None, setup_future_usage: None }
10062    }
10063}
10064impl Default for CreatePaymentIntentPaymentMethodOptionsSofort {
10065    fn default() -> Self {
10066        Self::new()
10067    }
10068}
10069/// Language shown to the payer on redirect.
10070#[derive(Copy, Clone, Eq, PartialEq)]
10071pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10072    De,
10073    En,
10074    Es,
10075    Fr,
10076    It,
10077    Nl,
10078    Pl,
10079}
10080impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10081    pub fn as_str(self) -> &'static str {
10082        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
10083        match self {
10084            De => "de",
10085            En => "en",
10086            Es => "es",
10087            Fr => "fr",
10088            It => "it",
10089            Nl => "nl",
10090            Pl => "pl",
10091        }
10092    }
10093}
10094
10095impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10096    type Err = stripe_types::StripeParseError;
10097    fn from_str(s: &str) -> Result<Self, Self::Err> {
10098        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
10099        match s {
10100            "de" => Ok(De),
10101            "en" => Ok(En),
10102            "es" => Ok(Es),
10103            "fr" => Ok(Fr),
10104            "it" => Ok(It),
10105            "nl" => Ok(Nl),
10106            "pl" => Ok(Pl),
10107            _ => Err(stripe_types::StripeParseError),
10108        }
10109    }
10110}
10111impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10112    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10113        f.write_str(self.as_str())
10114    }
10115}
10116
10117impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10118    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10119        f.write_str(self.as_str())
10120    }
10121}
10122impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10123    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10124    where
10125        S: serde::Serializer,
10126    {
10127        serializer.serialize_str(self.as_str())
10128    }
10129}
10130#[cfg(feature = "deserialize")]
10131impl<'de> serde::Deserialize<'de>
10132    for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
10133{
10134    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10135        use std::str::FromStr;
10136        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10137        Self::from_str(&s).map_err(|_| {
10138            serde::de::Error::custom(
10139                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
10140            )
10141        })
10142    }
10143}
10144/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10145///
10146/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10147/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10148///
10149/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10150///
10151/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10152///
10153/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10154#[derive(Copy, Clone, Eq, PartialEq)]
10155pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10156    None,
10157    OffSession,
10158}
10159impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10160    pub fn as_str(self) -> &'static str {
10161        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
10162        match self {
10163            None => "none",
10164            OffSession => "off_session",
10165        }
10166    }
10167}
10168
10169impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10170    type Err = stripe_types::StripeParseError;
10171    fn from_str(s: &str) -> Result<Self, Self::Err> {
10172        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
10173        match s {
10174            "none" => Ok(None),
10175            "off_session" => Ok(OffSession),
10176            _ => Err(stripe_types::StripeParseError),
10177        }
10178    }
10179}
10180impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10182        f.write_str(self.as_str())
10183    }
10184}
10185
10186impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10187    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10188        f.write_str(self.as_str())
10189    }
10190}
10191impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
10192    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10193    where
10194        S: serde::Serializer,
10195    {
10196        serializer.serialize_str(self.as_str())
10197    }
10198}
10199#[cfg(feature = "deserialize")]
10200impl<'de> serde::Deserialize<'de>
10201    for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
10202{
10203    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10204        use std::str::FromStr;
10205        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10206        Self::from_str(&s).map_err(|_| {
10207            serde::de::Error::custom(
10208                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
10209            )
10210        })
10211    }
10212}
10213/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
10214#[derive(Clone, Debug, serde::Serialize)]
10215pub struct CreatePaymentIntentPaymentMethodOptionsSwish {
10216    /// A reference for this payment to be displayed in the Swish app.
10217    #[serde(skip_serializing_if = "Option::is_none")]
10218    pub reference: Option<String>,
10219    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10220    ///
10221    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10222    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10223    ///
10224    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10225    ///
10226    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10227    ///
10228    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10229    #[serde(skip_serializing_if = "Option::is_none")]
10230    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
10231}
10232impl CreatePaymentIntentPaymentMethodOptionsSwish {
10233    pub fn new() -> Self {
10234        Self { reference: None, setup_future_usage: None }
10235    }
10236}
10237impl Default for CreatePaymentIntentPaymentMethodOptionsSwish {
10238    fn default() -> Self {
10239        Self::new()
10240    }
10241}
10242/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10243///
10244/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10245/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10246///
10247/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10248///
10249/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10250///
10251/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10252#[derive(Copy, Clone, Eq, PartialEq)]
10253pub enum CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10254    None,
10255}
10256impl CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10257    pub fn as_str(self) -> &'static str {
10258        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
10259        match self {
10260            None => "none",
10261        }
10262    }
10263}
10264
10265impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10266    type Err = stripe_types::StripeParseError;
10267    fn from_str(s: &str) -> Result<Self, Self::Err> {
10268        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
10269        match s {
10270            "none" => Ok(None),
10271            _ => Err(stripe_types::StripeParseError),
10272        }
10273    }
10274}
10275impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10277        f.write_str(self.as_str())
10278    }
10279}
10280
10281impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10283        f.write_str(self.as_str())
10284    }
10285}
10286impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10287    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10288    where
10289        S: serde::Serializer,
10290    {
10291        serializer.serialize_str(self.as_str())
10292    }
10293}
10294#[cfg(feature = "deserialize")]
10295impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
10296    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10297        use std::str::FromStr;
10298        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10299        Self::from_str(&s).map_err(|_| {
10300            serde::de::Error::custom(
10301                "Unknown value for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
10302            )
10303        })
10304    }
10305}
10306/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
10307#[derive(Copy, Clone, Debug, serde::Serialize)]
10308pub struct CreatePaymentIntentPaymentMethodOptionsTwint {
10309    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10310    ///
10311    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10312    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10313    ///
10314    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10315    ///
10316    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10317    ///
10318    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10319    #[serde(skip_serializing_if = "Option::is_none")]
10320    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
10321}
10322impl CreatePaymentIntentPaymentMethodOptionsTwint {
10323    pub fn new() -> Self {
10324        Self { setup_future_usage: None }
10325    }
10326}
10327impl Default for CreatePaymentIntentPaymentMethodOptionsTwint {
10328    fn default() -> Self {
10329        Self::new()
10330    }
10331}
10332/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10333///
10334/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10335/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10336///
10337/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10338///
10339/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10340///
10341/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10342#[derive(Copy, Clone, Eq, PartialEq)]
10343pub enum CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10344    None,
10345}
10346impl CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10347    pub fn as_str(self) -> &'static str {
10348        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
10349        match self {
10350            None => "none",
10351        }
10352    }
10353}
10354
10355impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10356    type Err = stripe_types::StripeParseError;
10357    fn from_str(s: &str) -> Result<Self, Self::Err> {
10358        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
10359        match s {
10360            "none" => Ok(None),
10361            _ => Err(stripe_types::StripeParseError),
10362        }
10363    }
10364}
10365impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10366    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10367        f.write_str(self.as_str())
10368    }
10369}
10370
10371impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10372    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10373        f.write_str(self.as_str())
10374    }
10375}
10376impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10377    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10378    where
10379        S: serde::Serializer,
10380    {
10381        serializer.serialize_str(self.as_str())
10382    }
10383}
10384#[cfg(feature = "deserialize")]
10385impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
10386    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10387        use std::str::FromStr;
10388        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10389        Self::from_str(&s).map_err(|_| {
10390            serde::de::Error::custom(
10391                "Unknown value for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
10392            )
10393        })
10394    }
10395}
10396/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
10397#[derive(Clone, Debug, serde::Serialize)]
10398pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10399    /// Additional fields for Financial Connections Session creation
10400    #[serde(skip_serializing_if = "Option::is_none")]
10401    pub financial_connections:
10402        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
10403    /// Additional fields for Mandate creation
10404    #[serde(skip_serializing_if = "Option::is_none")]
10405    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
10406    /// Additional fields for network related functions
10407    #[serde(skip_serializing_if = "Option::is_none")]
10408    pub networks: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
10409    /// Preferred transaction settlement speed
10410    #[serde(skip_serializing_if = "Option::is_none")]
10411    pub preferred_settlement_speed:
10412        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
10413    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10414    ///
10415    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10416    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10417    ///
10418    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10419    ///
10420    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10421    ///
10422    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10423    #[serde(skip_serializing_if = "Option::is_none")]
10424    pub setup_future_usage:
10425        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
10426    /// Controls when Stripe will attempt to debit the funds from the customer's account.
10427    /// The date must be a string in YYYY-MM-DD format.
10428    /// The date must be in the future and between 3 and 15 calendar days from now.
10429    #[serde(skip_serializing_if = "Option::is_none")]
10430    pub target_date: Option<String>,
10431    /// Bank account verification method.
10432    #[serde(skip_serializing_if = "Option::is_none")]
10433    pub verification_method:
10434        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
10435}
10436impl CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10437    pub fn new() -> Self {
10438        Self {
10439            financial_connections: None,
10440            mandate_options: None,
10441            networks: None,
10442            preferred_settlement_speed: None,
10443            setup_future_usage: None,
10444            target_date: None,
10445            verification_method: None,
10446        }
10447    }
10448}
10449impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
10450    fn default() -> Self {
10451        Self::new()
10452    }
10453}
10454/// Additional fields for Financial Connections Session creation
10455#[derive(Clone, Debug, serde::Serialize)]
10456pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10457    /// Provide filters for the linked accounts that the customer can select for the payment method.
10458    #[serde(skip_serializing_if = "Option::is_none")]
10459    pub filters:
10460        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
10461    /// The list of permissions to request.
10462    /// If this parameter is passed, the `payment_method` permission must be included.
10463    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
10464    #[serde(skip_serializing_if = "Option::is_none")]
10465    pub permissions: Option<
10466        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
10467    >,
10468    /// List of data features that you would like to retrieve upon account creation.
10469    #[serde(skip_serializing_if = "Option::is_none")]
10470    pub prefetch: Option<
10471        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
10472    >,
10473    /// For webview integrations only.
10474    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
10475    #[serde(skip_serializing_if = "Option::is_none")]
10476    pub return_url: Option<String>,
10477}
10478impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10479    pub fn new() -> Self {
10480        Self { filters: None, permissions: None, prefetch: None, return_url: None }
10481    }
10482}
10483impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
10484    fn default() -> Self {
10485        Self::new()
10486    }
10487}
10488/// Provide filters for the linked accounts that the customer can select for the payment method.
10489#[derive(Clone, Debug, serde::Serialize)]
10490pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10491        /// The account subcategories to use to filter for selectable accounts.
10492    /// Valid subcategories are `checking` and `savings`.
10493#[serde(skip_serializing_if = "Option::is_none")]
10494pub account_subcategories: Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
10495
10496}
10497impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10498    pub fn new() -> Self {
10499        Self { account_subcategories: None }
10500    }
10501}
10502impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
10503    fn default() -> Self {
10504        Self::new()
10505    }
10506}
10507/// The account subcategories to use to filter for selectable accounts.
10508/// Valid subcategories are `checking` and `savings`.
10509#[derive(Copy, Clone, Eq, PartialEq)]
10510pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
10511{
10512    Checking,
10513    Savings,
10514}
10515impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10516    pub fn as_str(self) -> &'static str {
10517        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
10518        match self {
10519Checking => "checking",
10520Savings => "savings",
10521
10522        }
10523    }
10524}
10525
10526impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10527    type Err = stripe_types::StripeParseError;
10528    fn from_str(s: &str) -> Result<Self, Self::Err> {
10529        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
10530        match s {
10531    "checking" => Ok(Checking),
10532"savings" => Ok(Savings),
10533_ => Err(stripe_types::StripeParseError)
10534
10535        }
10536    }
10537}
10538impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10539    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10540        f.write_str(self.as_str())
10541    }
10542}
10543
10544impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10545    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10546        f.write_str(self.as_str())
10547    }
10548}
10549impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10550    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
10551        serializer.serialize_str(self.as_str())
10552    }
10553}
10554#[cfg(feature = "deserialize")]
10555impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
10556    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10557        use std::str::FromStr;
10558        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10559        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
10560    }
10561}
10562/// The list of permissions to request.
10563/// If this parameter is passed, the `payment_method` permission must be included.
10564/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
10565#[derive(Copy, Clone, Eq, PartialEq)]
10566pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
10567    Balances,
10568    Ownership,
10569    PaymentMethod,
10570    Transactions,
10571}
10572impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
10573    pub fn as_str(self) -> &'static str {
10574        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
10575        match self {
10576            Balances => "balances",
10577            Ownership => "ownership",
10578            PaymentMethod => "payment_method",
10579            Transactions => "transactions",
10580        }
10581    }
10582}
10583
10584impl std::str::FromStr
10585    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10586{
10587    type Err = stripe_types::StripeParseError;
10588    fn from_str(s: &str) -> Result<Self, Self::Err> {
10589        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
10590        match s {
10591            "balances" => Ok(Balances),
10592            "ownership" => Ok(Ownership),
10593            "payment_method" => Ok(PaymentMethod),
10594            "transactions" => Ok(Transactions),
10595            _ => Err(stripe_types::StripeParseError),
10596        }
10597    }
10598}
10599impl std::fmt::Display
10600    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10601{
10602    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10603        f.write_str(self.as_str())
10604    }
10605}
10606
10607impl std::fmt::Debug
10608    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10609{
10610    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10611        f.write_str(self.as_str())
10612    }
10613}
10614impl serde::Serialize
10615    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10616{
10617    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10618    where
10619        S: serde::Serializer,
10620    {
10621        serializer.serialize_str(self.as_str())
10622    }
10623}
10624#[cfg(feature = "deserialize")]
10625impl<'de> serde::Deserialize<'de>
10626    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
10627{
10628    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10629        use std::str::FromStr;
10630        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10631        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
10632    }
10633}
10634/// List of data features that you would like to retrieve upon account creation.
10635#[derive(Copy, Clone, Eq, PartialEq)]
10636pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
10637    Balances,
10638    Ownership,
10639    Transactions,
10640}
10641impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
10642    pub fn as_str(self) -> &'static str {
10643        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
10644        match self {
10645            Balances => "balances",
10646            Ownership => "ownership",
10647            Transactions => "transactions",
10648        }
10649    }
10650}
10651
10652impl std::str::FromStr
10653    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10654{
10655    type Err = stripe_types::StripeParseError;
10656    fn from_str(s: &str) -> Result<Self, Self::Err> {
10657        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
10658        match s {
10659            "balances" => Ok(Balances),
10660            "ownership" => Ok(Ownership),
10661            "transactions" => Ok(Transactions),
10662            _ => Err(stripe_types::StripeParseError),
10663        }
10664    }
10665}
10666impl std::fmt::Display
10667    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10668{
10669    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10670        f.write_str(self.as_str())
10671    }
10672}
10673
10674impl std::fmt::Debug
10675    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10676{
10677    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10678        f.write_str(self.as_str())
10679    }
10680}
10681impl serde::Serialize
10682    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10683{
10684    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10685    where
10686        S: serde::Serializer,
10687    {
10688        serializer.serialize_str(self.as_str())
10689    }
10690}
10691#[cfg(feature = "deserialize")]
10692impl<'de> serde::Deserialize<'de>
10693    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
10694{
10695    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10696        use std::str::FromStr;
10697        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10698        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
10699    }
10700}
10701/// Additional fields for Mandate creation
10702#[derive(Copy, Clone, Debug, serde::Serialize)]
10703pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10704    /// The method used to collect offline mandate customer acceptance.
10705    #[serde(skip_serializing_if = "Option::is_none")]
10706    pub collection_method:
10707        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
10708}
10709impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10710    pub fn new() -> Self {
10711        Self { collection_method: None }
10712    }
10713}
10714impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
10715    fn default() -> Self {
10716        Self::new()
10717    }
10718}
10719/// The method used to collect offline mandate customer acceptance.
10720#[derive(Copy, Clone, Eq, PartialEq)]
10721pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
10722    Paper,
10723}
10724impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
10725    pub fn as_str(self) -> &'static str {
10726        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
10727        match self {
10728            Paper => "paper",
10729        }
10730    }
10731}
10732
10733impl std::str::FromStr
10734    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10735{
10736    type Err = stripe_types::StripeParseError;
10737    fn from_str(s: &str) -> Result<Self, Self::Err> {
10738        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
10739        match s {
10740            "paper" => Ok(Paper),
10741            _ => Err(stripe_types::StripeParseError),
10742        }
10743    }
10744}
10745impl std::fmt::Display
10746    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10747{
10748    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10749        f.write_str(self.as_str())
10750    }
10751}
10752
10753impl std::fmt::Debug
10754    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10755{
10756    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10757        f.write_str(self.as_str())
10758    }
10759}
10760impl serde::Serialize
10761    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10762{
10763    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10764    where
10765        S: serde::Serializer,
10766    {
10767        serializer.serialize_str(self.as_str())
10768    }
10769}
10770#[cfg(feature = "deserialize")]
10771impl<'de> serde::Deserialize<'de>
10772    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
10773{
10774    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10775        use std::str::FromStr;
10776        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10777        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
10778    }
10779}
10780/// Additional fields for network related functions
10781#[derive(Clone, Debug, serde::Serialize)]
10782pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10783    /// Triggers validations to run across the selected networks
10784    #[serde(skip_serializing_if = "Option::is_none")]
10785    pub requested:
10786        Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
10787}
10788impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10789    pub fn new() -> Self {
10790        Self { requested: None }
10791    }
10792}
10793impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
10794    fn default() -> Self {
10795        Self::new()
10796    }
10797}
10798/// Triggers validations to run across the selected networks
10799#[derive(Copy, Clone, Eq, PartialEq)]
10800pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10801    Ach,
10802    UsDomesticWire,
10803}
10804impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10805    pub fn as_str(self) -> &'static str {
10806        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
10807        match self {
10808            Ach => "ach",
10809            UsDomesticWire => "us_domestic_wire",
10810        }
10811    }
10812}
10813
10814impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10815    type Err = stripe_types::StripeParseError;
10816    fn from_str(s: &str) -> Result<Self, Self::Err> {
10817        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
10818        match s {
10819            "ach" => Ok(Ach),
10820            "us_domestic_wire" => Ok(UsDomesticWire),
10821            _ => Err(stripe_types::StripeParseError),
10822        }
10823    }
10824}
10825impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
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 for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10832    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10833        f.write_str(self.as_str())
10834    }
10835}
10836impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
10837    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10838    where
10839        S: serde::Serializer,
10840    {
10841        serializer.serialize_str(self.as_str())
10842    }
10843}
10844#[cfg(feature = "deserialize")]
10845impl<'de> serde::Deserialize<'de>
10846    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
10847{
10848    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10849        use std::str::FromStr;
10850        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10851        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
10852    }
10853}
10854/// Preferred transaction settlement speed
10855#[derive(Copy, Clone, Eq, PartialEq)]
10856pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
10857    Fastest,
10858    Standard,
10859}
10860impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
10861    pub fn as_str(self) -> &'static str {
10862        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
10863        match self {
10864            Fastest => "fastest",
10865            Standard => "standard",
10866        }
10867    }
10868}
10869
10870impl std::str::FromStr
10871    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10872{
10873    type Err = stripe_types::StripeParseError;
10874    fn from_str(s: &str) -> Result<Self, Self::Err> {
10875        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
10876        match s {
10877            "fastest" => Ok(Fastest),
10878            "standard" => Ok(Standard),
10879            _ => Err(stripe_types::StripeParseError),
10880        }
10881    }
10882}
10883impl std::fmt::Display
10884    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10885{
10886    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10887        f.write_str(self.as_str())
10888    }
10889}
10890
10891impl std::fmt::Debug
10892    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10893{
10894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10895        f.write_str(self.as_str())
10896    }
10897}
10898impl serde::Serialize
10899    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10900{
10901    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10902    where
10903        S: serde::Serializer,
10904    {
10905        serializer.serialize_str(self.as_str())
10906    }
10907}
10908#[cfg(feature = "deserialize")]
10909impl<'de> serde::Deserialize<'de>
10910    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
10911{
10912    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10913        use std::str::FromStr;
10914        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10915        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
10916    }
10917}
10918/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10919///
10920/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10921/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10922///
10923/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10924///
10925/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10926///
10927/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10928#[derive(Copy, Clone, Eq, PartialEq)]
10929pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10930    None,
10931    OffSession,
10932    OnSession,
10933}
10934impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10935    pub fn as_str(self) -> &'static str {
10936        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
10937        match self {
10938            None => "none",
10939            OffSession => "off_session",
10940            OnSession => "on_session",
10941        }
10942    }
10943}
10944
10945impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10946    type Err = stripe_types::StripeParseError;
10947    fn from_str(s: &str) -> Result<Self, Self::Err> {
10948        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
10949        match s {
10950            "none" => Ok(None),
10951            "off_session" => Ok(OffSession),
10952            "on_session" => Ok(OnSession),
10953            _ => Err(stripe_types::StripeParseError),
10954        }
10955    }
10956}
10957impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10958    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10959        f.write_str(self.as_str())
10960    }
10961}
10962
10963impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10964    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10965        f.write_str(self.as_str())
10966    }
10967}
10968impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
10969    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10970    where
10971        S: serde::Serializer,
10972    {
10973        serializer.serialize_str(self.as_str())
10974    }
10975}
10976#[cfg(feature = "deserialize")]
10977impl<'de> serde::Deserialize<'de>
10978    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
10979{
10980    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10981        use std::str::FromStr;
10982        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10983        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
10984    }
10985}
10986/// Bank account verification method.
10987#[derive(Copy, Clone, Eq, PartialEq)]
10988pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10989    Automatic,
10990    Instant,
10991    Microdeposits,
10992}
10993impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
10994    pub fn as_str(self) -> &'static str {
10995        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
10996        match self {
10997            Automatic => "automatic",
10998            Instant => "instant",
10999            Microdeposits => "microdeposits",
11000        }
11001    }
11002}
11003
11004impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11005    type Err = stripe_types::StripeParseError;
11006    fn from_str(s: &str) -> Result<Self, Self::Err> {
11007        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
11008        match s {
11009            "automatic" => Ok(Automatic),
11010            "instant" => Ok(Instant),
11011            "microdeposits" => Ok(Microdeposits),
11012            _ => Err(stripe_types::StripeParseError),
11013        }
11014    }
11015}
11016impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11017    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11018        f.write_str(self.as_str())
11019    }
11020}
11021
11022impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11023    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11024        f.write_str(self.as_str())
11025    }
11026}
11027impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
11028    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11029    where
11030        S: serde::Serializer,
11031    {
11032        serializer.serialize_str(self.as_str())
11033    }
11034}
11035#[cfg(feature = "deserialize")]
11036impl<'de> serde::Deserialize<'de>
11037    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
11038{
11039    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11040        use std::str::FromStr;
11041        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11042        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
11043    }
11044}
11045/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
11046#[derive(Clone, Debug, serde::Serialize)]
11047pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay {
11048    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
11049    #[serde(skip_serializing_if = "Option::is_none")]
11050    pub app_id: Option<String>,
11051    /// The client type that the end customer will pay from
11052    #[serde(skip_serializing_if = "Option::is_none")]
11053    pub client: Option<CreatePaymentIntentPaymentMethodOptionsWechatPayClient>,
11054    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11055    ///
11056    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11057    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11058    ///
11059    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11060    ///
11061    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11062    ///
11063    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11064    #[serde(skip_serializing_if = "Option::is_none")]
11065    pub setup_future_usage:
11066        Option<CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
11067}
11068impl CreatePaymentIntentPaymentMethodOptionsWechatPay {
11069    pub fn new() -> Self {
11070        Self { app_id: None, client: None, setup_future_usage: None }
11071    }
11072}
11073impl Default for CreatePaymentIntentPaymentMethodOptionsWechatPay {
11074    fn default() -> Self {
11075        Self::new()
11076    }
11077}
11078/// The client type that the end customer will pay from
11079#[derive(Copy, Clone, Eq, PartialEq)]
11080pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11081    Android,
11082    Ios,
11083    Web,
11084}
11085impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11086    pub fn as_str(self) -> &'static str {
11087        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
11088        match self {
11089            Android => "android",
11090            Ios => "ios",
11091            Web => "web",
11092        }
11093    }
11094}
11095
11096impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11097    type Err = stripe_types::StripeParseError;
11098    fn from_str(s: &str) -> Result<Self, Self::Err> {
11099        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
11100        match s {
11101            "android" => Ok(Android),
11102            "ios" => Ok(Ios),
11103            "web" => Ok(Web),
11104            _ => Err(stripe_types::StripeParseError),
11105        }
11106    }
11107}
11108impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11109    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11110        f.write_str(self.as_str())
11111    }
11112}
11113
11114impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11116        f.write_str(self.as_str())
11117    }
11118}
11119impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11120    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11121    where
11122        S: serde::Serializer,
11123    {
11124        serializer.serialize_str(self.as_str())
11125    }
11126}
11127#[cfg(feature = "deserialize")]
11128impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
11129    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11130        use std::str::FromStr;
11131        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11132        Self::from_str(&s).map_err(|_| {
11133            serde::de::Error::custom(
11134                "Unknown value for CreatePaymentIntentPaymentMethodOptionsWechatPayClient",
11135            )
11136        })
11137    }
11138}
11139/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11140///
11141/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11142/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11143///
11144/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11145///
11146/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11147///
11148/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11149#[derive(Copy, Clone, Eq, PartialEq)]
11150pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11151    None,
11152}
11153impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11154    pub fn as_str(self) -> &'static str {
11155        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
11156        match self {
11157            None => "none",
11158        }
11159    }
11160}
11161
11162impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11163    type Err = stripe_types::StripeParseError;
11164    fn from_str(s: &str) -> Result<Self, Self::Err> {
11165        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
11166        match s {
11167            "none" => Ok(None),
11168            _ => Err(stripe_types::StripeParseError),
11169        }
11170    }
11171}
11172impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11173    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11174        f.write_str(self.as_str())
11175    }
11176}
11177
11178impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11179    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11180        f.write_str(self.as_str())
11181    }
11182}
11183impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
11184    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11185    where
11186        S: serde::Serializer,
11187    {
11188        serializer.serialize_str(self.as_str())
11189    }
11190}
11191#[cfg(feature = "deserialize")]
11192impl<'de> serde::Deserialize<'de>
11193    for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
11194{
11195    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11196        use std::str::FromStr;
11197        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11198        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
11199    }
11200}
11201/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
11202#[derive(Copy, Clone, Debug, serde::Serialize)]
11203pub struct CreatePaymentIntentPaymentMethodOptionsZip {
11204    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11205    ///
11206    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11207    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11208    ///
11209    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11210    ///
11211    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11212    ///
11213    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11214    #[serde(skip_serializing_if = "Option::is_none")]
11215    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
11216}
11217impl CreatePaymentIntentPaymentMethodOptionsZip {
11218    pub fn new() -> Self {
11219        Self { setup_future_usage: None }
11220    }
11221}
11222impl Default for CreatePaymentIntentPaymentMethodOptionsZip {
11223    fn default() -> Self {
11224        Self::new()
11225    }
11226}
11227/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11228///
11229/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11230/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11231///
11232/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11233///
11234/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11235///
11236/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11237#[derive(Copy, Clone, Eq, PartialEq)]
11238pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11239    None,
11240}
11241impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11242    pub fn as_str(self) -> &'static str {
11243        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
11244        match self {
11245            None => "none",
11246        }
11247    }
11248}
11249
11250impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11251    type Err = stripe_types::StripeParseError;
11252    fn from_str(s: &str) -> Result<Self, Self::Err> {
11253        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
11254        match s {
11255            "none" => Ok(None),
11256            _ => Err(stripe_types::StripeParseError),
11257        }
11258    }
11259}
11260impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11261    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11262        f.write_str(self.as_str())
11263    }
11264}
11265
11266impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11268        f.write_str(self.as_str())
11269    }
11270}
11271impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11272    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11273    where
11274        S: serde::Serializer,
11275    {
11276        serializer.serialize_str(self.as_str())
11277    }
11278}
11279#[cfg(feature = "deserialize")]
11280impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
11281    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11282        use std::str::FromStr;
11283        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11284        Self::from_str(&s).map_err(|_| {
11285            serde::de::Error::custom(
11286                "Unknown value for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
11287            )
11288        })
11289    }
11290}
11291/// Options to configure Radar.
11292/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
11293#[derive(Clone, Debug, serde::Serialize)]
11294pub struct CreatePaymentIntentRadarOptions {
11295    /// 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.
11296    #[serde(skip_serializing_if = "Option::is_none")]
11297    pub session: Option<String>,
11298}
11299impl CreatePaymentIntentRadarOptions {
11300    pub fn new() -> Self {
11301        Self { session: None }
11302    }
11303}
11304impl Default for CreatePaymentIntentRadarOptions {
11305    fn default() -> Self {
11306        Self::new()
11307    }
11308}
11309/// Shipping information for this PaymentIntent.
11310#[derive(Clone, Debug, serde::Serialize)]
11311pub struct CreatePaymentIntentShipping {
11312    /// Shipping address.
11313    pub address: CreatePaymentIntentShippingAddress,
11314    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
11315    #[serde(skip_serializing_if = "Option::is_none")]
11316    pub carrier: Option<String>,
11317    /// Recipient name.
11318    pub name: String,
11319    /// Recipient phone (including extension).
11320    #[serde(skip_serializing_if = "Option::is_none")]
11321    pub phone: Option<String>,
11322    /// The tracking number for a physical product, obtained from the delivery service.
11323    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
11324    #[serde(skip_serializing_if = "Option::is_none")]
11325    pub tracking_number: Option<String>,
11326}
11327impl CreatePaymentIntentShipping {
11328    pub fn new(
11329        address: impl Into<CreatePaymentIntentShippingAddress>,
11330        name: impl Into<String>,
11331    ) -> Self {
11332        Self {
11333            address: address.into(),
11334            carrier: None,
11335            name: name.into(),
11336            phone: None,
11337            tracking_number: None,
11338        }
11339    }
11340}
11341/// Shipping address.
11342#[derive(Clone, Debug, serde::Serialize)]
11343pub struct CreatePaymentIntentShippingAddress {
11344    /// City, district, suburb, town, or village.
11345    #[serde(skip_serializing_if = "Option::is_none")]
11346    pub city: Option<String>,
11347    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
11348    #[serde(skip_serializing_if = "Option::is_none")]
11349    pub country: Option<String>,
11350    /// Address line 1, such as the street, PO Box, or company name.
11351    #[serde(skip_serializing_if = "Option::is_none")]
11352    pub line1: Option<String>,
11353    /// Address line 2, such as the apartment, suite, unit, or building.
11354    #[serde(skip_serializing_if = "Option::is_none")]
11355    pub line2: Option<String>,
11356    /// ZIP or postal code.
11357    #[serde(skip_serializing_if = "Option::is_none")]
11358    pub postal_code: Option<String>,
11359    /// State, county, province, or region.
11360    #[serde(skip_serializing_if = "Option::is_none")]
11361    pub state: Option<String>,
11362}
11363impl CreatePaymentIntentShippingAddress {
11364    pub fn new() -> Self {
11365        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
11366    }
11367}
11368impl Default for CreatePaymentIntentShippingAddress {
11369    fn default() -> Self {
11370        Self::new()
11371    }
11372}
11373/// The parameters that you can use to automatically create a Transfer.
11374/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11375#[derive(Clone, Debug, serde::Serialize)]
11376pub struct CreatePaymentIntentTransferData {
11377    /// The amount that will be transferred automatically when a charge succeeds.
11378    /// The amount is capped at the total transaction amount and if no amount is set,
11379    /// the full amount is transferred.
11380    ///
11381    /// If you intend to collect a fee and you need a more robust reporting experience, using
11382    /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount).
11383    /// might be a better fit for your integration.
11384    #[serde(skip_serializing_if = "Option::is_none")]
11385    pub amount: Option<i64>,
11386    /// If specified, successful charges will be attributed to the destination
11387    /// account for tax reporting, and the funds from charges will be transferred
11388    /// to the destination account. The ID of the resulting transfer will be
11389    /// returned on the successful charge's `transfer` field.
11390    pub destination: String,
11391}
11392impl CreatePaymentIntentTransferData {
11393    pub fn new(destination: impl Into<String>) -> Self {
11394        Self { amount: None, destination: destination.into() }
11395    }
11396}
11397/// Creates a PaymentIntent object.
11398///
11399/// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm).
11400/// to continue the payment. Learn more about [the available payment flows
11401/// with the Payment Intents API](https://stripe.com/docs/payments/payment-intents).
11402///
11403/// When you use `confirm=true` during creation, it’s equivalent to creating
11404/// and confirming the PaymentIntent in the same call. You can use any parameters
11405/// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
11406/// `confirm=true`.
11407#[derive(Clone, Debug, serde::Serialize)]
11408pub struct CreatePaymentIntent {
11409    inner: CreatePaymentIntentBuilder,
11410}
11411impl CreatePaymentIntent {
11412    /// Construct a new `CreatePaymentIntent`.
11413    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
11414        Self { inner: CreatePaymentIntentBuilder::new(amount.into(), currency.into()) }
11415    }
11416    /// Provides industry-specific information about the amount.
11417    pub fn amount_details(
11418        mut self,
11419        amount_details: impl Into<CreatePaymentIntentAmountDetails>,
11420    ) -> Self {
11421        self.inner.amount_details = Some(amount_details.into());
11422        self
11423    }
11424    /// 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.
11425    /// The amount of the application fee collected will be capped at the total amount captured.
11426    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11427    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
11428        self.inner.application_fee_amount = Some(application_fee_amount.into());
11429        self
11430    }
11431    /// 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.
11432    pub fn automatic_payment_methods(
11433        mut self,
11434        automatic_payment_methods: impl Into<CreatePaymentIntentAutomaticPaymentMethods>,
11435    ) -> Self {
11436        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
11437        self
11438    }
11439    /// Controls when the funds will be captured from the customer's account.
11440    pub fn capture_method(
11441        mut self,
11442        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
11443    ) -> Self {
11444        self.inner.capture_method = Some(capture_method.into());
11445        self
11446    }
11447    /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately.
11448    /// This parameter defaults to `false`.
11449    /// 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).
11450    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
11451        self.inner.confirm = Some(confirm.into());
11452        self
11453    }
11454    /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
11455    pub fn confirmation_method(
11456        mut self,
11457        confirmation_method: impl Into<stripe_shared::PaymentIntentConfirmationMethod>,
11458    ) -> Self {
11459        self.inner.confirmation_method = Some(confirmation_method.into());
11460        self
11461    }
11462    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
11463    ///
11464    /// 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.
11465    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
11466        self.inner.confirmation_token = Some(confirmation_token.into());
11467        self
11468    }
11469    /// ID of the Customer this PaymentIntent belongs to, if one exists.
11470    ///
11471    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
11472    ///
11473    /// 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.
11474    /// 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.
11475    pub fn customer(mut self, customer: impl Into<String>) -> Self {
11476        self.inner.customer = Some(customer.into());
11477        self
11478    }
11479    /// An arbitrary string attached to the object. Often useful for displaying to users.
11480    pub fn description(mut self, description: impl Into<String>) -> Self {
11481        self.inner.description = Some(description.into());
11482        self
11483    }
11484    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
11485    /// 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).
11486    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11487    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
11488        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
11489        self
11490    }
11491    /// The list of payment method types to exclude from use with this payment.
11492    pub fn excluded_payment_method_types(
11493        mut self,
11494        excluded_payment_method_types: impl Into<
11495            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
11496        >,
11497    ) -> Self {
11498        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
11499        self
11500    }
11501    /// Specifies which fields in the response should be expanded.
11502    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
11503        self.inner.expand = Some(expand.into());
11504        self
11505    }
11506    /// ID of the mandate that's used for this payment.
11507    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11508    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
11509        self.inner.mandate = Some(mandate.into());
11510        self
11511    }
11512    /// This hash contains details about the Mandate to create.
11513    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11514    pub fn mandate_data(mut self, mandate_data: impl Into<CreatePaymentIntentMandateData>) -> Self {
11515        self.inner.mandate_data = Some(mandate_data.into());
11516        self
11517    }
11518    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
11519    /// This can be useful for storing additional information about the object in a structured format.
11520    /// Individual keys can be unset by posting an empty value to them.
11521    /// All keys can be unset by posting an empty value to `metadata`.
11522    pub fn metadata(
11523        mut self,
11524        metadata: impl Into<std::collections::HashMap<String, String>>,
11525    ) -> Self {
11526        self.inner.metadata = Some(metadata.into());
11527        self
11528    }
11529    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
11530    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
11531    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11532    pub fn off_session(mut self, off_session: impl Into<CreatePaymentIntentOffSession>) -> Self {
11533        self.inner.off_session = Some(off_session.into());
11534        self
11535    }
11536    /// The Stripe account ID that these funds are intended for.
11537    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11538    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
11539        self.inner.on_behalf_of = Some(on_behalf_of.into());
11540        self
11541    }
11542    /// Provides industry-specific information about the charge.
11543    pub fn payment_details(
11544        mut self,
11545        payment_details: impl Into<CreatePaymentIntentPaymentDetails>,
11546    ) -> Self {
11547        self.inner.payment_details = Some(payment_details.into());
11548        self
11549    }
11550    /// 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.
11551    ///
11552    /// 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.
11553    /// We recommend that you explicitly provide the `payment_method` moving forward.
11554    /// 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.
11555    /// end
11556    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
11557        self.inner.payment_method = Some(payment_method.into());
11558        self
11559    }
11560    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
11561    pub fn payment_method_configuration(
11562        mut self,
11563        payment_method_configuration: impl Into<String>,
11564    ) -> Self {
11565        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
11566        self
11567    }
11568    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
11569    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
11570    /// property on the PaymentIntent.
11571    pub fn payment_method_data(
11572        mut self,
11573        payment_method_data: impl Into<CreatePaymentIntentPaymentMethodData>,
11574    ) -> Self {
11575        self.inner.payment_method_data = Some(payment_method_data.into());
11576        self
11577    }
11578    /// Payment method-specific configuration for this PaymentIntent.
11579    pub fn payment_method_options(
11580        mut self,
11581        payment_method_options: impl Into<CreatePaymentIntentPaymentMethodOptions>,
11582    ) -> Self {
11583        self.inner.payment_method_options = Some(payment_method_options.into());
11584        self
11585    }
11586    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
11587    /// 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).
11588    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
11589    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
11590        self.inner.payment_method_types = Some(payment_method_types.into());
11591        self
11592    }
11593    /// Options to configure Radar.
11594    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
11595    pub fn radar_options(
11596        mut self,
11597        radar_options: impl Into<CreatePaymentIntentRadarOptions>,
11598    ) -> Self {
11599        self.inner.radar_options = Some(radar_options.into());
11600        self
11601    }
11602    /// Email address to send the receipt to.
11603    /// 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).
11604    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
11605        self.inner.receipt_email = Some(receipt_email.into());
11606        self
11607    }
11608    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
11609    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
11610    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
11611    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
11612        self.inner.return_url = Some(return_url.into());
11613        self
11614    }
11615    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11616    ///
11617    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11618    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11619    ///
11620    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11621    ///
11622    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11623    pub fn setup_future_usage(
11624        mut self,
11625        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
11626    ) -> Self {
11627        self.inner.setup_future_usage = Some(setup_future_usage.into());
11628        self
11629    }
11630    /// Shipping information for this PaymentIntent.
11631    pub fn shipping(mut self, shipping: impl Into<CreatePaymentIntentShipping>) -> Self {
11632        self.inner.shipping = Some(shipping.into());
11633        self
11634    }
11635    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
11636    /// This value overrides the account's default statement descriptor.
11637    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
11638    ///
11639    /// Setting this value for a card charge returns an error.
11640    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
11641    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
11642        self.inner.statement_descriptor = Some(statement_descriptor.into());
11643        self
11644    }
11645    /// Provides information about a card charge.
11646    /// 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.
11647    pub fn statement_descriptor_suffix(
11648        mut self,
11649        statement_descriptor_suffix: impl Into<String>,
11650    ) -> Self {
11651        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
11652        self
11653    }
11654    /// The parameters that you can use to automatically create a Transfer.
11655    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
11656    pub fn transfer_data(
11657        mut self,
11658        transfer_data: impl Into<CreatePaymentIntentTransferData>,
11659    ) -> Self {
11660        self.inner.transfer_data = Some(transfer_data.into());
11661        self
11662    }
11663    /// A string that identifies the resulting payment as part of a group.
11664    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers).
11665    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
11666        self.inner.transfer_group = Some(transfer_group.into());
11667        self
11668    }
11669    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
11670    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
11671        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
11672        self
11673    }
11674}
11675impl CreatePaymentIntent {
11676    /// Send the request and return the deserialized response.
11677    pub async fn send<C: StripeClient>(
11678        &self,
11679        client: &C,
11680    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
11681        self.customize().send(client).await
11682    }
11683
11684    /// Send the request and return the deserialized response, blocking until completion.
11685    pub fn send_blocking<C: StripeBlockingClient>(
11686        &self,
11687        client: &C,
11688    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
11689        self.customize().send_blocking(client)
11690    }
11691}
11692
11693impl StripeRequest for CreatePaymentIntent {
11694    type Output = stripe_shared::PaymentIntent;
11695
11696    fn build(&self) -> RequestBuilder {
11697        RequestBuilder::new(StripeMethod::Post, "/payment_intents").form(&self.inner)
11698    }
11699}
11700#[derive(Clone, Debug, serde::Serialize)]
11701struct UpdatePaymentIntentBuilder {
11702    #[serde(skip_serializing_if = "Option::is_none")]
11703    amount: Option<i64>,
11704    #[serde(skip_serializing_if = "Option::is_none")]
11705    amount_details: Option<UpdatePaymentIntentAmountDetails>,
11706    #[serde(skip_serializing_if = "Option::is_none")]
11707    application_fee_amount: Option<i64>,
11708    #[serde(skip_serializing_if = "Option::is_none")]
11709    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
11710    #[serde(skip_serializing_if = "Option::is_none")]
11711    currency: Option<stripe_types::Currency>,
11712    #[serde(skip_serializing_if = "Option::is_none")]
11713    customer: Option<String>,
11714    #[serde(skip_serializing_if = "Option::is_none")]
11715    description: Option<String>,
11716    #[serde(skip_serializing_if = "Option::is_none")]
11717    excluded_payment_method_types:
11718        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
11719    #[serde(skip_serializing_if = "Option::is_none")]
11720    expand: Option<Vec<String>>,
11721    #[serde(skip_serializing_if = "Option::is_none")]
11722    metadata: Option<std::collections::HashMap<String, String>>,
11723    #[serde(skip_serializing_if = "Option::is_none")]
11724    payment_details: Option<UpdatePaymentIntentPaymentDetails>,
11725    #[serde(skip_serializing_if = "Option::is_none")]
11726    payment_method: Option<String>,
11727    #[serde(skip_serializing_if = "Option::is_none")]
11728    payment_method_configuration: Option<String>,
11729    #[serde(skip_serializing_if = "Option::is_none")]
11730    payment_method_data: Option<UpdatePaymentIntentPaymentMethodData>,
11731    #[serde(skip_serializing_if = "Option::is_none")]
11732    payment_method_options: Option<UpdatePaymentIntentPaymentMethodOptions>,
11733    #[serde(skip_serializing_if = "Option::is_none")]
11734    payment_method_types: Option<Vec<String>>,
11735    #[serde(skip_serializing_if = "Option::is_none")]
11736    receipt_email: Option<String>,
11737    #[serde(skip_serializing_if = "Option::is_none")]
11738    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
11739    #[serde(skip_serializing_if = "Option::is_none")]
11740    shipping: Option<UpdatePaymentIntentShipping>,
11741    #[serde(skip_serializing_if = "Option::is_none")]
11742    statement_descriptor: Option<String>,
11743    #[serde(skip_serializing_if = "Option::is_none")]
11744    statement_descriptor_suffix: Option<String>,
11745    #[serde(skip_serializing_if = "Option::is_none")]
11746    transfer_data: Option<UpdatePaymentIntentTransferData>,
11747    #[serde(skip_serializing_if = "Option::is_none")]
11748    transfer_group: Option<String>,
11749}
11750impl UpdatePaymentIntentBuilder {
11751    fn new() -> Self {
11752        Self {
11753            amount: None,
11754            amount_details: None,
11755            application_fee_amount: None,
11756            capture_method: None,
11757            currency: None,
11758            customer: None,
11759            description: None,
11760            excluded_payment_method_types: None,
11761            expand: None,
11762            metadata: None,
11763            payment_details: None,
11764            payment_method: None,
11765            payment_method_configuration: None,
11766            payment_method_data: None,
11767            payment_method_options: None,
11768            payment_method_types: None,
11769            receipt_email: None,
11770            setup_future_usage: None,
11771            shipping: None,
11772            statement_descriptor: None,
11773            statement_descriptor_suffix: None,
11774            transfer_data: None,
11775            transfer_group: None,
11776        }
11777    }
11778}
11779/// Provides industry-specific information about the amount.
11780#[derive(Clone, Debug, serde::Serialize)]
11781pub struct UpdatePaymentIntentAmountDetails {
11782    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11783    /// An integer greater than 0.
11784    ///
11785    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
11786    #[serde(skip_serializing_if = "Option::is_none")]
11787    pub discount_amount: Option<i64>,
11788    /// A list of line items, each containing information about a product in the PaymentIntent.
11789    /// There is a maximum of 100 line items.
11790    #[serde(skip_serializing_if = "Option::is_none")]
11791    pub line_items: Option<Vec<UpdatePaymentIntentAmountDetailsLineItems>>,
11792    /// Contains information about the shipping portion of the amount.
11793    #[serde(skip_serializing_if = "Option::is_none")]
11794    pub shipping: Option<AmountDetailsShippingParam>,
11795    /// Contains information about the tax portion of the amount.
11796    #[serde(skip_serializing_if = "Option::is_none")]
11797    pub tax: Option<AmountDetailsTaxParam>,
11798}
11799impl UpdatePaymentIntentAmountDetails {
11800    pub fn new() -> Self {
11801        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
11802    }
11803}
11804impl Default for UpdatePaymentIntentAmountDetails {
11805    fn default() -> Self {
11806        Self::new()
11807    }
11808}
11809/// A list of line items, each containing information about a product in the PaymentIntent.
11810/// There is a maximum of 100 line items.
11811#[derive(Clone, Debug, serde::Serialize)]
11812pub struct UpdatePaymentIntentAmountDetailsLineItems {
11813    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11814    /// An integer greater than 0.
11815    ///
11816    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
11817    #[serde(skip_serializing_if = "Option::is_none")]
11818    pub discount_amount: Option<i64>,
11819    /// Payment method-specific information for line items.
11820    #[serde(skip_serializing_if = "Option::is_none")]
11821    pub payment_method_options:
11822        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
11823    /// The product code of the line item, such as an SKU.
11824    /// Required for L3 rates.
11825    /// At most 12 characters long.
11826    #[serde(skip_serializing_if = "Option::is_none")]
11827    pub product_code: Option<String>,
11828    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
11829    ///
11830    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
11831    /// For Paypal, this field is truncated to 127 characters.
11832    pub product_name: String,
11833    /// The quantity of items. Required for L3 rates. An integer greater than 0.
11834    pub quantity: u64,
11835    /// Contains information about the tax on the item.
11836    #[serde(skip_serializing_if = "Option::is_none")]
11837    pub tax: Option<AmountDetailsLineItemTaxParam>,
11838    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
11839    /// Required for L3 rates.
11840    /// An integer greater than or equal to 0.
11841    pub unit_cost: i64,
11842    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
11843    #[serde(skip_serializing_if = "Option::is_none")]
11844    pub unit_of_measure: Option<String>,
11845}
11846impl UpdatePaymentIntentAmountDetailsLineItems {
11847    pub fn new(
11848        product_name: impl Into<String>,
11849        quantity: impl Into<u64>,
11850        unit_cost: impl Into<i64>,
11851    ) -> Self {
11852        Self {
11853            discount_amount: None,
11854            payment_method_options: None,
11855            product_code: None,
11856            product_name: product_name.into(),
11857            quantity: quantity.into(),
11858            tax: None,
11859            unit_cost: unit_cost.into(),
11860            unit_of_measure: None,
11861        }
11862    }
11863}
11864/// Payment method-specific information for line items.
11865#[derive(Clone, Debug, serde::Serialize)]
11866pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
11867    /// This sub-hash contains line item details that are specific to `card` payment method."
11868    #[serde(skip_serializing_if = "Option::is_none")]
11869    pub card: Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
11870    /// This sub-hash contains line item details that are specific to `card_present` payment method."
11871    #[serde(skip_serializing_if = "Option::is_none")]
11872    pub card_present:
11873        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
11874    /// This sub-hash contains line item details that are specific to `klarna` payment method."
11875    #[serde(skip_serializing_if = "Option::is_none")]
11876    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
11877    /// This sub-hash contains line item details that are specific to `paypal` payment method."
11878    #[serde(skip_serializing_if = "Option::is_none")]
11879    pub paypal: Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
11880}
11881impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
11882    pub fn new() -> Self {
11883        Self { card: None, card_present: None, klarna: None, paypal: None }
11884    }
11885}
11886impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
11887    fn default() -> Self {
11888        Self::new()
11889    }
11890}
11891/// This sub-hash contains line item details that are specific to `card` payment method."
11892#[derive(Clone, Debug, serde::Serialize)]
11893pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
11894    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
11895    #[serde(skip_serializing_if = "Option::is_none")]
11896    pub commodity_code: Option<String>,
11897}
11898impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
11899    pub fn new() -> Self {
11900        Self { commodity_code: None }
11901    }
11902}
11903impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
11904    fn default() -> Self {
11905        Self::new()
11906    }
11907}
11908/// This sub-hash contains line item details that are specific to `card_present` payment method."
11909#[derive(Clone, Debug, serde::Serialize)]
11910pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
11911    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
11912    #[serde(skip_serializing_if = "Option::is_none")]
11913    pub commodity_code: Option<String>,
11914}
11915impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
11916    pub fn new() -> Self {
11917        Self { commodity_code: None }
11918    }
11919}
11920impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
11921    fn default() -> Self {
11922        Self::new()
11923    }
11924}
11925/// This sub-hash contains line item details that are specific to `paypal` payment method."
11926#[derive(Clone, Debug, serde::Serialize)]
11927pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
11928    /// Type of the line item.
11929    #[serde(skip_serializing_if = "Option::is_none")]
11930    pub category:
11931        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
11932    /// Description of the line item.
11933    #[serde(skip_serializing_if = "Option::is_none")]
11934    pub description: Option<String>,
11935    /// The Stripe account ID of the connected account that sells the item.
11936    #[serde(skip_serializing_if = "Option::is_none")]
11937    pub sold_by: Option<String>,
11938}
11939impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
11940    pub fn new() -> Self {
11941        Self { category: None, description: None, sold_by: None }
11942    }
11943}
11944impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
11945    fn default() -> Self {
11946        Self::new()
11947    }
11948}
11949/// Type of the line item.
11950#[derive(Copy, Clone, Eq, PartialEq)]
11951pub enum UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
11952    DigitalGoods,
11953    Donation,
11954    PhysicalGoods,
11955}
11956impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
11957    pub fn as_str(self) -> &'static str {
11958        use UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
11959        match self {
11960            DigitalGoods => "digital_goods",
11961            Donation => "donation",
11962            PhysicalGoods => "physical_goods",
11963        }
11964    }
11965}
11966
11967impl std::str::FromStr
11968    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
11969{
11970    type Err = stripe_types::StripeParseError;
11971    fn from_str(s: &str) -> Result<Self, Self::Err> {
11972        use UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
11973        match s {
11974            "digital_goods" => Ok(DigitalGoods),
11975            "donation" => Ok(Donation),
11976            "physical_goods" => Ok(PhysicalGoods),
11977            _ => Err(stripe_types::StripeParseError),
11978        }
11979    }
11980}
11981impl std::fmt::Display
11982    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
11983{
11984    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11985        f.write_str(self.as_str())
11986    }
11987}
11988
11989impl std::fmt::Debug
11990    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
11991{
11992    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11993        f.write_str(self.as_str())
11994    }
11995}
11996impl serde::Serialize
11997    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
11998{
11999    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12000    where
12001        S: serde::Serializer,
12002    {
12003        serializer.serialize_str(self.as_str())
12004    }
12005}
12006#[cfg(feature = "deserialize")]
12007impl<'de> serde::Deserialize<'de>
12008    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
12009{
12010    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12011        use std::str::FromStr;
12012        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12013        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
12014    }
12015}
12016/// Provides industry-specific information about the charge.
12017#[derive(Clone, Debug, serde::Serialize)]
12018pub struct UpdatePaymentIntentPaymentDetails {
12019    /// A unique value to identify the customer. This field is available only for card payments.
12020    ///
12021    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
12022    #[serde(skip_serializing_if = "Option::is_none")]
12023    pub customer_reference: Option<String>,
12024    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
12025    ///
12026    /// 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`.
12027    ///
12028    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
12029    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
12030    #[serde(skip_serializing_if = "Option::is_none")]
12031    pub order_reference: Option<String>,
12032}
12033impl UpdatePaymentIntentPaymentDetails {
12034    pub fn new() -> Self {
12035        Self { customer_reference: None, order_reference: None }
12036    }
12037}
12038impl Default for UpdatePaymentIntentPaymentDetails {
12039    fn default() -> Self {
12040        Self::new()
12041    }
12042}
12043/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
12044/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
12045/// property on the PaymentIntent.
12046#[derive(Clone, Debug, serde::Serialize)]
12047pub struct UpdatePaymentIntentPaymentMethodData {
12048    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
12049    #[serde(skip_serializing_if = "Option::is_none")]
12050    pub acss_debit: Option<PaymentMethodParam>,
12051    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
12052    #[serde(skip_serializing_if = "Option::is_none")]
12053    #[serde(with = "stripe_types::with_serde_json_opt")]
12054    pub affirm: Option<miniserde::json::Value>,
12055    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
12056    #[serde(skip_serializing_if = "Option::is_none")]
12057    #[serde(with = "stripe_types::with_serde_json_opt")]
12058    pub afterpay_clearpay: Option<miniserde::json::Value>,
12059    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
12060    #[serde(skip_serializing_if = "Option::is_none")]
12061    #[serde(with = "stripe_types::with_serde_json_opt")]
12062    pub alipay: Option<miniserde::json::Value>,
12063    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
12064    /// 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.
12065    /// The field defaults to `unspecified`.
12066    #[serde(skip_serializing_if = "Option::is_none")]
12067    pub allow_redisplay: Option<UpdatePaymentIntentPaymentMethodDataAllowRedisplay>,
12068    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
12069    #[serde(skip_serializing_if = "Option::is_none")]
12070    #[serde(with = "stripe_types::with_serde_json_opt")]
12071    pub alma: Option<miniserde::json::Value>,
12072    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
12073    #[serde(skip_serializing_if = "Option::is_none")]
12074    #[serde(with = "stripe_types::with_serde_json_opt")]
12075    pub amazon_pay: Option<miniserde::json::Value>,
12076    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
12077    #[serde(skip_serializing_if = "Option::is_none")]
12078    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodDataAuBecsDebit>,
12079    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
12080    #[serde(skip_serializing_if = "Option::is_none")]
12081    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodDataBacsDebit>,
12082    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
12083    #[serde(skip_serializing_if = "Option::is_none")]
12084    #[serde(with = "stripe_types::with_serde_json_opt")]
12085    pub bancontact: Option<miniserde::json::Value>,
12086    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
12087    #[serde(skip_serializing_if = "Option::is_none")]
12088    #[serde(with = "stripe_types::with_serde_json_opt")]
12089    pub billie: Option<miniserde::json::Value>,
12090    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
12091    #[serde(skip_serializing_if = "Option::is_none")]
12092    pub billing_details: Option<UpdatePaymentIntentPaymentMethodDataBillingDetails>,
12093    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
12094    #[serde(skip_serializing_if = "Option::is_none")]
12095    #[serde(with = "stripe_types::with_serde_json_opt")]
12096    pub blik: Option<miniserde::json::Value>,
12097    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
12098    #[serde(skip_serializing_if = "Option::is_none")]
12099    pub boleto: Option<UpdatePaymentIntentPaymentMethodDataBoleto>,
12100    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
12101    #[serde(skip_serializing_if = "Option::is_none")]
12102    #[serde(with = "stripe_types::with_serde_json_opt")]
12103    pub cashapp: Option<miniserde::json::Value>,
12104    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
12105    #[serde(skip_serializing_if = "Option::is_none")]
12106    #[serde(with = "stripe_types::with_serde_json_opt")]
12107    pub crypto: Option<miniserde::json::Value>,
12108    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
12109    #[serde(skip_serializing_if = "Option::is_none")]
12110    #[serde(with = "stripe_types::with_serde_json_opt")]
12111    pub customer_balance: Option<miniserde::json::Value>,
12112    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
12113    #[serde(skip_serializing_if = "Option::is_none")]
12114    pub eps: Option<UpdatePaymentIntentPaymentMethodDataEps>,
12115    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
12116    #[serde(skip_serializing_if = "Option::is_none")]
12117    pub fpx: Option<UpdatePaymentIntentPaymentMethodDataFpx>,
12118    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
12119    #[serde(skip_serializing_if = "Option::is_none")]
12120    #[serde(with = "stripe_types::with_serde_json_opt")]
12121    pub giropay: Option<miniserde::json::Value>,
12122    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
12123    #[serde(skip_serializing_if = "Option::is_none")]
12124    #[serde(with = "stripe_types::with_serde_json_opt")]
12125    pub grabpay: Option<miniserde::json::Value>,
12126    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
12127    #[serde(skip_serializing_if = "Option::is_none")]
12128    pub ideal: Option<UpdatePaymentIntentPaymentMethodDataIdeal>,
12129    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
12130    #[serde(skip_serializing_if = "Option::is_none")]
12131    #[serde(with = "stripe_types::with_serde_json_opt")]
12132    pub interac_present: Option<miniserde::json::Value>,
12133    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
12134    #[serde(skip_serializing_if = "Option::is_none")]
12135    #[serde(with = "stripe_types::with_serde_json_opt")]
12136    pub kakao_pay: Option<miniserde::json::Value>,
12137    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
12138    #[serde(skip_serializing_if = "Option::is_none")]
12139    pub klarna: Option<UpdatePaymentIntentPaymentMethodDataKlarna>,
12140    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
12141    #[serde(skip_serializing_if = "Option::is_none")]
12142    #[serde(with = "stripe_types::with_serde_json_opt")]
12143    pub konbini: Option<miniserde::json::Value>,
12144    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
12145    #[serde(skip_serializing_if = "Option::is_none")]
12146    #[serde(with = "stripe_types::with_serde_json_opt")]
12147    pub kr_card: Option<miniserde::json::Value>,
12148    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
12149    #[serde(skip_serializing_if = "Option::is_none")]
12150    #[serde(with = "stripe_types::with_serde_json_opt")]
12151    pub link: Option<miniserde::json::Value>,
12152    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
12153    #[serde(skip_serializing_if = "Option::is_none")]
12154    #[serde(with = "stripe_types::with_serde_json_opt")]
12155    pub mb_way: Option<miniserde::json::Value>,
12156    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
12157    /// This can be useful for storing additional information about the object in a structured format.
12158    /// Individual keys can be unset by posting an empty value to them.
12159    /// All keys can be unset by posting an empty value to `metadata`.
12160    #[serde(skip_serializing_if = "Option::is_none")]
12161    pub metadata: Option<std::collections::HashMap<String, String>>,
12162    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
12163    #[serde(skip_serializing_if = "Option::is_none")]
12164    #[serde(with = "stripe_types::with_serde_json_opt")]
12165    pub mobilepay: Option<miniserde::json::Value>,
12166    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
12167    #[serde(skip_serializing_if = "Option::is_none")]
12168    #[serde(with = "stripe_types::with_serde_json_opt")]
12169    pub multibanco: Option<miniserde::json::Value>,
12170    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
12171    #[serde(skip_serializing_if = "Option::is_none")]
12172    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodDataNaverPay>,
12173    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
12174    #[serde(skip_serializing_if = "Option::is_none")]
12175    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodDataNzBankAccount>,
12176    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
12177    #[serde(skip_serializing_if = "Option::is_none")]
12178    #[serde(with = "stripe_types::with_serde_json_opt")]
12179    pub oxxo: Option<miniserde::json::Value>,
12180    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
12181    #[serde(skip_serializing_if = "Option::is_none")]
12182    pub p24: Option<UpdatePaymentIntentPaymentMethodDataP24>,
12183    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
12184    #[serde(skip_serializing_if = "Option::is_none")]
12185    #[serde(with = "stripe_types::with_serde_json_opt")]
12186    pub pay_by_bank: Option<miniserde::json::Value>,
12187    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
12188    #[serde(skip_serializing_if = "Option::is_none")]
12189    #[serde(with = "stripe_types::with_serde_json_opt")]
12190    pub payco: Option<miniserde::json::Value>,
12191    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
12192    #[serde(skip_serializing_if = "Option::is_none")]
12193    #[serde(with = "stripe_types::with_serde_json_opt")]
12194    pub paynow: Option<miniserde::json::Value>,
12195    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
12196    #[serde(skip_serializing_if = "Option::is_none")]
12197    #[serde(with = "stripe_types::with_serde_json_opt")]
12198    pub paypal: Option<miniserde::json::Value>,
12199    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
12200    #[serde(skip_serializing_if = "Option::is_none")]
12201    #[serde(with = "stripe_types::with_serde_json_opt")]
12202    pub pix: Option<miniserde::json::Value>,
12203    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
12204    #[serde(skip_serializing_if = "Option::is_none")]
12205    #[serde(with = "stripe_types::with_serde_json_opt")]
12206    pub promptpay: Option<miniserde::json::Value>,
12207    /// Options to configure Radar.
12208    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
12209    #[serde(skip_serializing_if = "Option::is_none")]
12210    pub radar_options: Option<UpdatePaymentIntentPaymentMethodDataRadarOptions>,
12211    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
12212    #[serde(skip_serializing_if = "Option::is_none")]
12213    #[serde(with = "stripe_types::with_serde_json_opt")]
12214    pub revolut_pay: Option<miniserde::json::Value>,
12215    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
12216    #[serde(skip_serializing_if = "Option::is_none")]
12217    #[serde(with = "stripe_types::with_serde_json_opt")]
12218    pub samsung_pay: Option<miniserde::json::Value>,
12219    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
12220    #[serde(skip_serializing_if = "Option::is_none")]
12221    #[serde(with = "stripe_types::with_serde_json_opt")]
12222    pub satispay: Option<miniserde::json::Value>,
12223    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
12224    #[serde(skip_serializing_if = "Option::is_none")]
12225    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodDataSepaDebit>,
12226    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
12227    #[serde(skip_serializing_if = "Option::is_none")]
12228    pub sofort: Option<UpdatePaymentIntentPaymentMethodDataSofort>,
12229    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
12230    #[serde(skip_serializing_if = "Option::is_none")]
12231    #[serde(with = "stripe_types::with_serde_json_opt")]
12232    pub swish: Option<miniserde::json::Value>,
12233    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
12234    #[serde(skip_serializing_if = "Option::is_none")]
12235    #[serde(with = "stripe_types::with_serde_json_opt")]
12236    pub twint: Option<miniserde::json::Value>,
12237    /// The type of the PaymentMethod.
12238    /// An additional hash is included on the PaymentMethod with a name matching this value.
12239    /// It contains additional information specific to the PaymentMethod type.
12240    #[serde(rename = "type")]
12241    pub type_: UpdatePaymentIntentPaymentMethodDataType,
12242    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
12243    #[serde(skip_serializing_if = "Option::is_none")]
12244    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccount>,
12245    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
12246    #[serde(skip_serializing_if = "Option::is_none")]
12247    #[serde(with = "stripe_types::with_serde_json_opt")]
12248    pub wechat_pay: Option<miniserde::json::Value>,
12249    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
12250    #[serde(skip_serializing_if = "Option::is_none")]
12251    #[serde(with = "stripe_types::with_serde_json_opt")]
12252    pub zip: Option<miniserde::json::Value>,
12253}
12254impl UpdatePaymentIntentPaymentMethodData {
12255    pub fn new(type_: impl Into<UpdatePaymentIntentPaymentMethodDataType>) -> Self {
12256        Self {
12257            acss_debit: None,
12258            affirm: None,
12259            afterpay_clearpay: None,
12260            alipay: None,
12261            allow_redisplay: None,
12262            alma: None,
12263            amazon_pay: None,
12264            au_becs_debit: None,
12265            bacs_debit: None,
12266            bancontact: None,
12267            billie: None,
12268            billing_details: None,
12269            blik: None,
12270            boleto: None,
12271            cashapp: None,
12272            crypto: None,
12273            customer_balance: None,
12274            eps: None,
12275            fpx: None,
12276            giropay: None,
12277            grabpay: None,
12278            ideal: None,
12279            interac_present: None,
12280            kakao_pay: None,
12281            klarna: None,
12282            konbini: None,
12283            kr_card: None,
12284            link: None,
12285            mb_way: None,
12286            metadata: None,
12287            mobilepay: None,
12288            multibanco: None,
12289            naver_pay: None,
12290            nz_bank_account: None,
12291            oxxo: None,
12292            p24: None,
12293            pay_by_bank: None,
12294            payco: None,
12295            paynow: None,
12296            paypal: None,
12297            pix: None,
12298            promptpay: None,
12299            radar_options: None,
12300            revolut_pay: None,
12301            samsung_pay: None,
12302            satispay: None,
12303            sepa_debit: None,
12304            sofort: None,
12305            swish: None,
12306            twint: None,
12307            type_: type_.into(),
12308            us_bank_account: None,
12309            wechat_pay: None,
12310            zip: None,
12311        }
12312    }
12313}
12314/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
12315/// 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.
12316/// The field defaults to `unspecified`.
12317#[derive(Copy, Clone, Eq, PartialEq)]
12318pub enum UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12319    Always,
12320    Limited,
12321    Unspecified,
12322}
12323impl UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12324    pub fn as_str(self) -> &'static str {
12325        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
12326        match self {
12327            Always => "always",
12328            Limited => "limited",
12329            Unspecified => "unspecified",
12330        }
12331    }
12332}
12333
12334impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12335    type Err = stripe_types::StripeParseError;
12336    fn from_str(s: &str) -> Result<Self, Self::Err> {
12337        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
12338        match s {
12339            "always" => Ok(Always),
12340            "limited" => Ok(Limited),
12341            "unspecified" => Ok(Unspecified),
12342            _ => Err(stripe_types::StripeParseError),
12343        }
12344    }
12345}
12346impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12347    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12348        f.write_str(self.as_str())
12349    }
12350}
12351
12352impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12354        f.write_str(self.as_str())
12355    }
12356}
12357impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12358    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12359    where
12360        S: serde::Serializer,
12361    {
12362        serializer.serialize_str(self.as_str())
12363    }
12364}
12365#[cfg(feature = "deserialize")]
12366impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
12367    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12368        use std::str::FromStr;
12369        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12370        Self::from_str(&s).map_err(|_| {
12371            serde::de::Error::custom(
12372                "Unknown value for UpdatePaymentIntentPaymentMethodDataAllowRedisplay",
12373            )
12374        })
12375    }
12376}
12377/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
12378#[derive(Clone, Debug, serde::Serialize)]
12379pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
12380    /// The account number for the bank account.
12381    pub account_number: String,
12382    /// Bank-State-Branch number of the bank account.
12383    pub bsb_number: String,
12384}
12385impl UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
12386    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
12387        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
12388    }
12389}
12390/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
12391#[derive(Clone, Debug, serde::Serialize)]
12392pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit {
12393    /// Account number of the bank account that the funds will be debited from.
12394    #[serde(skip_serializing_if = "Option::is_none")]
12395    pub account_number: Option<String>,
12396    /// Sort code of the bank account. (e.g., `10-20-30`)
12397    #[serde(skip_serializing_if = "Option::is_none")]
12398    pub sort_code: Option<String>,
12399}
12400impl UpdatePaymentIntentPaymentMethodDataBacsDebit {
12401    pub fn new() -> Self {
12402        Self { account_number: None, sort_code: None }
12403    }
12404}
12405impl Default for UpdatePaymentIntentPaymentMethodDataBacsDebit {
12406    fn default() -> Self {
12407        Self::new()
12408    }
12409}
12410/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
12411#[derive(Clone, Debug, serde::Serialize)]
12412pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails {
12413    /// Billing address.
12414    #[serde(skip_serializing_if = "Option::is_none")]
12415    pub address: Option<UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
12416    /// Email address.
12417    #[serde(skip_serializing_if = "Option::is_none")]
12418    pub email: Option<String>,
12419    /// Full name.
12420    #[serde(skip_serializing_if = "Option::is_none")]
12421    pub name: Option<String>,
12422    /// Billing phone number (including extension).
12423    #[serde(skip_serializing_if = "Option::is_none")]
12424    pub phone: Option<String>,
12425    /// Taxpayer identification number.
12426    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
12427    #[serde(skip_serializing_if = "Option::is_none")]
12428    pub tax_id: Option<String>,
12429}
12430impl UpdatePaymentIntentPaymentMethodDataBillingDetails {
12431    pub fn new() -> Self {
12432        Self { address: None, email: None, name: None, phone: None, tax_id: None }
12433    }
12434}
12435impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetails {
12436    fn default() -> Self {
12437        Self::new()
12438    }
12439}
12440/// Billing address.
12441#[derive(Clone, Debug, serde::Serialize)]
12442pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
12443    /// City, district, suburb, town, or village.
12444    #[serde(skip_serializing_if = "Option::is_none")]
12445    pub city: Option<String>,
12446    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
12447    #[serde(skip_serializing_if = "Option::is_none")]
12448    pub country: Option<String>,
12449    /// Address line 1, such as the street, PO Box, or company name.
12450    #[serde(skip_serializing_if = "Option::is_none")]
12451    pub line1: Option<String>,
12452    /// Address line 2, such as the apartment, suite, unit, or building.
12453    #[serde(skip_serializing_if = "Option::is_none")]
12454    pub line2: Option<String>,
12455    /// ZIP or postal code.
12456    #[serde(skip_serializing_if = "Option::is_none")]
12457    pub postal_code: Option<String>,
12458    /// State, county, province, or region.
12459    #[serde(skip_serializing_if = "Option::is_none")]
12460    pub state: Option<String>,
12461}
12462impl UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
12463    pub fn new() -> Self {
12464        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
12465    }
12466}
12467impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
12468    fn default() -> Self {
12469        Self::new()
12470    }
12471}
12472/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
12473#[derive(Clone, Debug, serde::Serialize)]
12474pub struct UpdatePaymentIntentPaymentMethodDataBoleto {
12475    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
12476    pub tax_id: String,
12477}
12478impl UpdatePaymentIntentPaymentMethodDataBoleto {
12479    pub fn new(tax_id: impl Into<String>) -> Self {
12480        Self { tax_id: tax_id.into() }
12481    }
12482}
12483/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
12484#[derive(Clone, Debug, serde::Serialize)]
12485pub struct UpdatePaymentIntentPaymentMethodDataEps {
12486    /// The customer's bank.
12487    #[serde(skip_serializing_if = "Option::is_none")]
12488    pub bank: Option<UpdatePaymentIntentPaymentMethodDataEpsBank>,
12489}
12490impl UpdatePaymentIntentPaymentMethodDataEps {
12491    pub fn new() -> Self {
12492        Self { bank: None }
12493    }
12494}
12495impl Default for UpdatePaymentIntentPaymentMethodDataEps {
12496    fn default() -> Self {
12497        Self::new()
12498    }
12499}
12500/// The customer's bank.
12501#[derive(Clone, Eq, PartialEq)]
12502#[non_exhaustive]
12503pub enum UpdatePaymentIntentPaymentMethodDataEpsBank {
12504    ArzteUndApothekerBank,
12505    AustrianAnadiBankAg,
12506    BankAustria,
12507    BankhausCarlSpangler,
12508    BankhausSchelhammerUndSchatteraAg,
12509    BawagPskAg,
12510    BksBankAg,
12511    BrullKallmusBankAg,
12512    BtvVierLanderBank,
12513    CapitalBankGraweGruppeAg,
12514    DeutscheBankAg,
12515    Dolomitenbank,
12516    EasybankAg,
12517    ErsteBankUndSparkassen,
12518    HypoAlpeadriabankInternationalAg,
12519    HypoBankBurgenlandAktiengesellschaft,
12520    HypoNoeLbFurNiederosterreichUWien,
12521    HypoOberosterreichSalzburgSteiermark,
12522    HypoTirolBankAg,
12523    HypoVorarlbergBankAg,
12524    MarchfelderBank,
12525    OberbankAg,
12526    RaiffeisenBankengruppeOsterreich,
12527    SchoellerbankAg,
12528    SpardaBankWien,
12529    VolksbankGruppe,
12530    VolkskreditbankAg,
12531    VrBankBraunau,
12532    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12533    Unknown(String),
12534}
12535impl UpdatePaymentIntentPaymentMethodDataEpsBank {
12536    pub fn as_str(&self) -> &str {
12537        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
12538        match self {
12539            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
12540            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
12541            BankAustria => "bank_austria",
12542            BankhausCarlSpangler => "bankhaus_carl_spangler",
12543            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
12544            BawagPskAg => "bawag_psk_ag",
12545            BksBankAg => "bks_bank_ag",
12546            BrullKallmusBankAg => "brull_kallmus_bank_ag",
12547            BtvVierLanderBank => "btv_vier_lander_bank",
12548            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
12549            DeutscheBankAg => "deutsche_bank_ag",
12550            Dolomitenbank => "dolomitenbank",
12551            EasybankAg => "easybank_ag",
12552            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
12553            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
12554            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
12555            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
12556            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
12557            HypoTirolBankAg => "hypo_tirol_bank_ag",
12558            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
12559            MarchfelderBank => "marchfelder_bank",
12560            OberbankAg => "oberbank_ag",
12561            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
12562            SchoellerbankAg => "schoellerbank_ag",
12563            SpardaBankWien => "sparda_bank_wien",
12564            VolksbankGruppe => "volksbank_gruppe",
12565            VolkskreditbankAg => "volkskreditbank_ag",
12566            VrBankBraunau => "vr_bank_braunau",
12567            Unknown(v) => v,
12568        }
12569    }
12570}
12571
12572impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataEpsBank {
12573    type Err = std::convert::Infallible;
12574    fn from_str(s: &str) -> Result<Self, Self::Err> {
12575        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
12576        match s {
12577            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
12578            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
12579            "bank_austria" => Ok(BankAustria),
12580            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
12581            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
12582            "bawag_psk_ag" => Ok(BawagPskAg),
12583            "bks_bank_ag" => Ok(BksBankAg),
12584            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
12585            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
12586            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
12587            "deutsche_bank_ag" => Ok(DeutscheBankAg),
12588            "dolomitenbank" => Ok(Dolomitenbank),
12589            "easybank_ag" => Ok(EasybankAg),
12590            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
12591            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
12592            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
12593            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
12594            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
12595            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
12596            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
12597            "marchfelder_bank" => Ok(MarchfelderBank),
12598            "oberbank_ag" => Ok(OberbankAg),
12599            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
12600            "schoellerbank_ag" => Ok(SchoellerbankAg),
12601            "sparda_bank_wien" => Ok(SpardaBankWien),
12602            "volksbank_gruppe" => Ok(VolksbankGruppe),
12603            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
12604            "vr_bank_braunau" => Ok(VrBankBraunau),
12605            v => Ok(Unknown(v.to_owned())),
12606        }
12607    }
12608}
12609impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank {
12610    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12611        f.write_str(self.as_str())
12612    }
12613}
12614
12615impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataEpsBank {
12616    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12617        f.write_str(self.as_str())
12618    }
12619}
12620impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataEpsBank {
12621    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12622    where
12623        S: serde::Serializer,
12624    {
12625        serializer.serialize_str(self.as_str())
12626    }
12627}
12628#[cfg(feature = "deserialize")]
12629impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataEpsBank {
12630    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12631        use std::str::FromStr;
12632        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12633        Ok(Self::from_str(&s).unwrap())
12634    }
12635}
12636/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
12637#[derive(Clone, Debug, serde::Serialize)]
12638pub struct UpdatePaymentIntentPaymentMethodDataFpx {
12639    /// Account holder type for FPX transaction
12640    #[serde(skip_serializing_if = "Option::is_none")]
12641    pub account_holder_type: Option<UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
12642    /// The customer's bank.
12643    pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank,
12644}
12645impl UpdatePaymentIntentPaymentMethodDataFpx {
12646    pub fn new(bank: impl Into<UpdatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
12647        Self { account_holder_type: None, bank: bank.into() }
12648    }
12649}
12650/// Account holder type for FPX transaction
12651#[derive(Copy, Clone, Eq, PartialEq)]
12652pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12653    Company,
12654    Individual,
12655}
12656impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12657    pub fn as_str(self) -> &'static str {
12658        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
12659        match self {
12660            Company => "company",
12661            Individual => "individual",
12662        }
12663    }
12664}
12665
12666impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12667    type Err = stripe_types::StripeParseError;
12668    fn from_str(s: &str) -> Result<Self, Self::Err> {
12669        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
12670        match s {
12671            "company" => Ok(Company),
12672            "individual" => Ok(Individual),
12673            _ => Err(stripe_types::StripeParseError),
12674        }
12675    }
12676}
12677impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12678    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12679        f.write_str(self.as_str())
12680    }
12681}
12682
12683impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12684    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12685        f.write_str(self.as_str())
12686    }
12687}
12688impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12689    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12690    where
12691        S: serde::Serializer,
12692    {
12693        serializer.serialize_str(self.as_str())
12694    }
12695}
12696#[cfg(feature = "deserialize")]
12697impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
12698    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12699        use std::str::FromStr;
12700        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12701        Self::from_str(&s).map_err(|_| {
12702            serde::de::Error::custom(
12703                "Unknown value for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType",
12704            )
12705        })
12706    }
12707}
12708/// The customer's bank.
12709#[derive(Clone, Eq, PartialEq)]
12710#[non_exhaustive]
12711pub enum UpdatePaymentIntentPaymentMethodDataFpxBank {
12712    AffinBank,
12713    Agrobank,
12714    AllianceBank,
12715    Ambank,
12716    BankIslam,
12717    BankMuamalat,
12718    BankOfChina,
12719    BankRakyat,
12720    Bsn,
12721    Cimb,
12722    DeutscheBank,
12723    HongLeongBank,
12724    Hsbc,
12725    Kfh,
12726    Maybank2e,
12727    Maybank2u,
12728    Ocbc,
12729    PbEnterprise,
12730    PublicBank,
12731    Rhb,
12732    StandardChartered,
12733    Uob,
12734    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12735    Unknown(String),
12736}
12737impl UpdatePaymentIntentPaymentMethodDataFpxBank {
12738    pub fn as_str(&self) -> &str {
12739        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
12740        match self {
12741            AffinBank => "affin_bank",
12742            Agrobank => "agrobank",
12743            AllianceBank => "alliance_bank",
12744            Ambank => "ambank",
12745            BankIslam => "bank_islam",
12746            BankMuamalat => "bank_muamalat",
12747            BankOfChina => "bank_of_china",
12748            BankRakyat => "bank_rakyat",
12749            Bsn => "bsn",
12750            Cimb => "cimb",
12751            DeutscheBank => "deutsche_bank",
12752            HongLeongBank => "hong_leong_bank",
12753            Hsbc => "hsbc",
12754            Kfh => "kfh",
12755            Maybank2e => "maybank2e",
12756            Maybank2u => "maybank2u",
12757            Ocbc => "ocbc",
12758            PbEnterprise => "pb_enterprise",
12759            PublicBank => "public_bank",
12760            Rhb => "rhb",
12761            StandardChartered => "standard_chartered",
12762            Uob => "uob",
12763            Unknown(v) => v,
12764        }
12765    }
12766}
12767
12768impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxBank {
12769    type Err = std::convert::Infallible;
12770    fn from_str(s: &str) -> Result<Self, Self::Err> {
12771        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
12772        match s {
12773            "affin_bank" => Ok(AffinBank),
12774            "agrobank" => Ok(Agrobank),
12775            "alliance_bank" => Ok(AllianceBank),
12776            "ambank" => Ok(Ambank),
12777            "bank_islam" => Ok(BankIslam),
12778            "bank_muamalat" => Ok(BankMuamalat),
12779            "bank_of_china" => Ok(BankOfChina),
12780            "bank_rakyat" => Ok(BankRakyat),
12781            "bsn" => Ok(Bsn),
12782            "cimb" => Ok(Cimb),
12783            "deutsche_bank" => Ok(DeutscheBank),
12784            "hong_leong_bank" => Ok(HongLeongBank),
12785            "hsbc" => Ok(Hsbc),
12786            "kfh" => Ok(Kfh),
12787            "maybank2e" => Ok(Maybank2e),
12788            "maybank2u" => Ok(Maybank2u),
12789            "ocbc" => Ok(Ocbc),
12790            "pb_enterprise" => Ok(PbEnterprise),
12791            "public_bank" => Ok(PublicBank),
12792            "rhb" => Ok(Rhb),
12793            "standard_chartered" => Ok(StandardChartered),
12794            "uob" => Ok(Uob),
12795            v => Ok(Unknown(v.to_owned())),
12796        }
12797    }
12798}
12799impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank {
12800    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12801        f.write_str(self.as_str())
12802    }
12803}
12804
12805impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxBank {
12806    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12807        f.write_str(self.as_str())
12808    }
12809}
12810impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxBank {
12811    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12812    where
12813        S: serde::Serializer,
12814    {
12815        serializer.serialize_str(self.as_str())
12816    }
12817}
12818#[cfg(feature = "deserialize")]
12819impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxBank {
12820    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12821        use std::str::FromStr;
12822        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12823        Ok(Self::from_str(&s).unwrap())
12824    }
12825}
12826/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
12827#[derive(Clone, Debug, serde::Serialize)]
12828pub struct UpdatePaymentIntentPaymentMethodDataIdeal {
12829    /// The customer's bank.
12830    /// Only use this parameter for existing customers.
12831    /// Don't use it for new customers.
12832    #[serde(skip_serializing_if = "Option::is_none")]
12833    pub bank: Option<UpdatePaymentIntentPaymentMethodDataIdealBank>,
12834}
12835impl UpdatePaymentIntentPaymentMethodDataIdeal {
12836    pub fn new() -> Self {
12837        Self { bank: None }
12838    }
12839}
12840impl Default for UpdatePaymentIntentPaymentMethodDataIdeal {
12841    fn default() -> Self {
12842        Self::new()
12843    }
12844}
12845/// The customer's bank.
12846/// Only use this parameter for existing customers.
12847/// Don't use it for new customers.
12848#[derive(Clone, Eq, PartialEq)]
12849#[non_exhaustive]
12850pub enum UpdatePaymentIntentPaymentMethodDataIdealBank {
12851    AbnAmro,
12852    AsnBank,
12853    Bunq,
12854    Buut,
12855    Handelsbanken,
12856    Ing,
12857    Knab,
12858    Moneyou,
12859    N26,
12860    Nn,
12861    Rabobank,
12862    Regiobank,
12863    Revolut,
12864    SnsBank,
12865    TriodosBank,
12866    VanLanschot,
12867    Yoursafe,
12868    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12869    Unknown(String),
12870}
12871impl UpdatePaymentIntentPaymentMethodDataIdealBank {
12872    pub fn as_str(&self) -> &str {
12873        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
12874        match self {
12875            AbnAmro => "abn_amro",
12876            AsnBank => "asn_bank",
12877            Bunq => "bunq",
12878            Buut => "buut",
12879            Handelsbanken => "handelsbanken",
12880            Ing => "ing",
12881            Knab => "knab",
12882            Moneyou => "moneyou",
12883            N26 => "n26",
12884            Nn => "nn",
12885            Rabobank => "rabobank",
12886            Regiobank => "regiobank",
12887            Revolut => "revolut",
12888            SnsBank => "sns_bank",
12889            TriodosBank => "triodos_bank",
12890            VanLanschot => "van_lanschot",
12891            Yoursafe => "yoursafe",
12892            Unknown(v) => v,
12893        }
12894    }
12895}
12896
12897impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataIdealBank {
12898    type Err = std::convert::Infallible;
12899    fn from_str(s: &str) -> Result<Self, Self::Err> {
12900        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
12901        match s {
12902            "abn_amro" => Ok(AbnAmro),
12903            "asn_bank" => Ok(AsnBank),
12904            "bunq" => Ok(Bunq),
12905            "buut" => Ok(Buut),
12906            "handelsbanken" => Ok(Handelsbanken),
12907            "ing" => Ok(Ing),
12908            "knab" => Ok(Knab),
12909            "moneyou" => Ok(Moneyou),
12910            "n26" => Ok(N26),
12911            "nn" => Ok(Nn),
12912            "rabobank" => Ok(Rabobank),
12913            "regiobank" => Ok(Regiobank),
12914            "revolut" => Ok(Revolut),
12915            "sns_bank" => Ok(SnsBank),
12916            "triodos_bank" => Ok(TriodosBank),
12917            "van_lanschot" => Ok(VanLanschot),
12918            "yoursafe" => Ok(Yoursafe),
12919            v => Ok(Unknown(v.to_owned())),
12920        }
12921    }
12922}
12923impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank {
12924    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12925        f.write_str(self.as_str())
12926    }
12927}
12928
12929impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataIdealBank {
12930    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12931        f.write_str(self.as_str())
12932    }
12933}
12934impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataIdealBank {
12935    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12936    where
12937        S: serde::Serializer,
12938    {
12939        serializer.serialize_str(self.as_str())
12940    }
12941}
12942#[cfg(feature = "deserialize")]
12943impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataIdealBank {
12944    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12945        use std::str::FromStr;
12946        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12947        Ok(Self::from_str(&s).unwrap())
12948    }
12949}
12950/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
12951#[derive(Copy, Clone, Debug, serde::Serialize)]
12952pub struct UpdatePaymentIntentPaymentMethodDataKlarna {
12953    /// Customer's date of birth
12954    #[serde(skip_serializing_if = "Option::is_none")]
12955    pub dob: Option<DateOfBirth>,
12956}
12957impl UpdatePaymentIntentPaymentMethodDataKlarna {
12958    pub fn new() -> Self {
12959        Self { dob: None }
12960    }
12961}
12962impl Default for UpdatePaymentIntentPaymentMethodDataKlarna {
12963    fn default() -> Self {
12964        Self::new()
12965    }
12966}
12967/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
12968#[derive(Copy, Clone, Debug, serde::Serialize)]
12969pub struct UpdatePaymentIntentPaymentMethodDataNaverPay {
12970    /// Whether to use Naver Pay points or a card to fund this transaction.
12971    /// If not provided, this defaults to `card`.
12972    #[serde(skip_serializing_if = "Option::is_none")]
12973    pub funding: Option<UpdatePaymentIntentPaymentMethodDataNaverPayFunding>,
12974}
12975impl UpdatePaymentIntentPaymentMethodDataNaverPay {
12976    pub fn new() -> Self {
12977        Self { funding: None }
12978    }
12979}
12980impl Default for UpdatePaymentIntentPaymentMethodDataNaverPay {
12981    fn default() -> Self {
12982        Self::new()
12983    }
12984}
12985/// Whether to use Naver Pay points or a card to fund this transaction.
12986/// If not provided, this defaults to `card`.
12987#[derive(Copy, Clone, Eq, PartialEq)]
12988pub enum UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12989    Card,
12990    Points,
12991}
12992impl UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
12993    pub fn as_str(self) -> &'static str {
12994        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
12995        match self {
12996            Card => "card",
12997            Points => "points",
12998        }
12999    }
13000}
13001
13002impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13003    type Err = stripe_types::StripeParseError;
13004    fn from_str(s: &str) -> Result<Self, Self::Err> {
13005        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
13006        match s {
13007            "card" => Ok(Card),
13008            "points" => Ok(Points),
13009            _ => Err(stripe_types::StripeParseError),
13010        }
13011    }
13012}
13013impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13015        f.write_str(self.as_str())
13016    }
13017}
13018
13019impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13021        f.write_str(self.as_str())
13022    }
13023}
13024impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13025    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13026    where
13027        S: serde::Serializer,
13028    {
13029        serializer.serialize_str(self.as_str())
13030    }
13031}
13032#[cfg(feature = "deserialize")]
13033impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
13034    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13035        use std::str::FromStr;
13036        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13037        Self::from_str(&s).map_err(|_| {
13038            serde::de::Error::custom(
13039                "Unknown value for UpdatePaymentIntentPaymentMethodDataNaverPayFunding",
13040            )
13041        })
13042    }
13043}
13044/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
13045#[derive(Clone, Debug, serde::Serialize)]
13046pub struct UpdatePaymentIntentPaymentMethodDataNzBankAccount {
13047    /// The name on the bank account.
13048    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
13049    #[serde(skip_serializing_if = "Option::is_none")]
13050    pub account_holder_name: Option<String>,
13051    /// The account number for the bank account.
13052    pub account_number: String,
13053    /// The numeric code for the bank account's bank.
13054    pub bank_code: String,
13055    /// The numeric code for the bank account's bank branch.
13056    pub branch_code: String,
13057    #[serde(skip_serializing_if = "Option::is_none")]
13058    pub reference: Option<String>,
13059    /// The suffix of the bank account number.
13060    pub suffix: String,
13061}
13062impl UpdatePaymentIntentPaymentMethodDataNzBankAccount {
13063    pub fn new(
13064        account_number: impl Into<String>,
13065        bank_code: impl Into<String>,
13066        branch_code: impl Into<String>,
13067        suffix: impl Into<String>,
13068    ) -> Self {
13069        Self {
13070            account_holder_name: None,
13071            account_number: account_number.into(),
13072            bank_code: bank_code.into(),
13073            branch_code: branch_code.into(),
13074            reference: None,
13075            suffix: suffix.into(),
13076        }
13077    }
13078}
13079/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
13080#[derive(Clone, Debug, serde::Serialize)]
13081pub struct UpdatePaymentIntentPaymentMethodDataP24 {
13082    /// The customer's bank.
13083    #[serde(skip_serializing_if = "Option::is_none")]
13084    pub bank: Option<UpdatePaymentIntentPaymentMethodDataP24Bank>,
13085}
13086impl UpdatePaymentIntentPaymentMethodDataP24 {
13087    pub fn new() -> Self {
13088        Self { bank: None }
13089    }
13090}
13091impl Default for UpdatePaymentIntentPaymentMethodDataP24 {
13092    fn default() -> Self {
13093        Self::new()
13094    }
13095}
13096/// The customer's bank.
13097#[derive(Clone, Eq, PartialEq)]
13098#[non_exhaustive]
13099pub enum UpdatePaymentIntentPaymentMethodDataP24Bank {
13100    AliorBank,
13101    BankMillennium,
13102    BankNowyBfgSa,
13103    BankPekaoSa,
13104    BankiSpbdzielcze,
13105    Blik,
13106    BnpParibas,
13107    Boz,
13108    CitiHandlowy,
13109    CreditAgricole,
13110    Envelobank,
13111    EtransferPocztowy24,
13112    GetinBank,
13113    Ideabank,
13114    Ing,
13115    Inteligo,
13116    MbankMtransfer,
13117    NestPrzelew,
13118    NoblePay,
13119    PbacZIpko,
13120    PlusBank,
13121    SantanderPrzelew24,
13122    TmobileUsbugiBankowe,
13123    ToyotaBank,
13124    Velobank,
13125    VolkswagenBank,
13126    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13127    Unknown(String),
13128}
13129impl UpdatePaymentIntentPaymentMethodDataP24Bank {
13130    pub fn as_str(&self) -> &str {
13131        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
13132        match self {
13133            AliorBank => "alior_bank",
13134            BankMillennium => "bank_millennium",
13135            BankNowyBfgSa => "bank_nowy_bfg_sa",
13136            BankPekaoSa => "bank_pekao_sa",
13137            BankiSpbdzielcze => "banki_spbdzielcze",
13138            Blik => "blik",
13139            BnpParibas => "bnp_paribas",
13140            Boz => "boz",
13141            CitiHandlowy => "citi_handlowy",
13142            CreditAgricole => "credit_agricole",
13143            Envelobank => "envelobank",
13144            EtransferPocztowy24 => "etransfer_pocztowy24",
13145            GetinBank => "getin_bank",
13146            Ideabank => "ideabank",
13147            Ing => "ing",
13148            Inteligo => "inteligo",
13149            MbankMtransfer => "mbank_mtransfer",
13150            NestPrzelew => "nest_przelew",
13151            NoblePay => "noble_pay",
13152            PbacZIpko => "pbac_z_ipko",
13153            PlusBank => "plus_bank",
13154            SantanderPrzelew24 => "santander_przelew24",
13155            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
13156            ToyotaBank => "toyota_bank",
13157            Velobank => "velobank",
13158            VolkswagenBank => "volkswagen_bank",
13159            Unknown(v) => v,
13160        }
13161    }
13162}
13163
13164impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataP24Bank {
13165    type Err = std::convert::Infallible;
13166    fn from_str(s: &str) -> Result<Self, Self::Err> {
13167        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
13168        match s {
13169            "alior_bank" => Ok(AliorBank),
13170            "bank_millennium" => Ok(BankMillennium),
13171            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
13172            "bank_pekao_sa" => Ok(BankPekaoSa),
13173            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
13174            "blik" => Ok(Blik),
13175            "bnp_paribas" => Ok(BnpParibas),
13176            "boz" => Ok(Boz),
13177            "citi_handlowy" => Ok(CitiHandlowy),
13178            "credit_agricole" => Ok(CreditAgricole),
13179            "envelobank" => Ok(Envelobank),
13180            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
13181            "getin_bank" => Ok(GetinBank),
13182            "ideabank" => Ok(Ideabank),
13183            "ing" => Ok(Ing),
13184            "inteligo" => Ok(Inteligo),
13185            "mbank_mtransfer" => Ok(MbankMtransfer),
13186            "nest_przelew" => Ok(NestPrzelew),
13187            "noble_pay" => Ok(NoblePay),
13188            "pbac_z_ipko" => Ok(PbacZIpko),
13189            "plus_bank" => Ok(PlusBank),
13190            "santander_przelew24" => Ok(SantanderPrzelew24),
13191            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
13192            "toyota_bank" => Ok(ToyotaBank),
13193            "velobank" => Ok(Velobank),
13194            "volkswagen_bank" => Ok(VolkswagenBank),
13195            v => Ok(Unknown(v.to_owned())),
13196        }
13197    }
13198}
13199impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank {
13200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13201        f.write_str(self.as_str())
13202    }
13203}
13204
13205impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataP24Bank {
13206    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13207        f.write_str(self.as_str())
13208    }
13209}
13210impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataP24Bank {
13211    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13212    where
13213        S: serde::Serializer,
13214    {
13215        serializer.serialize_str(self.as_str())
13216    }
13217}
13218#[cfg(feature = "deserialize")]
13219impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataP24Bank {
13220    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13221        use std::str::FromStr;
13222        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13223        Ok(Self::from_str(&s).unwrap())
13224    }
13225}
13226/// Options to configure Radar.
13227/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
13228#[derive(Clone, Debug, serde::Serialize)]
13229pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions {
13230    /// 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.
13231    #[serde(skip_serializing_if = "Option::is_none")]
13232    pub session: Option<String>,
13233}
13234impl UpdatePaymentIntentPaymentMethodDataRadarOptions {
13235    pub fn new() -> Self {
13236        Self { session: None }
13237    }
13238}
13239impl Default for UpdatePaymentIntentPaymentMethodDataRadarOptions {
13240    fn default() -> Self {
13241        Self::new()
13242    }
13243}
13244/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
13245#[derive(Clone, Debug, serde::Serialize)]
13246pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit {
13247    /// IBAN of the bank account.
13248    pub iban: String,
13249}
13250impl UpdatePaymentIntentPaymentMethodDataSepaDebit {
13251    pub fn new(iban: impl Into<String>) -> Self {
13252        Self { iban: iban.into() }
13253    }
13254}
13255/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
13256#[derive(Copy, Clone, Debug, serde::Serialize)]
13257pub struct UpdatePaymentIntentPaymentMethodDataSofort {
13258    /// Two-letter ISO code representing the country the bank account is located in.
13259    pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry,
13260}
13261impl UpdatePaymentIntentPaymentMethodDataSofort {
13262    pub fn new(country: impl Into<UpdatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
13263        Self { country: country.into() }
13264    }
13265}
13266/// Two-letter ISO code representing the country the bank account is located in.
13267#[derive(Copy, Clone, Eq, PartialEq)]
13268pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry {
13269    At,
13270    Be,
13271    De,
13272    Es,
13273    It,
13274    Nl,
13275}
13276impl UpdatePaymentIntentPaymentMethodDataSofortCountry {
13277    pub fn as_str(self) -> &'static str {
13278        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
13279        match self {
13280            At => "AT",
13281            Be => "BE",
13282            De => "DE",
13283            Es => "ES",
13284            It => "IT",
13285            Nl => "NL",
13286        }
13287    }
13288}
13289
13290impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13291    type Err = stripe_types::StripeParseError;
13292    fn from_str(s: &str) -> Result<Self, Self::Err> {
13293        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
13294        match s {
13295            "AT" => Ok(At),
13296            "BE" => Ok(Be),
13297            "DE" => Ok(De),
13298            "ES" => Ok(Es),
13299            "IT" => Ok(It),
13300            "NL" => Ok(Nl),
13301            _ => Err(stripe_types::StripeParseError),
13302        }
13303    }
13304}
13305impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13306    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13307        f.write_str(self.as_str())
13308    }
13309}
13310
13311impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13312    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13313        f.write_str(self.as_str())
13314    }
13315}
13316impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13317    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13318    where
13319        S: serde::Serializer,
13320    {
13321        serializer.serialize_str(self.as_str())
13322    }
13323}
13324#[cfg(feature = "deserialize")]
13325impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataSofortCountry {
13326    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13327        use std::str::FromStr;
13328        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13329        Self::from_str(&s).map_err(|_| {
13330            serde::de::Error::custom(
13331                "Unknown value for UpdatePaymentIntentPaymentMethodDataSofortCountry",
13332            )
13333        })
13334    }
13335}
13336/// The type of the PaymentMethod.
13337/// An additional hash is included on the PaymentMethod with a name matching this value.
13338/// It contains additional information specific to the PaymentMethod type.
13339#[derive(Clone, Eq, PartialEq)]
13340#[non_exhaustive]
13341pub enum UpdatePaymentIntentPaymentMethodDataType {
13342    AcssDebit,
13343    Affirm,
13344    AfterpayClearpay,
13345    Alipay,
13346    Alma,
13347    AmazonPay,
13348    AuBecsDebit,
13349    BacsDebit,
13350    Bancontact,
13351    Billie,
13352    Blik,
13353    Boleto,
13354    Cashapp,
13355    Crypto,
13356    CustomerBalance,
13357    Eps,
13358    Fpx,
13359    Giropay,
13360    Grabpay,
13361    Ideal,
13362    KakaoPay,
13363    Klarna,
13364    Konbini,
13365    KrCard,
13366    Link,
13367    MbWay,
13368    Mobilepay,
13369    Multibanco,
13370    NaverPay,
13371    NzBankAccount,
13372    Oxxo,
13373    P24,
13374    PayByBank,
13375    Payco,
13376    Paynow,
13377    Paypal,
13378    Pix,
13379    Promptpay,
13380    RevolutPay,
13381    SamsungPay,
13382    Satispay,
13383    SepaDebit,
13384    Sofort,
13385    Swish,
13386    Twint,
13387    UsBankAccount,
13388    WechatPay,
13389    Zip,
13390    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13391    Unknown(String),
13392}
13393impl UpdatePaymentIntentPaymentMethodDataType {
13394    pub fn as_str(&self) -> &str {
13395        use UpdatePaymentIntentPaymentMethodDataType::*;
13396        match self {
13397            AcssDebit => "acss_debit",
13398            Affirm => "affirm",
13399            AfterpayClearpay => "afterpay_clearpay",
13400            Alipay => "alipay",
13401            Alma => "alma",
13402            AmazonPay => "amazon_pay",
13403            AuBecsDebit => "au_becs_debit",
13404            BacsDebit => "bacs_debit",
13405            Bancontact => "bancontact",
13406            Billie => "billie",
13407            Blik => "blik",
13408            Boleto => "boleto",
13409            Cashapp => "cashapp",
13410            Crypto => "crypto",
13411            CustomerBalance => "customer_balance",
13412            Eps => "eps",
13413            Fpx => "fpx",
13414            Giropay => "giropay",
13415            Grabpay => "grabpay",
13416            Ideal => "ideal",
13417            KakaoPay => "kakao_pay",
13418            Klarna => "klarna",
13419            Konbini => "konbini",
13420            KrCard => "kr_card",
13421            Link => "link",
13422            MbWay => "mb_way",
13423            Mobilepay => "mobilepay",
13424            Multibanco => "multibanco",
13425            NaverPay => "naver_pay",
13426            NzBankAccount => "nz_bank_account",
13427            Oxxo => "oxxo",
13428            P24 => "p24",
13429            PayByBank => "pay_by_bank",
13430            Payco => "payco",
13431            Paynow => "paynow",
13432            Paypal => "paypal",
13433            Pix => "pix",
13434            Promptpay => "promptpay",
13435            RevolutPay => "revolut_pay",
13436            SamsungPay => "samsung_pay",
13437            Satispay => "satispay",
13438            SepaDebit => "sepa_debit",
13439            Sofort => "sofort",
13440            Swish => "swish",
13441            Twint => "twint",
13442            UsBankAccount => "us_bank_account",
13443            WechatPay => "wechat_pay",
13444            Zip => "zip",
13445            Unknown(v) => v,
13446        }
13447    }
13448}
13449
13450impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataType {
13451    type Err = std::convert::Infallible;
13452    fn from_str(s: &str) -> Result<Self, Self::Err> {
13453        use UpdatePaymentIntentPaymentMethodDataType::*;
13454        match s {
13455            "acss_debit" => Ok(AcssDebit),
13456            "affirm" => Ok(Affirm),
13457            "afterpay_clearpay" => Ok(AfterpayClearpay),
13458            "alipay" => Ok(Alipay),
13459            "alma" => Ok(Alma),
13460            "amazon_pay" => Ok(AmazonPay),
13461            "au_becs_debit" => Ok(AuBecsDebit),
13462            "bacs_debit" => Ok(BacsDebit),
13463            "bancontact" => Ok(Bancontact),
13464            "billie" => Ok(Billie),
13465            "blik" => Ok(Blik),
13466            "boleto" => Ok(Boleto),
13467            "cashapp" => Ok(Cashapp),
13468            "crypto" => Ok(Crypto),
13469            "customer_balance" => Ok(CustomerBalance),
13470            "eps" => Ok(Eps),
13471            "fpx" => Ok(Fpx),
13472            "giropay" => Ok(Giropay),
13473            "grabpay" => Ok(Grabpay),
13474            "ideal" => Ok(Ideal),
13475            "kakao_pay" => Ok(KakaoPay),
13476            "klarna" => Ok(Klarna),
13477            "konbini" => Ok(Konbini),
13478            "kr_card" => Ok(KrCard),
13479            "link" => Ok(Link),
13480            "mb_way" => Ok(MbWay),
13481            "mobilepay" => Ok(Mobilepay),
13482            "multibanco" => Ok(Multibanco),
13483            "naver_pay" => Ok(NaverPay),
13484            "nz_bank_account" => Ok(NzBankAccount),
13485            "oxxo" => Ok(Oxxo),
13486            "p24" => Ok(P24),
13487            "pay_by_bank" => Ok(PayByBank),
13488            "payco" => Ok(Payco),
13489            "paynow" => Ok(Paynow),
13490            "paypal" => Ok(Paypal),
13491            "pix" => Ok(Pix),
13492            "promptpay" => Ok(Promptpay),
13493            "revolut_pay" => Ok(RevolutPay),
13494            "samsung_pay" => Ok(SamsungPay),
13495            "satispay" => Ok(Satispay),
13496            "sepa_debit" => Ok(SepaDebit),
13497            "sofort" => Ok(Sofort),
13498            "swish" => Ok(Swish),
13499            "twint" => Ok(Twint),
13500            "us_bank_account" => Ok(UsBankAccount),
13501            "wechat_pay" => Ok(WechatPay),
13502            "zip" => Ok(Zip),
13503            v => Ok(Unknown(v.to_owned())),
13504        }
13505    }
13506}
13507impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType {
13508    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13509        f.write_str(self.as_str())
13510    }
13511}
13512
13513impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataType {
13514    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13515        f.write_str(self.as_str())
13516    }
13517}
13518impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataType {
13519    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13520    where
13521        S: serde::Serializer,
13522    {
13523        serializer.serialize_str(self.as_str())
13524    }
13525}
13526#[cfg(feature = "deserialize")]
13527impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataType {
13528    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13529        use std::str::FromStr;
13530        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13531        Ok(Self::from_str(&s).unwrap())
13532    }
13533}
13534/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
13535#[derive(Clone, Debug, serde::Serialize)]
13536pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount {
13537    /// Account holder type: individual or company.
13538    #[serde(skip_serializing_if = "Option::is_none")]
13539    pub account_holder_type:
13540        Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
13541    /// Account number of the bank account.
13542    #[serde(skip_serializing_if = "Option::is_none")]
13543    pub account_number: Option<String>,
13544    /// Account type: checkings or savings. Defaults to checking if omitted.
13545    #[serde(skip_serializing_if = "Option::is_none")]
13546    pub account_type: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
13547    /// The ID of a Financial Connections Account to use as a payment method.
13548    #[serde(skip_serializing_if = "Option::is_none")]
13549    pub financial_connections_account: Option<String>,
13550    /// Routing number of the bank account.
13551    #[serde(skip_serializing_if = "Option::is_none")]
13552    pub routing_number: Option<String>,
13553}
13554impl UpdatePaymentIntentPaymentMethodDataUsBankAccount {
13555    pub fn new() -> Self {
13556        Self {
13557            account_holder_type: None,
13558            account_number: None,
13559            account_type: None,
13560            financial_connections_account: None,
13561            routing_number: None,
13562        }
13563    }
13564}
13565impl Default for UpdatePaymentIntentPaymentMethodDataUsBankAccount {
13566    fn default() -> Self {
13567        Self::new()
13568    }
13569}
13570/// Account holder type: individual or company.
13571#[derive(Copy, Clone, Eq, PartialEq)]
13572pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13573    Company,
13574    Individual,
13575}
13576impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13577    pub fn as_str(self) -> &'static str {
13578        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
13579        match self {
13580            Company => "company",
13581            Individual => "individual",
13582        }
13583    }
13584}
13585
13586impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13587    type Err = stripe_types::StripeParseError;
13588    fn from_str(s: &str) -> Result<Self, Self::Err> {
13589        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
13590        match s {
13591            "company" => Ok(Company),
13592            "individual" => Ok(Individual),
13593            _ => Err(stripe_types::StripeParseError),
13594        }
13595    }
13596}
13597impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13598    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13599        f.write_str(self.as_str())
13600    }
13601}
13602
13603impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13604    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13605        f.write_str(self.as_str())
13606    }
13607}
13608impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
13609    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13610    where
13611        S: serde::Serializer,
13612    {
13613        serializer.serialize_str(self.as_str())
13614    }
13615}
13616#[cfg(feature = "deserialize")]
13617impl<'de> serde::Deserialize<'de>
13618    for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
13619{
13620    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13621        use std::str::FromStr;
13622        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13623        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
13624    }
13625}
13626/// Account type: checkings or savings. Defaults to checking if omitted.
13627#[derive(Copy, Clone, Eq, PartialEq)]
13628pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13629    Checking,
13630    Savings,
13631}
13632impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13633    pub fn as_str(self) -> &'static str {
13634        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
13635        match self {
13636            Checking => "checking",
13637            Savings => "savings",
13638        }
13639    }
13640}
13641
13642impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13643    type Err = stripe_types::StripeParseError;
13644    fn from_str(s: &str) -> Result<Self, Self::Err> {
13645        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
13646        match s {
13647            "checking" => Ok(Checking),
13648            "savings" => Ok(Savings),
13649            _ => Err(stripe_types::StripeParseError),
13650        }
13651    }
13652}
13653impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13655        f.write_str(self.as_str())
13656    }
13657}
13658
13659impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13660    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13661        f.write_str(self.as_str())
13662    }
13663}
13664impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13665    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13666    where
13667        S: serde::Serializer,
13668    {
13669        serializer.serialize_str(self.as_str())
13670    }
13671}
13672#[cfg(feature = "deserialize")]
13673impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
13674    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13675        use std::str::FromStr;
13676        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13677        Self::from_str(&s).map_err(|_| {
13678            serde::de::Error::custom(
13679                "Unknown value for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType",
13680            )
13681        })
13682    }
13683}
13684/// Payment-method-specific configuration for this PaymentIntent.
13685#[derive(Clone, Debug, serde::Serialize)]
13686pub struct UpdatePaymentIntentPaymentMethodOptions {
13687    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
13688    #[serde(skip_serializing_if = "Option::is_none")]
13689    pub acss_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebit>,
13690    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
13691    #[serde(skip_serializing_if = "Option::is_none")]
13692    pub affirm: Option<UpdatePaymentIntentPaymentMethodOptionsAffirm>,
13693    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
13694    #[serde(skip_serializing_if = "Option::is_none")]
13695    pub afterpay_clearpay: Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
13696    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
13697    #[serde(skip_serializing_if = "Option::is_none")]
13698    pub alipay: Option<UpdatePaymentIntentPaymentMethodOptionsAlipay>,
13699    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
13700    #[serde(skip_serializing_if = "Option::is_none")]
13701    pub alma: Option<UpdatePaymentIntentPaymentMethodOptionsAlma>,
13702    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
13703    #[serde(skip_serializing_if = "Option::is_none")]
13704    pub amazon_pay: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPay>,
13705    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
13706    #[serde(skip_serializing_if = "Option::is_none")]
13707    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
13708    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
13709    #[serde(skip_serializing_if = "Option::is_none")]
13710    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebit>,
13711    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
13712    #[serde(skip_serializing_if = "Option::is_none")]
13713    pub bancontact: Option<UpdatePaymentIntentPaymentMethodOptionsBancontact>,
13714    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
13715    #[serde(skip_serializing_if = "Option::is_none")]
13716    pub billie: Option<UpdatePaymentIntentPaymentMethodOptionsBillie>,
13717    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
13718    #[serde(skip_serializing_if = "Option::is_none")]
13719    pub blik: Option<UpdatePaymentIntentPaymentMethodOptionsBlik>,
13720    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
13721    #[serde(skip_serializing_if = "Option::is_none")]
13722    pub boleto: Option<UpdatePaymentIntentPaymentMethodOptionsBoleto>,
13723    /// Configuration for any card payments attempted on this PaymentIntent.
13724    #[serde(skip_serializing_if = "Option::is_none")]
13725    pub card: Option<UpdatePaymentIntentPaymentMethodOptionsCard>,
13726    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
13727    #[serde(skip_serializing_if = "Option::is_none")]
13728    pub card_present: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresent>,
13729    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
13730    #[serde(skip_serializing_if = "Option::is_none")]
13731    pub cashapp: Option<UpdatePaymentIntentPaymentMethodOptionsCashapp>,
13732    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
13733    #[serde(skip_serializing_if = "Option::is_none")]
13734    pub crypto: Option<UpdatePaymentIntentPaymentMethodOptionsCrypto>,
13735    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
13736    #[serde(skip_serializing_if = "Option::is_none")]
13737    pub customer_balance: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalance>,
13738    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
13739    #[serde(skip_serializing_if = "Option::is_none")]
13740    pub eps: Option<UpdatePaymentIntentPaymentMethodOptionsEps>,
13741    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
13742    #[serde(skip_serializing_if = "Option::is_none")]
13743    pub fpx: Option<UpdatePaymentIntentPaymentMethodOptionsFpx>,
13744    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
13745    #[serde(skip_serializing_if = "Option::is_none")]
13746    pub giropay: Option<UpdatePaymentIntentPaymentMethodOptionsGiropay>,
13747    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
13748    #[serde(skip_serializing_if = "Option::is_none")]
13749    pub grabpay: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpay>,
13750    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
13751    #[serde(skip_serializing_if = "Option::is_none")]
13752    pub ideal: Option<UpdatePaymentIntentPaymentMethodOptionsIdeal>,
13753    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
13754    #[serde(skip_serializing_if = "Option::is_none")]
13755    #[serde(with = "stripe_types::with_serde_json_opt")]
13756    pub interac_present: Option<miniserde::json::Value>,
13757    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
13758    #[serde(skip_serializing_if = "Option::is_none")]
13759    pub kakao_pay: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPay>,
13760    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
13761    #[serde(skip_serializing_if = "Option::is_none")]
13762    pub klarna: Option<UpdatePaymentIntentPaymentMethodOptionsKlarna>,
13763    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
13764    #[serde(skip_serializing_if = "Option::is_none")]
13765    pub konbini: Option<UpdatePaymentIntentPaymentMethodOptionsKonbini>,
13766    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
13767    #[serde(skip_serializing_if = "Option::is_none")]
13768    pub kr_card: Option<UpdatePaymentIntentPaymentMethodOptionsKrCard>,
13769    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
13770    #[serde(skip_serializing_if = "Option::is_none")]
13771    pub link: Option<UpdatePaymentIntentPaymentMethodOptionsLink>,
13772    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
13773    #[serde(skip_serializing_if = "Option::is_none")]
13774    pub mb_way: Option<UpdatePaymentIntentPaymentMethodOptionsMbWay>,
13775    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
13776    #[serde(skip_serializing_if = "Option::is_none")]
13777    pub mobilepay: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepay>,
13778    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
13779    #[serde(skip_serializing_if = "Option::is_none")]
13780    pub multibanco: Option<UpdatePaymentIntentPaymentMethodOptionsMultibanco>,
13781    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
13782    #[serde(skip_serializing_if = "Option::is_none")]
13783    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPay>,
13784    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
13785    #[serde(skip_serializing_if = "Option::is_none")]
13786    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccount>,
13787    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
13788    #[serde(skip_serializing_if = "Option::is_none")]
13789    pub oxxo: Option<UpdatePaymentIntentPaymentMethodOptionsOxxo>,
13790    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
13791    #[serde(skip_serializing_if = "Option::is_none")]
13792    pub p24: Option<UpdatePaymentIntentPaymentMethodOptionsP24>,
13793    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
13794    #[serde(skip_serializing_if = "Option::is_none")]
13795    #[serde(with = "stripe_types::with_serde_json_opt")]
13796    pub pay_by_bank: Option<miniserde::json::Value>,
13797    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
13798    #[serde(skip_serializing_if = "Option::is_none")]
13799    pub payco: Option<UpdatePaymentIntentPaymentMethodOptionsPayco>,
13800    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
13801    #[serde(skip_serializing_if = "Option::is_none")]
13802    pub paynow: Option<UpdatePaymentIntentPaymentMethodOptionsPaynow>,
13803    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
13804    #[serde(skip_serializing_if = "Option::is_none")]
13805    pub paypal: Option<UpdatePaymentIntentPaymentMethodOptionsPaypal>,
13806    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
13807    #[serde(skip_serializing_if = "Option::is_none")]
13808    pub pix: Option<UpdatePaymentIntentPaymentMethodOptionsPix>,
13809    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
13810    #[serde(skip_serializing_if = "Option::is_none")]
13811    pub promptpay: Option<UpdatePaymentIntentPaymentMethodOptionsPromptpay>,
13812    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
13813    #[serde(skip_serializing_if = "Option::is_none")]
13814    pub revolut_pay: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPay>,
13815    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
13816    #[serde(skip_serializing_if = "Option::is_none")]
13817    pub samsung_pay: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPay>,
13818    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
13819    #[serde(skip_serializing_if = "Option::is_none")]
13820    pub satispay: Option<UpdatePaymentIntentPaymentMethodOptionsSatispay>,
13821    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
13822    #[serde(skip_serializing_if = "Option::is_none")]
13823    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebit>,
13824    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
13825    #[serde(skip_serializing_if = "Option::is_none")]
13826    pub sofort: Option<UpdatePaymentIntentPaymentMethodOptionsSofort>,
13827    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
13828    #[serde(skip_serializing_if = "Option::is_none")]
13829    pub swish: Option<UpdatePaymentIntentPaymentMethodOptionsSwish>,
13830    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
13831    #[serde(skip_serializing_if = "Option::is_none")]
13832    pub twint: Option<UpdatePaymentIntentPaymentMethodOptionsTwint>,
13833    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
13834    #[serde(skip_serializing_if = "Option::is_none")]
13835    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccount>,
13836    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
13837    #[serde(skip_serializing_if = "Option::is_none")]
13838    pub wechat_pay: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPay>,
13839    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
13840    #[serde(skip_serializing_if = "Option::is_none")]
13841    pub zip: Option<UpdatePaymentIntentPaymentMethodOptionsZip>,
13842}
13843impl UpdatePaymentIntentPaymentMethodOptions {
13844    pub fn new() -> Self {
13845        Self {
13846            acss_debit: None,
13847            affirm: None,
13848            afterpay_clearpay: None,
13849            alipay: None,
13850            alma: None,
13851            amazon_pay: None,
13852            au_becs_debit: None,
13853            bacs_debit: None,
13854            bancontact: None,
13855            billie: None,
13856            blik: None,
13857            boleto: None,
13858            card: None,
13859            card_present: None,
13860            cashapp: None,
13861            crypto: None,
13862            customer_balance: None,
13863            eps: None,
13864            fpx: None,
13865            giropay: None,
13866            grabpay: None,
13867            ideal: None,
13868            interac_present: None,
13869            kakao_pay: None,
13870            klarna: None,
13871            konbini: None,
13872            kr_card: None,
13873            link: None,
13874            mb_way: None,
13875            mobilepay: None,
13876            multibanco: None,
13877            naver_pay: None,
13878            nz_bank_account: None,
13879            oxxo: None,
13880            p24: None,
13881            pay_by_bank: None,
13882            payco: None,
13883            paynow: None,
13884            paypal: None,
13885            pix: None,
13886            promptpay: None,
13887            revolut_pay: None,
13888            samsung_pay: None,
13889            satispay: None,
13890            sepa_debit: None,
13891            sofort: None,
13892            swish: None,
13893            twint: None,
13894            us_bank_account: None,
13895            wechat_pay: None,
13896            zip: None,
13897        }
13898    }
13899}
13900impl Default for UpdatePaymentIntentPaymentMethodOptions {
13901    fn default() -> Self {
13902        Self::new()
13903    }
13904}
13905/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
13906#[derive(Clone, Debug, serde::Serialize)]
13907pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13908    /// Additional fields for Mandate creation
13909    #[serde(skip_serializing_if = "Option::is_none")]
13910    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
13911    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
13912    ///
13913    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
13914    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
13915    ///
13916    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
13917    ///
13918    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
13919    ///
13920    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
13921    #[serde(skip_serializing_if = "Option::is_none")]
13922    pub setup_future_usage:
13923        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
13924    /// Controls when Stripe will attempt to debit the funds from the customer's account.
13925    /// The date must be a string in YYYY-MM-DD format.
13926    /// The date must be in the future and between 3 and 15 calendar days from now.
13927    #[serde(skip_serializing_if = "Option::is_none")]
13928    pub target_date: Option<String>,
13929    /// Bank account verification method.
13930    #[serde(skip_serializing_if = "Option::is_none")]
13931    pub verification_method:
13932        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
13933}
13934impl UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13935    pub fn new() -> Self {
13936        Self {
13937            mandate_options: None,
13938            setup_future_usage: None,
13939            target_date: None,
13940            verification_method: None,
13941        }
13942    }
13943}
13944impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
13945    fn default() -> Self {
13946        Self::new()
13947    }
13948}
13949/// Additional fields for Mandate creation
13950#[derive(Clone, Debug, serde::Serialize)]
13951pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
13952    /// A URL for custom mandate text to render during confirmation step.
13953    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
13954    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
13955    #[serde(skip_serializing_if = "Option::is_none")]
13956    pub custom_mandate_url: Option<String>,
13957    /// Description of the mandate interval.
13958    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
13959    #[serde(skip_serializing_if = "Option::is_none")]
13960    pub interval_description: Option<String>,
13961    /// Payment schedule for the mandate.
13962    #[serde(skip_serializing_if = "Option::is_none")]
13963    pub payment_schedule:
13964        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
13965    /// Transaction type of the mandate.
13966    #[serde(skip_serializing_if = "Option::is_none")]
13967    pub transaction_type:
13968        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
13969}
13970impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
13971    pub fn new() -> Self {
13972        Self {
13973            custom_mandate_url: None,
13974            interval_description: None,
13975            payment_schedule: None,
13976            transaction_type: None,
13977        }
13978    }
13979}
13980impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
13981    fn default() -> Self {
13982        Self::new()
13983    }
13984}
13985/// Payment schedule for the mandate.
13986#[derive(Copy, Clone, Eq, PartialEq)]
13987pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
13988    Combined,
13989    Interval,
13990    Sporadic,
13991}
13992impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
13993    pub fn as_str(self) -> &'static str {
13994        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
13995        match self {
13996            Combined => "combined",
13997            Interval => "interval",
13998            Sporadic => "sporadic",
13999        }
14000    }
14001}
14002
14003impl std::str::FromStr
14004    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14005{
14006    type Err = stripe_types::StripeParseError;
14007    fn from_str(s: &str) -> Result<Self, Self::Err> {
14008        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
14009        match s {
14010            "combined" => Ok(Combined),
14011            "interval" => Ok(Interval),
14012            "sporadic" => Ok(Sporadic),
14013            _ => Err(stripe_types::StripeParseError),
14014        }
14015    }
14016}
14017impl std::fmt::Display
14018    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14019{
14020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14021        f.write_str(self.as_str())
14022    }
14023}
14024
14025impl std::fmt::Debug
14026    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14027{
14028    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14029        f.write_str(self.as_str())
14030    }
14031}
14032impl serde::Serialize
14033    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14034{
14035    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14036    where
14037        S: serde::Serializer,
14038    {
14039        serializer.serialize_str(self.as_str())
14040    }
14041}
14042#[cfg(feature = "deserialize")]
14043impl<'de> serde::Deserialize<'de>
14044    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
14045{
14046    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14047        use std::str::FromStr;
14048        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14049        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
14050    }
14051}
14052/// Transaction type of the mandate.
14053#[derive(Copy, Clone, Eq, PartialEq)]
14054pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
14055    Business,
14056    Personal,
14057}
14058impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
14059    pub fn as_str(self) -> &'static str {
14060        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
14061        match self {
14062            Business => "business",
14063            Personal => "personal",
14064        }
14065    }
14066}
14067
14068impl std::str::FromStr
14069    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14070{
14071    type Err = stripe_types::StripeParseError;
14072    fn from_str(s: &str) -> Result<Self, Self::Err> {
14073        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
14074        match s {
14075            "business" => Ok(Business),
14076            "personal" => Ok(Personal),
14077            _ => Err(stripe_types::StripeParseError),
14078        }
14079    }
14080}
14081impl std::fmt::Display
14082    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14083{
14084    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14085        f.write_str(self.as_str())
14086    }
14087}
14088
14089impl std::fmt::Debug
14090    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14091{
14092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14093        f.write_str(self.as_str())
14094    }
14095}
14096impl serde::Serialize
14097    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14098{
14099    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14100    where
14101        S: serde::Serializer,
14102    {
14103        serializer.serialize_str(self.as_str())
14104    }
14105}
14106#[cfg(feature = "deserialize")]
14107impl<'de> serde::Deserialize<'de>
14108    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
14109{
14110    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14111        use std::str::FromStr;
14112        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14113        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
14114    }
14115}
14116/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14117///
14118/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14119/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14120///
14121/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14122///
14123/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14124///
14125/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14126#[derive(Copy, Clone, Eq, PartialEq)]
14127pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14128    None,
14129    OffSession,
14130    OnSession,
14131}
14132impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14133    pub fn as_str(self) -> &'static str {
14134        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
14135        match self {
14136            None => "none",
14137            OffSession => "off_session",
14138            OnSession => "on_session",
14139        }
14140    }
14141}
14142
14143impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14144    type Err = stripe_types::StripeParseError;
14145    fn from_str(s: &str) -> Result<Self, Self::Err> {
14146        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
14147        match s {
14148            "none" => Ok(None),
14149            "off_session" => Ok(OffSession),
14150            "on_session" => Ok(OnSession),
14151            _ => Err(stripe_types::StripeParseError),
14152        }
14153    }
14154}
14155impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14156    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14157        f.write_str(self.as_str())
14158    }
14159}
14160
14161impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14162    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14163        f.write_str(self.as_str())
14164    }
14165}
14166impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
14167    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14168    where
14169        S: serde::Serializer,
14170    {
14171        serializer.serialize_str(self.as_str())
14172    }
14173}
14174#[cfg(feature = "deserialize")]
14175impl<'de> serde::Deserialize<'de>
14176    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
14177{
14178    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14179        use std::str::FromStr;
14180        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14181        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
14182    }
14183}
14184/// Bank account verification method.
14185#[derive(Copy, Clone, Eq, PartialEq)]
14186pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14187    Automatic,
14188    Instant,
14189    Microdeposits,
14190}
14191impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14192    pub fn as_str(self) -> &'static str {
14193        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
14194        match self {
14195            Automatic => "automatic",
14196            Instant => "instant",
14197            Microdeposits => "microdeposits",
14198        }
14199    }
14200}
14201
14202impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14203    type Err = stripe_types::StripeParseError;
14204    fn from_str(s: &str) -> Result<Self, Self::Err> {
14205        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
14206        match s {
14207            "automatic" => Ok(Automatic),
14208            "instant" => Ok(Instant),
14209            "microdeposits" => Ok(Microdeposits),
14210            _ => Err(stripe_types::StripeParseError),
14211        }
14212    }
14213}
14214impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14215    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14216        f.write_str(self.as_str())
14217    }
14218}
14219
14220impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14221    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14222        f.write_str(self.as_str())
14223    }
14224}
14225impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
14226    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14227    where
14228        S: serde::Serializer,
14229    {
14230        serializer.serialize_str(self.as_str())
14231    }
14232}
14233#[cfg(feature = "deserialize")]
14234impl<'de> serde::Deserialize<'de>
14235    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
14236{
14237    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14238        use std::str::FromStr;
14239        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14240        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
14241    }
14242}
14243/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
14244#[derive(Clone, Debug, serde::Serialize)]
14245pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm {
14246    /// Controls when the funds are captured from the customer's account.
14247    ///
14248    /// 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.
14249    ///
14250    /// 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.
14251    #[serde(skip_serializing_if = "Option::is_none")]
14252    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
14253    /// Preferred language of the Affirm authorization page that the customer is redirected to.
14254    #[serde(skip_serializing_if = "Option::is_none")]
14255    pub preferred_locale: Option<String>,
14256    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14257    ///
14258    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14259    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14260    ///
14261    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14262    ///
14263    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14264    ///
14265    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14266    #[serde(skip_serializing_if = "Option::is_none")]
14267    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
14268}
14269impl UpdatePaymentIntentPaymentMethodOptionsAffirm {
14270    pub fn new() -> Self {
14271        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
14272    }
14273}
14274impl Default for UpdatePaymentIntentPaymentMethodOptionsAffirm {
14275    fn default() -> Self {
14276        Self::new()
14277    }
14278}
14279/// Controls when the funds are captured from the customer's account.
14280///
14281/// 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.
14282///
14283/// 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.
14284#[derive(Copy, Clone, Eq, PartialEq)]
14285pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14286    Manual,
14287}
14288impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14289    pub fn as_str(self) -> &'static str {
14290        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
14291        match self {
14292            Manual => "manual",
14293        }
14294    }
14295}
14296
14297impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14298    type Err = stripe_types::StripeParseError;
14299    fn from_str(s: &str) -> Result<Self, Self::Err> {
14300        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
14301        match s {
14302            "manual" => Ok(Manual),
14303            _ => Err(stripe_types::StripeParseError),
14304        }
14305    }
14306}
14307impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14308    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14309        f.write_str(self.as_str())
14310    }
14311}
14312
14313impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14315        f.write_str(self.as_str())
14316    }
14317}
14318impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14319    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14320    where
14321        S: serde::Serializer,
14322    {
14323        serializer.serialize_str(self.as_str())
14324    }
14325}
14326#[cfg(feature = "deserialize")]
14327impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
14328    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14329        use std::str::FromStr;
14330        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14331        Self::from_str(&s).map_err(|_| {
14332            serde::de::Error::custom(
14333                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
14334            )
14335        })
14336    }
14337}
14338/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14339///
14340/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14341/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14342///
14343/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14344///
14345/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14346///
14347/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14348#[derive(Copy, Clone, Eq, PartialEq)]
14349pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14350    None,
14351}
14352impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14353    pub fn as_str(self) -> &'static str {
14354        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
14355        match self {
14356            None => "none",
14357        }
14358    }
14359}
14360
14361impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14362    type Err = stripe_types::StripeParseError;
14363    fn from_str(s: &str) -> Result<Self, Self::Err> {
14364        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
14365        match s {
14366            "none" => Ok(None),
14367            _ => Err(stripe_types::StripeParseError),
14368        }
14369    }
14370}
14371impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14372    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14373        f.write_str(self.as_str())
14374    }
14375}
14376
14377impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14378    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14379        f.write_str(self.as_str())
14380    }
14381}
14382impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
14383    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14384    where
14385        S: serde::Serializer,
14386    {
14387        serializer.serialize_str(self.as_str())
14388    }
14389}
14390#[cfg(feature = "deserialize")]
14391impl<'de> serde::Deserialize<'de>
14392    for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
14393{
14394    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14395        use std::str::FromStr;
14396        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14397        Self::from_str(&s).map_err(|_| {
14398            serde::de::Error::custom(
14399                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
14400            )
14401        })
14402    }
14403}
14404/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
14405#[derive(Clone, Debug, serde::Serialize)]
14406pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
14407    /// Controls when the funds are captured from the customer's account.
14408    ///
14409    /// 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.
14410    ///
14411    /// 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.
14412    #[serde(skip_serializing_if = "Option::is_none")]
14413    pub capture_method:
14414        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
14415    /// An internal identifier or reference that this payment corresponds to.
14416    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
14417    /// This field differs from the statement descriptor and item name.
14418    #[serde(skip_serializing_if = "Option::is_none")]
14419    pub reference: Option<String>,
14420    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14421    ///
14422    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14423    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14424    ///
14425    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14426    ///
14427    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14428    ///
14429    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14430    #[serde(skip_serializing_if = "Option::is_none")]
14431    pub setup_future_usage:
14432        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
14433}
14434impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
14435    pub fn new() -> Self {
14436        Self { capture_method: None, reference: None, setup_future_usage: None }
14437    }
14438}
14439impl Default for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
14440    fn default() -> Self {
14441        Self::new()
14442    }
14443}
14444/// Controls when the funds are captured from the customer's account.
14445///
14446/// 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.
14447///
14448/// 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.
14449#[derive(Copy, Clone, Eq, PartialEq)]
14450pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14451    Manual,
14452}
14453impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14454    pub fn as_str(self) -> &'static str {
14455        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
14456        match self {
14457            Manual => "manual",
14458        }
14459    }
14460}
14461
14462impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14463    type Err = stripe_types::StripeParseError;
14464    fn from_str(s: &str) -> Result<Self, Self::Err> {
14465        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
14466        match s {
14467            "manual" => Ok(Manual),
14468            _ => Err(stripe_types::StripeParseError),
14469        }
14470    }
14471}
14472impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14473    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14474        f.write_str(self.as_str())
14475    }
14476}
14477
14478impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14479    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14480        f.write_str(self.as_str())
14481    }
14482}
14483impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
14484    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14485    where
14486        S: serde::Serializer,
14487    {
14488        serializer.serialize_str(self.as_str())
14489    }
14490}
14491#[cfg(feature = "deserialize")]
14492impl<'de> serde::Deserialize<'de>
14493    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
14494{
14495    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14496        use std::str::FromStr;
14497        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14498        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
14499    }
14500}
14501/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14502///
14503/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14504/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14505///
14506/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14507///
14508/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14509///
14510/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14511#[derive(Copy, Clone, Eq, PartialEq)]
14512pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14513    None,
14514}
14515impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14516    pub fn as_str(self) -> &'static str {
14517        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
14518        match self {
14519            None => "none",
14520        }
14521    }
14522}
14523
14524impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14525    type Err = stripe_types::StripeParseError;
14526    fn from_str(s: &str) -> Result<Self, Self::Err> {
14527        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
14528        match s {
14529            "none" => Ok(None),
14530            _ => Err(stripe_types::StripeParseError),
14531        }
14532    }
14533}
14534impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14535    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14536        f.write_str(self.as_str())
14537    }
14538}
14539
14540impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14541    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14542        f.write_str(self.as_str())
14543    }
14544}
14545impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
14546    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14547    where
14548        S: serde::Serializer,
14549    {
14550        serializer.serialize_str(self.as_str())
14551    }
14552}
14553#[cfg(feature = "deserialize")]
14554impl<'de> serde::Deserialize<'de>
14555    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
14556{
14557    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14558        use std::str::FromStr;
14559        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14560        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
14561    }
14562}
14563/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
14564#[derive(Copy, Clone, Debug, serde::Serialize)]
14565pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay {
14566    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14567    ///
14568    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14569    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14570    ///
14571    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14572    ///
14573    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14574    ///
14575    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14576    #[serde(skip_serializing_if = "Option::is_none")]
14577    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
14578}
14579impl UpdatePaymentIntentPaymentMethodOptionsAlipay {
14580    pub fn new() -> Self {
14581        Self { setup_future_usage: None }
14582    }
14583}
14584impl Default for UpdatePaymentIntentPaymentMethodOptionsAlipay {
14585    fn default() -> Self {
14586        Self::new()
14587    }
14588}
14589/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14590///
14591/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14592/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14593///
14594/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14595///
14596/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14597///
14598/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14599#[derive(Copy, Clone, Eq, PartialEq)]
14600pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14601    None,
14602    OffSession,
14603}
14604impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14605    pub fn as_str(self) -> &'static str {
14606        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
14607        match self {
14608            None => "none",
14609            OffSession => "off_session",
14610        }
14611    }
14612}
14613
14614impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14615    type Err = stripe_types::StripeParseError;
14616    fn from_str(s: &str) -> Result<Self, Self::Err> {
14617        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
14618        match s {
14619            "none" => Ok(None),
14620            "off_session" => Ok(OffSession),
14621            _ => Err(stripe_types::StripeParseError),
14622        }
14623    }
14624}
14625impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14626    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14627        f.write_str(self.as_str())
14628    }
14629}
14630
14631impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14632    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14633        f.write_str(self.as_str())
14634    }
14635}
14636impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
14637    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14638    where
14639        S: serde::Serializer,
14640    {
14641        serializer.serialize_str(self.as_str())
14642    }
14643}
14644#[cfg(feature = "deserialize")]
14645impl<'de> serde::Deserialize<'de>
14646    for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
14647{
14648    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14649        use std::str::FromStr;
14650        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14651        Self::from_str(&s).map_err(|_| {
14652            serde::de::Error::custom(
14653                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
14654            )
14655        })
14656    }
14657}
14658/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
14659#[derive(Copy, Clone, Debug, serde::Serialize)]
14660pub struct UpdatePaymentIntentPaymentMethodOptionsAlma {
14661    /// Controls when the funds are captured from the customer's account.
14662    ///
14663    /// 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.
14664    ///
14665    /// 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.
14666    #[serde(skip_serializing_if = "Option::is_none")]
14667    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
14668}
14669impl UpdatePaymentIntentPaymentMethodOptionsAlma {
14670    pub fn new() -> Self {
14671        Self { capture_method: None }
14672    }
14673}
14674impl Default for UpdatePaymentIntentPaymentMethodOptionsAlma {
14675    fn default() -> Self {
14676        Self::new()
14677    }
14678}
14679/// Controls when the funds are captured from the customer's account.
14680///
14681/// 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.
14682///
14683/// 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.
14684#[derive(Copy, Clone, Eq, PartialEq)]
14685pub enum UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14686    Manual,
14687}
14688impl UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14689    pub fn as_str(self) -> &'static str {
14690        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
14691        match self {
14692            Manual => "manual",
14693        }
14694    }
14695}
14696
14697impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14698    type Err = stripe_types::StripeParseError;
14699    fn from_str(s: &str) -> Result<Self, Self::Err> {
14700        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
14701        match s {
14702            "manual" => Ok(Manual),
14703            _ => Err(stripe_types::StripeParseError),
14704        }
14705    }
14706}
14707impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14708    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14709        f.write_str(self.as_str())
14710    }
14711}
14712
14713impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14714    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14715        f.write_str(self.as_str())
14716    }
14717}
14718impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14719    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14720    where
14721        S: serde::Serializer,
14722    {
14723        serializer.serialize_str(self.as_str())
14724    }
14725}
14726#[cfg(feature = "deserialize")]
14727impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
14728    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14729        use std::str::FromStr;
14730        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14731        Self::from_str(&s).map_err(|_| {
14732            serde::de::Error::custom(
14733                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
14734            )
14735        })
14736    }
14737}
14738/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
14739#[derive(Copy, Clone, Debug, serde::Serialize)]
14740pub struct UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14741    /// Controls when the funds are captured from the customer's account.
14742    ///
14743    /// 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.
14744    ///
14745    /// 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.
14746    #[serde(skip_serializing_if = "Option::is_none")]
14747    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
14748    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14749    ///
14750    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14751    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14752    ///
14753    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14754    ///
14755    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14756    #[serde(skip_serializing_if = "Option::is_none")]
14757    pub setup_future_usage:
14758        Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
14759}
14760impl UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14761    pub fn new() -> Self {
14762        Self { capture_method: None, setup_future_usage: None }
14763    }
14764}
14765impl Default for UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
14766    fn default() -> Self {
14767        Self::new()
14768    }
14769}
14770/// Controls when the funds are captured from the customer's account.
14771///
14772/// 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.
14773///
14774/// 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.
14775#[derive(Copy, Clone, Eq, PartialEq)]
14776pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14777    Manual,
14778}
14779impl UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14780    pub fn as_str(self) -> &'static str {
14781        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
14782        match self {
14783            Manual => "manual",
14784        }
14785    }
14786}
14787
14788impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14789    type Err = stripe_types::StripeParseError;
14790    fn from_str(s: &str) -> Result<Self, Self::Err> {
14791        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
14792        match s {
14793            "manual" => Ok(Manual),
14794            _ => Err(stripe_types::StripeParseError),
14795        }
14796    }
14797}
14798impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14799    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14800        f.write_str(self.as_str())
14801    }
14802}
14803
14804impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14806        f.write_str(self.as_str())
14807    }
14808}
14809impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
14810    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14811    where
14812        S: serde::Serializer,
14813    {
14814        serializer.serialize_str(self.as_str())
14815    }
14816}
14817#[cfg(feature = "deserialize")]
14818impl<'de> serde::Deserialize<'de>
14819    for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
14820{
14821    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14822        use std::str::FromStr;
14823        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14824        Self::from_str(&s).map_err(|_| {
14825            serde::de::Error::custom(
14826                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
14827            )
14828        })
14829    }
14830}
14831/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14832///
14833/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14834/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14835///
14836/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14837///
14838/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14839#[derive(Copy, Clone, Eq, PartialEq)]
14840pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14841    None,
14842    OffSession,
14843}
14844impl UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14845    pub fn as_str(self) -> &'static str {
14846        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
14847        match self {
14848            None => "none",
14849            OffSession => "off_session",
14850        }
14851    }
14852}
14853
14854impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14855    type Err = stripe_types::StripeParseError;
14856    fn from_str(s: &str) -> Result<Self, Self::Err> {
14857        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
14858        match s {
14859            "none" => Ok(None),
14860            "off_session" => Ok(OffSession),
14861            _ => Err(stripe_types::StripeParseError),
14862        }
14863    }
14864}
14865impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14867        f.write_str(self.as_str())
14868    }
14869}
14870
14871impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14872    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14873        f.write_str(self.as_str())
14874    }
14875}
14876impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
14877    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14878    where
14879        S: serde::Serializer,
14880    {
14881        serializer.serialize_str(self.as_str())
14882    }
14883}
14884#[cfg(feature = "deserialize")]
14885impl<'de> serde::Deserialize<'de>
14886    for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
14887{
14888    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14889        use std::str::FromStr;
14890        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14891        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
14892    }
14893}
14894/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
14895#[derive(Clone, Debug, serde::Serialize)]
14896pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14897    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14898    ///
14899    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14900    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14901    ///
14902    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14903    ///
14904    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14905    ///
14906    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14907    #[serde(skip_serializing_if = "Option::is_none")]
14908    pub setup_future_usage:
14909        Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
14910    /// Controls when Stripe will attempt to debit the funds from the customer's account.
14911    /// The date must be a string in YYYY-MM-DD format.
14912    /// The date must be in the future and between 3 and 15 calendar days from now.
14913    #[serde(skip_serializing_if = "Option::is_none")]
14914    pub target_date: Option<String>,
14915}
14916impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14917    pub fn new() -> Self {
14918        Self { setup_future_usage: None, target_date: None }
14919    }
14920}
14921impl Default for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
14922    fn default() -> Self {
14923        Self::new()
14924    }
14925}
14926/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
14927///
14928/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
14929/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
14930///
14931/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
14932///
14933/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
14934///
14935/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
14936#[derive(Copy, Clone, Eq, PartialEq)]
14937pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14938    None,
14939    OffSession,
14940    OnSession,
14941}
14942impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14943    pub fn as_str(self) -> &'static str {
14944        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
14945        match self {
14946            None => "none",
14947            OffSession => "off_session",
14948            OnSession => "on_session",
14949        }
14950    }
14951}
14952
14953impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14954    type Err = stripe_types::StripeParseError;
14955    fn from_str(s: &str) -> Result<Self, Self::Err> {
14956        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
14957        match s {
14958            "none" => Ok(None),
14959            "off_session" => Ok(OffSession),
14960            "on_session" => Ok(OnSession),
14961            _ => Err(stripe_types::StripeParseError),
14962        }
14963    }
14964}
14965impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14966    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14967        f.write_str(self.as_str())
14968    }
14969}
14970
14971impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14972    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14973        f.write_str(self.as_str())
14974    }
14975}
14976impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
14977    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14978    where
14979        S: serde::Serializer,
14980    {
14981        serializer.serialize_str(self.as_str())
14982    }
14983}
14984#[cfg(feature = "deserialize")]
14985impl<'de> serde::Deserialize<'de>
14986    for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
14987{
14988    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14989        use std::str::FromStr;
14990        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14991        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
14992    }
14993}
14994/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
14995#[derive(Clone, Debug, serde::Serialize)]
14996pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
14997    /// Additional fields for Mandate creation
14998    #[serde(skip_serializing_if = "Option::is_none")]
14999    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
15000    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15001    ///
15002    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15003    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15004    ///
15005    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15006    ///
15007    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15008    ///
15009    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15010    #[serde(skip_serializing_if = "Option::is_none")]
15011    pub setup_future_usage:
15012        Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
15013    /// Controls when Stripe will attempt to debit the funds from the customer's account.
15014    /// The date must be a string in YYYY-MM-DD format.
15015    /// The date must be in the future and between 3 and 15 calendar days from now.
15016    #[serde(skip_serializing_if = "Option::is_none")]
15017    pub target_date: Option<String>,
15018}
15019impl UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
15020    pub fn new() -> Self {
15021        Self { mandate_options: None, setup_future_usage: None, target_date: None }
15022    }
15023}
15024impl Default for UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
15025    fn default() -> Self {
15026        Self::new()
15027    }
15028}
15029/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15030///
15031/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15032/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15033///
15034/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15035///
15036/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15037///
15038/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15039#[derive(Copy, Clone, Eq, PartialEq)]
15040pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15041    None,
15042    OffSession,
15043    OnSession,
15044}
15045impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15046    pub fn as_str(self) -> &'static str {
15047        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
15048        match self {
15049            None => "none",
15050            OffSession => "off_session",
15051            OnSession => "on_session",
15052        }
15053    }
15054}
15055
15056impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15057    type Err = stripe_types::StripeParseError;
15058    fn from_str(s: &str) -> Result<Self, Self::Err> {
15059        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
15060        match s {
15061            "none" => Ok(None),
15062            "off_session" => Ok(OffSession),
15063            "on_session" => Ok(OnSession),
15064            _ => Err(stripe_types::StripeParseError),
15065        }
15066    }
15067}
15068impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15069    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15070        f.write_str(self.as_str())
15071    }
15072}
15073
15074impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15076        f.write_str(self.as_str())
15077    }
15078}
15079impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
15080    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15081    where
15082        S: serde::Serializer,
15083    {
15084        serializer.serialize_str(self.as_str())
15085    }
15086}
15087#[cfg(feature = "deserialize")]
15088impl<'de> serde::Deserialize<'de>
15089    for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
15090{
15091    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15092        use std::str::FromStr;
15093        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15094        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
15095    }
15096}
15097/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
15098#[derive(Copy, Clone, Debug, serde::Serialize)]
15099pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact {
15100    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
15101    #[serde(skip_serializing_if = "Option::is_none")]
15102    pub preferred_language:
15103        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
15104    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15105    ///
15106    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15107    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15108    ///
15109    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15110    ///
15111    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15112    ///
15113    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15114    #[serde(skip_serializing_if = "Option::is_none")]
15115    pub setup_future_usage:
15116        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
15117}
15118impl UpdatePaymentIntentPaymentMethodOptionsBancontact {
15119    pub fn new() -> Self {
15120        Self { preferred_language: None, setup_future_usage: None }
15121    }
15122}
15123impl Default for UpdatePaymentIntentPaymentMethodOptionsBancontact {
15124    fn default() -> Self {
15125        Self::new()
15126    }
15127}
15128/// Preferred language of the Bancontact authorization page that the customer is redirected to.
15129#[derive(Copy, Clone, Eq, PartialEq)]
15130pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15131    De,
15132    En,
15133    Fr,
15134    Nl,
15135}
15136impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15137    pub fn as_str(self) -> &'static str {
15138        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
15139        match self {
15140            De => "de",
15141            En => "en",
15142            Fr => "fr",
15143            Nl => "nl",
15144        }
15145    }
15146}
15147
15148impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15149    type Err = stripe_types::StripeParseError;
15150    fn from_str(s: &str) -> Result<Self, Self::Err> {
15151        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
15152        match s {
15153            "de" => Ok(De),
15154            "en" => Ok(En),
15155            "fr" => Ok(Fr),
15156            "nl" => Ok(Nl),
15157            _ => Err(stripe_types::StripeParseError),
15158        }
15159    }
15160}
15161impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15162    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15163        f.write_str(self.as_str())
15164    }
15165}
15166
15167impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15168    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15169        f.write_str(self.as_str())
15170    }
15171}
15172impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
15173    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15174    where
15175        S: serde::Serializer,
15176    {
15177        serializer.serialize_str(self.as_str())
15178    }
15179}
15180#[cfg(feature = "deserialize")]
15181impl<'de> serde::Deserialize<'de>
15182    for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
15183{
15184    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15185        use std::str::FromStr;
15186        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15187        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
15188    }
15189}
15190/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15191///
15192/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15193/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15194///
15195/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15196///
15197/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15198///
15199/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15200#[derive(Copy, Clone, Eq, PartialEq)]
15201pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15202    None,
15203    OffSession,
15204}
15205impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15206    pub fn as_str(self) -> &'static str {
15207        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
15208        match self {
15209            None => "none",
15210            OffSession => "off_session",
15211        }
15212    }
15213}
15214
15215impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15216    type Err = stripe_types::StripeParseError;
15217    fn from_str(s: &str) -> Result<Self, Self::Err> {
15218        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
15219        match s {
15220            "none" => Ok(None),
15221            "off_session" => Ok(OffSession),
15222            _ => Err(stripe_types::StripeParseError),
15223        }
15224    }
15225}
15226impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15228        f.write_str(self.as_str())
15229    }
15230}
15231
15232impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15233    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15234        f.write_str(self.as_str())
15235    }
15236}
15237impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
15238    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15239    where
15240        S: serde::Serializer,
15241    {
15242        serializer.serialize_str(self.as_str())
15243    }
15244}
15245#[cfg(feature = "deserialize")]
15246impl<'de> serde::Deserialize<'de>
15247    for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
15248{
15249    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15250        use std::str::FromStr;
15251        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15252        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
15253    }
15254}
15255/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
15256#[derive(Copy, Clone, Debug, serde::Serialize)]
15257pub struct UpdatePaymentIntentPaymentMethodOptionsBillie {
15258    /// Controls when the funds are captured from the customer's account.
15259    ///
15260    /// 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.
15261    ///
15262    /// 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.
15263    #[serde(skip_serializing_if = "Option::is_none")]
15264    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
15265}
15266impl UpdatePaymentIntentPaymentMethodOptionsBillie {
15267    pub fn new() -> Self {
15268        Self { capture_method: None }
15269    }
15270}
15271impl Default for UpdatePaymentIntentPaymentMethodOptionsBillie {
15272    fn default() -> Self {
15273        Self::new()
15274    }
15275}
15276/// Controls when the funds are captured from the customer's account.
15277///
15278/// 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.
15279///
15280/// 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.
15281#[derive(Copy, Clone, Eq, PartialEq)]
15282pub enum UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15283    Manual,
15284}
15285impl UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15286    pub fn as_str(self) -> &'static str {
15287        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
15288        match self {
15289            Manual => "manual",
15290        }
15291    }
15292}
15293
15294impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15295    type Err = stripe_types::StripeParseError;
15296    fn from_str(s: &str) -> Result<Self, Self::Err> {
15297        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
15298        match s {
15299            "manual" => Ok(Manual),
15300            _ => Err(stripe_types::StripeParseError),
15301        }
15302    }
15303}
15304impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15305    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15306        f.write_str(self.as_str())
15307    }
15308}
15309
15310impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15311    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15312        f.write_str(self.as_str())
15313    }
15314}
15315impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15316    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15317    where
15318        S: serde::Serializer,
15319    {
15320        serializer.serialize_str(self.as_str())
15321    }
15322}
15323#[cfg(feature = "deserialize")]
15324impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
15325    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15326        use std::str::FromStr;
15327        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15328        Self::from_str(&s).map_err(|_| {
15329            serde::de::Error::custom(
15330                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod",
15331            )
15332        })
15333    }
15334}
15335/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
15336#[derive(Clone, Debug, serde::Serialize)]
15337pub struct UpdatePaymentIntentPaymentMethodOptionsBlik {
15338    /// The 6-digit BLIK code that a customer has generated using their banking application.
15339    /// Can only be set on confirmation.
15340    #[serde(skip_serializing_if = "Option::is_none")]
15341    pub code: Option<String>,
15342    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15343    ///
15344    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15345    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15346    ///
15347    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15348    ///
15349    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15350    ///
15351    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15352    #[serde(skip_serializing_if = "Option::is_none")]
15353    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
15354}
15355impl UpdatePaymentIntentPaymentMethodOptionsBlik {
15356    pub fn new() -> Self {
15357        Self { code: None, setup_future_usage: None }
15358    }
15359}
15360impl Default for UpdatePaymentIntentPaymentMethodOptionsBlik {
15361    fn default() -> Self {
15362        Self::new()
15363    }
15364}
15365/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15366///
15367/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15368/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15369///
15370/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15371///
15372/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15373///
15374/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15375#[derive(Copy, Clone, Eq, PartialEq)]
15376pub enum UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15377    None,
15378}
15379impl UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15380    pub fn as_str(self) -> &'static str {
15381        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
15382        match self {
15383            None => "none",
15384        }
15385    }
15386}
15387
15388impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15389    type Err = stripe_types::StripeParseError;
15390    fn from_str(s: &str) -> Result<Self, Self::Err> {
15391        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
15392        match s {
15393            "none" => Ok(None),
15394            _ => Err(stripe_types::StripeParseError),
15395        }
15396    }
15397}
15398impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15399    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15400        f.write_str(self.as_str())
15401    }
15402}
15403
15404impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15405    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15406        f.write_str(self.as_str())
15407    }
15408}
15409impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15410    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15411    where
15412        S: serde::Serializer,
15413    {
15414        serializer.serialize_str(self.as_str())
15415    }
15416}
15417#[cfg(feature = "deserialize")]
15418impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
15419    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15420        use std::str::FromStr;
15421        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15422        Self::from_str(&s).map_err(|_| {
15423            serde::de::Error::custom(
15424                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
15425            )
15426        })
15427    }
15428}
15429/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
15430#[derive(Copy, Clone, Debug, serde::Serialize)]
15431pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto {
15432    /// The number of calendar days before a Boleto voucher expires.
15433    /// 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.
15434    #[serde(skip_serializing_if = "Option::is_none")]
15435    pub expires_after_days: Option<u32>,
15436    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15437    ///
15438    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15439    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15440    ///
15441    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15442    ///
15443    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15444    ///
15445    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15446    #[serde(skip_serializing_if = "Option::is_none")]
15447    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
15448}
15449impl UpdatePaymentIntentPaymentMethodOptionsBoleto {
15450    pub fn new() -> Self {
15451        Self { expires_after_days: None, setup_future_usage: None }
15452    }
15453}
15454impl Default for UpdatePaymentIntentPaymentMethodOptionsBoleto {
15455    fn default() -> Self {
15456        Self::new()
15457    }
15458}
15459/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15460///
15461/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15462/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15463///
15464/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15465///
15466/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15467///
15468/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15469#[derive(Copy, Clone, Eq, PartialEq)]
15470pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15471    None,
15472    OffSession,
15473    OnSession,
15474}
15475impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15476    pub fn as_str(self) -> &'static str {
15477        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
15478        match self {
15479            None => "none",
15480            OffSession => "off_session",
15481            OnSession => "on_session",
15482        }
15483    }
15484}
15485
15486impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15487    type Err = stripe_types::StripeParseError;
15488    fn from_str(s: &str) -> Result<Self, Self::Err> {
15489        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
15490        match s {
15491            "none" => Ok(None),
15492            "off_session" => Ok(OffSession),
15493            "on_session" => Ok(OnSession),
15494            _ => Err(stripe_types::StripeParseError),
15495        }
15496    }
15497}
15498impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15499    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15500        f.write_str(self.as_str())
15501    }
15502}
15503
15504impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15505    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15506        f.write_str(self.as_str())
15507    }
15508}
15509impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
15510    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15511    where
15512        S: serde::Serializer,
15513    {
15514        serializer.serialize_str(self.as_str())
15515    }
15516}
15517#[cfg(feature = "deserialize")]
15518impl<'de> serde::Deserialize<'de>
15519    for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
15520{
15521    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15522        use std::str::FromStr;
15523        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15524        Self::from_str(&s).map_err(|_| {
15525            serde::de::Error::custom(
15526                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
15527            )
15528        })
15529    }
15530}
15531/// Configuration for any card payments attempted on this PaymentIntent.
15532#[derive(Clone, Debug, serde::Serialize)]
15533pub struct UpdatePaymentIntentPaymentMethodOptionsCard {
15534    /// Controls when the funds are captured from the customer's account.
15535    ///
15536    /// 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.
15537    ///
15538    /// 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.
15539    #[serde(skip_serializing_if = "Option::is_none")]
15540    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
15541    /// A single-use `cvc_update` Token that represents a card CVC value.
15542    /// When provided, the CVC value will be verified during the card payment attempt.
15543    /// This parameter can only be provided during confirmation.
15544    #[serde(skip_serializing_if = "Option::is_none")]
15545    pub cvc_token: Option<String>,
15546    /// Installment configuration for payments attempted on this PaymentIntent.
15547    ///
15548    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
15549    #[serde(skip_serializing_if = "Option::is_none")]
15550    pub installments: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallments>,
15551    /// Configuration options for setting up an eMandate for cards issued in India.
15552    #[serde(skip_serializing_if = "Option::is_none")]
15553    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
15554    /// When specified, this parameter indicates that a transaction will be marked
15555    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
15556    /// parameter can only be provided during confirmation.
15557    #[serde(skip_serializing_if = "Option::is_none")]
15558    pub moto: Option<bool>,
15559    /// Selected network to process this PaymentIntent on.
15560    /// Depends on the available networks of the card attached to the PaymentIntent.
15561    /// Can be only set confirm-time.
15562    #[serde(skip_serializing_if = "Option::is_none")]
15563    pub network: Option<UpdatePaymentIntentPaymentMethodOptionsCardNetwork>,
15564    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
15565    #[serde(skip_serializing_if = "Option::is_none")]
15566    pub request_extended_authorization:
15567        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
15568    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
15569    #[serde(skip_serializing_if = "Option::is_none")]
15570    pub request_incremental_authorization:
15571        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
15572    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
15573    #[serde(skip_serializing_if = "Option::is_none")]
15574    pub request_multicapture:
15575        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
15576    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
15577    #[serde(skip_serializing_if = "Option::is_none")]
15578    pub request_overcapture: Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
15579    /// 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).
15580    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
15581    /// If not provided, this value defaults to `automatic`.
15582    /// 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.
15583    #[serde(skip_serializing_if = "Option::is_none")]
15584    pub request_three_d_secure:
15585        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
15586    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
15587    /// using the cvc_token parameter).
15588    #[serde(skip_serializing_if = "Option::is_none")]
15589    pub require_cvc_recollection: Option<bool>,
15590    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15591    ///
15592    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15593    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15594    ///
15595    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15596    ///
15597    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15598    ///
15599    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15600    #[serde(skip_serializing_if = "Option::is_none")]
15601    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
15602    /// Provides information about a card payment that customers see on their statements.
15603    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
15604    /// Maximum 22 characters.
15605    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
15606    #[serde(skip_serializing_if = "Option::is_none")]
15607    pub statement_descriptor_suffix_kana: Option<String>,
15608    /// Provides information about a card payment that customers see on their statements.
15609    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
15610    /// Maximum 17 characters.
15611    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
15612    #[serde(skip_serializing_if = "Option::is_none")]
15613    pub statement_descriptor_suffix_kanji: Option<String>,
15614    /// If 3D Secure authentication was performed with a third-party provider,
15615    /// the authentication details to use for this payment.
15616    #[serde(skip_serializing_if = "Option::is_none")]
15617    pub three_d_secure: Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
15618}
15619impl UpdatePaymentIntentPaymentMethodOptionsCard {
15620    pub fn new() -> Self {
15621        Self {
15622            capture_method: None,
15623            cvc_token: None,
15624            installments: None,
15625            mandate_options: None,
15626            moto: None,
15627            network: None,
15628            request_extended_authorization: None,
15629            request_incremental_authorization: None,
15630            request_multicapture: None,
15631            request_overcapture: None,
15632            request_three_d_secure: None,
15633            require_cvc_recollection: None,
15634            setup_future_usage: None,
15635            statement_descriptor_suffix_kana: None,
15636            statement_descriptor_suffix_kanji: None,
15637            three_d_secure: None,
15638        }
15639    }
15640}
15641impl Default for UpdatePaymentIntentPaymentMethodOptionsCard {
15642    fn default() -> Self {
15643        Self::new()
15644    }
15645}
15646/// Controls when the funds are captured from the customer's account.
15647///
15648/// 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.
15649///
15650/// 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.
15651#[derive(Copy, Clone, Eq, PartialEq)]
15652pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15653    Manual,
15654}
15655impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15656    pub fn as_str(self) -> &'static str {
15657        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
15658        match self {
15659            Manual => "manual",
15660        }
15661    }
15662}
15663
15664impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15665    type Err = stripe_types::StripeParseError;
15666    fn from_str(s: &str) -> Result<Self, Self::Err> {
15667        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
15668        match s {
15669            "manual" => Ok(Manual),
15670            _ => Err(stripe_types::StripeParseError),
15671        }
15672    }
15673}
15674impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15675    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15676        f.write_str(self.as_str())
15677    }
15678}
15679
15680impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15681    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15682        f.write_str(self.as_str())
15683    }
15684}
15685impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15686    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15687    where
15688        S: serde::Serializer,
15689    {
15690        serializer.serialize_str(self.as_str())
15691    }
15692}
15693#[cfg(feature = "deserialize")]
15694impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
15695    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15696        use std::str::FromStr;
15697        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15698        Self::from_str(&s).map_err(|_| {
15699            serde::de::Error::custom(
15700                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod",
15701            )
15702        })
15703    }
15704}
15705/// Installment configuration for payments attempted on this PaymentIntent.
15706///
15707/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
15708#[derive(Copy, Clone, Debug, serde::Serialize)]
15709pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15710    /// Setting to true enables installments for this PaymentIntent.
15711    /// This will cause the response to contain a list of available installment plans.
15712    /// Setting to false will prevent any selected plan from applying to a charge.
15713    #[serde(skip_serializing_if = "Option::is_none")]
15714    pub enabled: Option<bool>,
15715    /// The selected installment plan to use for this payment attempt.
15716    /// This parameter can only be provided during confirmation.
15717    #[serde(skip_serializing_if = "Option::is_none")]
15718    pub plan: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
15719}
15720impl UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15721    pub fn new() -> Self {
15722        Self { enabled: None, plan: None }
15723    }
15724}
15725impl Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
15726    fn default() -> Self {
15727        Self::new()
15728    }
15729}
15730/// The selected installment plan to use for this payment attempt.
15731/// This parameter can only be provided during confirmation.
15732#[derive(Copy, Clone, Debug, serde::Serialize)]
15733pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
15734    /// For `fixed_count` installment plans, this is required.
15735    /// It represents the number of installment payments your customer will make to their credit card.
15736    #[serde(skip_serializing_if = "Option::is_none")]
15737    pub count: Option<u64>,
15738    /// For `fixed_count` installment plans, this is required.
15739    /// It represents the interval between installment payments your customer will make to their credit card.
15740    /// One of `month`.
15741    #[serde(skip_serializing_if = "Option::is_none")]
15742    pub interval: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
15743    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
15744    #[serde(rename = "type")]
15745    pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
15746}
15747impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
15748    pub fn new(
15749        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
15750    ) -> Self {
15751        Self { count: None, interval: None, type_: type_.into() }
15752    }
15753}
15754/// For `fixed_count` installment plans, this is required.
15755/// It represents the interval between installment payments your customer will make to their credit card.
15756/// One of `month`.
15757#[derive(Copy, Clone, Eq, PartialEq)]
15758pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15759    Month,
15760}
15761impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15762    pub fn as_str(self) -> &'static str {
15763        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
15764        match self {
15765            Month => "month",
15766        }
15767    }
15768}
15769
15770impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15771    type Err = stripe_types::StripeParseError;
15772    fn from_str(s: &str) -> Result<Self, Self::Err> {
15773        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
15774        match s {
15775            "month" => Ok(Month),
15776            _ => Err(stripe_types::StripeParseError),
15777        }
15778    }
15779}
15780impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15781    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15782        f.write_str(self.as_str())
15783    }
15784}
15785
15786impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15787    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15788        f.write_str(self.as_str())
15789    }
15790}
15791impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
15792    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15793    where
15794        S: serde::Serializer,
15795    {
15796        serializer.serialize_str(self.as_str())
15797    }
15798}
15799#[cfg(feature = "deserialize")]
15800impl<'de> serde::Deserialize<'de>
15801    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
15802{
15803    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15804        use std::str::FromStr;
15805        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15806        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
15807    }
15808}
15809/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
15810#[derive(Copy, Clone, Eq, PartialEq)]
15811pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15812    Bonus,
15813    FixedCount,
15814    Revolving,
15815}
15816impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15817    pub fn as_str(self) -> &'static str {
15818        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
15819        match self {
15820            Bonus => "bonus",
15821            FixedCount => "fixed_count",
15822            Revolving => "revolving",
15823        }
15824    }
15825}
15826
15827impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15828    type Err = stripe_types::StripeParseError;
15829    fn from_str(s: &str) -> Result<Self, Self::Err> {
15830        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
15831        match s {
15832            "bonus" => Ok(Bonus),
15833            "fixed_count" => Ok(FixedCount),
15834            "revolving" => Ok(Revolving),
15835            _ => Err(stripe_types::StripeParseError),
15836        }
15837    }
15838}
15839impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15840    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15841        f.write_str(self.as_str())
15842    }
15843}
15844
15845impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15846    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15847        f.write_str(self.as_str())
15848    }
15849}
15850impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
15851    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15852    where
15853        S: serde::Serializer,
15854    {
15855        serializer.serialize_str(self.as_str())
15856    }
15857}
15858#[cfg(feature = "deserialize")]
15859impl<'de> serde::Deserialize<'de>
15860    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
15861{
15862    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15863        use std::str::FromStr;
15864        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15865        Self::from_str(&s).map_err(|_| {
15866            serde::de::Error::custom(
15867                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType",
15868            )
15869        })
15870    }
15871}
15872/// Configuration options for setting up an eMandate for cards issued in India.
15873#[derive(Clone, Debug, serde::Serialize)]
15874pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
15875    /// Amount to be charged for future payments.
15876    pub amount: i64,
15877    /// One of `fixed` or `maximum`.
15878    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
15879    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
15880    pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
15881    /// A description of the mandate or subscription that is meant to be displayed to the customer.
15882    #[serde(skip_serializing_if = "Option::is_none")]
15883    pub description: Option<String>,
15884    /// End date of the mandate or subscription.
15885    /// If not provided, the mandate will be active until canceled.
15886    /// If provided, end date should be after start date.
15887    #[serde(skip_serializing_if = "Option::is_none")]
15888    pub end_date: Option<stripe_types::Timestamp>,
15889    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
15890    pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
15891    /// The number of intervals between payments.
15892    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
15893    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
15894    /// This parameter is optional when `interval=sporadic`.
15895    #[serde(skip_serializing_if = "Option::is_none")]
15896    pub interval_count: Option<u64>,
15897    /// Unique identifier for the mandate or subscription.
15898    pub reference: String,
15899    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
15900    pub start_date: stripe_types::Timestamp,
15901    /// Specifies the type of mandates supported. Possible values are `india`.
15902    #[serde(skip_serializing_if = "Option::is_none")]
15903    pub supported_types:
15904        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
15905}
15906impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
15907    pub fn new(
15908        amount: impl Into<i64>,
15909        amount_type: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
15910        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
15911        reference: impl Into<String>,
15912        start_date: impl Into<stripe_types::Timestamp>,
15913    ) -> Self {
15914        Self {
15915            amount: amount.into(),
15916            amount_type: amount_type.into(),
15917            description: None,
15918            end_date: None,
15919            interval: interval.into(),
15920            interval_count: None,
15921            reference: reference.into(),
15922            start_date: start_date.into(),
15923            supported_types: None,
15924        }
15925    }
15926}
15927/// One of `fixed` or `maximum`.
15928/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
15929/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
15930#[derive(Copy, Clone, Eq, PartialEq)]
15931pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15932    Fixed,
15933    Maximum,
15934}
15935impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15936    pub fn as_str(self) -> &'static str {
15937        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
15938        match self {
15939            Fixed => "fixed",
15940            Maximum => "maximum",
15941        }
15942    }
15943}
15944
15945impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15946    type Err = stripe_types::StripeParseError;
15947    fn from_str(s: &str) -> Result<Self, Self::Err> {
15948        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
15949        match s {
15950            "fixed" => Ok(Fixed),
15951            "maximum" => Ok(Maximum),
15952            _ => Err(stripe_types::StripeParseError),
15953        }
15954    }
15955}
15956impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15958        f.write_str(self.as_str())
15959    }
15960}
15961
15962impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15964        f.write_str(self.as_str())
15965    }
15966}
15967impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
15968    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15969    where
15970        S: serde::Serializer,
15971    {
15972        serializer.serialize_str(self.as_str())
15973    }
15974}
15975#[cfg(feature = "deserialize")]
15976impl<'de> serde::Deserialize<'de>
15977    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
15978{
15979    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15980        use std::str::FromStr;
15981        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15982        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
15983    }
15984}
15985/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
15986#[derive(Copy, Clone, Eq, PartialEq)]
15987pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15988    Day,
15989    Month,
15990    Sporadic,
15991    Week,
15992    Year,
15993}
15994impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
15995    pub fn as_str(self) -> &'static str {
15996        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
15997        match self {
15998            Day => "day",
15999            Month => "month",
16000            Sporadic => "sporadic",
16001            Week => "week",
16002            Year => "year",
16003        }
16004    }
16005}
16006
16007impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16008    type Err = stripe_types::StripeParseError;
16009    fn from_str(s: &str) -> Result<Self, Self::Err> {
16010        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
16011        match s {
16012            "day" => Ok(Day),
16013            "month" => Ok(Month),
16014            "sporadic" => Ok(Sporadic),
16015            "week" => Ok(Week),
16016            "year" => Ok(Year),
16017            _ => Err(stripe_types::StripeParseError),
16018        }
16019    }
16020}
16021impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16023        f.write_str(self.as_str())
16024    }
16025}
16026
16027impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16028    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16029        f.write_str(self.as_str())
16030    }
16031}
16032impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
16033    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16034    where
16035        S: serde::Serializer,
16036    {
16037        serializer.serialize_str(self.as_str())
16038    }
16039}
16040#[cfg(feature = "deserialize")]
16041impl<'de> serde::Deserialize<'de>
16042    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
16043{
16044    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16045        use std::str::FromStr;
16046        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16047        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
16048    }
16049}
16050/// Specifies the type of mandates supported. Possible values are `india`.
16051#[derive(Copy, Clone, Eq, PartialEq)]
16052pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16053    India,
16054}
16055impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16056    pub fn as_str(self) -> &'static str {
16057        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
16058        match self {
16059            India => "india",
16060        }
16061    }
16062}
16063
16064impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16065    type Err = stripe_types::StripeParseError;
16066    fn from_str(s: &str) -> Result<Self, Self::Err> {
16067        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
16068        match s {
16069            "india" => Ok(India),
16070            _ => Err(stripe_types::StripeParseError),
16071        }
16072    }
16073}
16074impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16076        f.write_str(self.as_str())
16077    }
16078}
16079
16080impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16081    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16082        f.write_str(self.as_str())
16083    }
16084}
16085impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
16086    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16087    where
16088        S: serde::Serializer,
16089    {
16090        serializer.serialize_str(self.as_str())
16091    }
16092}
16093#[cfg(feature = "deserialize")]
16094impl<'de> serde::Deserialize<'de>
16095    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
16096{
16097    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16098        use std::str::FromStr;
16099        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16100        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
16101    }
16102}
16103/// Selected network to process this PaymentIntent on.
16104/// Depends on the available networks of the card attached to the PaymentIntent.
16105/// Can be only set confirm-time.
16106#[derive(Copy, Clone, Eq, PartialEq)]
16107pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16108    Amex,
16109    CartesBancaires,
16110    Diners,
16111    Discover,
16112    EftposAu,
16113    Girocard,
16114    Interac,
16115    Jcb,
16116    Link,
16117    Mastercard,
16118    Unionpay,
16119    Unknown,
16120    Visa,
16121}
16122impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16123    pub fn as_str(self) -> &'static str {
16124        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
16125        match self {
16126            Amex => "amex",
16127            CartesBancaires => "cartes_bancaires",
16128            Diners => "diners",
16129            Discover => "discover",
16130            EftposAu => "eftpos_au",
16131            Girocard => "girocard",
16132            Interac => "interac",
16133            Jcb => "jcb",
16134            Link => "link",
16135            Mastercard => "mastercard",
16136            Unionpay => "unionpay",
16137            Unknown => "unknown",
16138            Visa => "visa",
16139        }
16140    }
16141}
16142
16143impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16144    type Err = stripe_types::StripeParseError;
16145    fn from_str(s: &str) -> Result<Self, Self::Err> {
16146        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
16147        match s {
16148            "amex" => Ok(Amex),
16149            "cartes_bancaires" => Ok(CartesBancaires),
16150            "diners" => Ok(Diners),
16151            "discover" => Ok(Discover),
16152            "eftpos_au" => Ok(EftposAu),
16153            "girocard" => Ok(Girocard),
16154            "interac" => Ok(Interac),
16155            "jcb" => Ok(Jcb),
16156            "link" => Ok(Link),
16157            "mastercard" => Ok(Mastercard),
16158            "unionpay" => Ok(Unionpay),
16159            "unknown" => Ok(Unknown),
16160            "visa" => Ok(Visa),
16161            _ => Err(stripe_types::StripeParseError),
16162        }
16163    }
16164}
16165impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16166    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16167        f.write_str(self.as_str())
16168    }
16169}
16170
16171impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16172    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16173        f.write_str(self.as_str())
16174    }
16175}
16176impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
16177    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16178    where
16179        S: serde::Serializer,
16180    {
16181        serializer.serialize_str(self.as_str())
16182    }
16183}
16184#[cfg(feature = "deserialize")]
16185impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
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(|_| {
16190            serde::de::Error::custom(
16191                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardNetwork",
16192            )
16193        })
16194    }
16195}
16196/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
16197#[derive(Copy, Clone, Eq, PartialEq)]
16198pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16199    IfAvailable,
16200    Never,
16201}
16202impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16203    pub fn as_str(self) -> &'static str {
16204        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
16205        match self {
16206            IfAvailable => "if_available",
16207            Never => "never",
16208        }
16209    }
16210}
16211
16212impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16213    type Err = stripe_types::StripeParseError;
16214    fn from_str(s: &str) -> Result<Self, Self::Err> {
16215        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
16216        match s {
16217            "if_available" => Ok(IfAvailable),
16218            "never" => Ok(Never),
16219            _ => Err(stripe_types::StripeParseError),
16220        }
16221    }
16222}
16223impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16225        f.write_str(self.as_str())
16226    }
16227}
16228
16229impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16231        f.write_str(self.as_str())
16232    }
16233}
16234impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
16235    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16236    where
16237        S: serde::Serializer,
16238    {
16239        serializer.serialize_str(self.as_str())
16240    }
16241}
16242#[cfg(feature = "deserialize")]
16243impl<'de> serde::Deserialize<'de>
16244    for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
16245{
16246    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16247        use std::str::FromStr;
16248        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16249        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
16250    }
16251}
16252/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
16253#[derive(Copy, Clone, Eq, PartialEq)]
16254pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
16255    IfAvailable,
16256    Never,
16257}
16258impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
16259    pub fn as_str(self) -> &'static str {
16260        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
16261        match self {
16262            IfAvailable => "if_available",
16263            Never => "never",
16264        }
16265    }
16266}
16267
16268impl std::str::FromStr
16269    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16270{
16271    type Err = stripe_types::StripeParseError;
16272    fn from_str(s: &str) -> Result<Self, Self::Err> {
16273        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
16274        match s {
16275            "if_available" => Ok(IfAvailable),
16276            "never" => Ok(Never),
16277            _ => Err(stripe_types::StripeParseError),
16278        }
16279    }
16280}
16281impl std::fmt::Display
16282    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16283{
16284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16285        f.write_str(self.as_str())
16286    }
16287}
16288
16289impl std::fmt::Debug
16290    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16291{
16292    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16293        f.write_str(self.as_str())
16294    }
16295}
16296impl serde::Serialize
16297    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16298{
16299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16300    where
16301        S: serde::Serializer,
16302    {
16303        serializer.serialize_str(self.as_str())
16304    }
16305}
16306#[cfg(feature = "deserialize")]
16307impl<'de> serde::Deserialize<'de>
16308    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
16309{
16310    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16311        use std::str::FromStr;
16312        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16313        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
16314    }
16315}
16316/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
16317#[derive(Copy, Clone, Eq, PartialEq)]
16318pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16319    IfAvailable,
16320    Never,
16321}
16322impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16323    pub fn as_str(self) -> &'static str {
16324        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
16325        match self {
16326            IfAvailable => "if_available",
16327            Never => "never",
16328        }
16329    }
16330}
16331
16332impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16333    type Err = stripe_types::StripeParseError;
16334    fn from_str(s: &str) -> Result<Self, Self::Err> {
16335        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
16336        match s {
16337            "if_available" => Ok(IfAvailable),
16338            "never" => Ok(Never),
16339            _ => Err(stripe_types::StripeParseError),
16340        }
16341    }
16342}
16343impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16345        f.write_str(self.as_str())
16346    }
16347}
16348
16349impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16350    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16351        f.write_str(self.as_str())
16352    }
16353}
16354impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
16355    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16356    where
16357        S: serde::Serializer,
16358    {
16359        serializer.serialize_str(self.as_str())
16360    }
16361}
16362#[cfg(feature = "deserialize")]
16363impl<'de> serde::Deserialize<'de>
16364    for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
16365{
16366    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16367        use std::str::FromStr;
16368        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16369        Self::from_str(&s).map_err(|_| {
16370            serde::de::Error::custom(
16371                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture",
16372            )
16373        })
16374    }
16375}
16376/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
16377#[derive(Copy, Clone, Eq, PartialEq)]
16378pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16379    IfAvailable,
16380    Never,
16381}
16382impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16383    pub fn as_str(self) -> &'static str {
16384        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
16385        match self {
16386            IfAvailable => "if_available",
16387            Never => "never",
16388        }
16389    }
16390}
16391
16392impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16393    type Err = stripe_types::StripeParseError;
16394    fn from_str(s: &str) -> Result<Self, Self::Err> {
16395        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
16396        match s {
16397            "if_available" => Ok(IfAvailable),
16398            "never" => Ok(Never),
16399            _ => Err(stripe_types::StripeParseError),
16400        }
16401    }
16402}
16403impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16404    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16405        f.write_str(self.as_str())
16406    }
16407}
16408
16409impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16410    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16411        f.write_str(self.as_str())
16412    }
16413}
16414impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
16415    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16416    where
16417        S: serde::Serializer,
16418    {
16419        serializer.serialize_str(self.as_str())
16420    }
16421}
16422#[cfg(feature = "deserialize")]
16423impl<'de> serde::Deserialize<'de>
16424    for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
16425{
16426    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16427        use std::str::FromStr;
16428        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16429        Self::from_str(&s).map_err(|_| {
16430            serde::de::Error::custom(
16431                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture",
16432            )
16433        })
16434    }
16435}
16436/// 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).
16437/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
16438/// If not provided, this value defaults to `automatic`.
16439/// 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.
16440#[derive(Copy, Clone, Eq, PartialEq)]
16441pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16442    Any,
16443    Automatic,
16444    Challenge,
16445}
16446impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16447    pub fn as_str(self) -> &'static str {
16448        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
16449        match self {
16450            Any => "any",
16451            Automatic => "automatic",
16452            Challenge => "challenge",
16453        }
16454    }
16455}
16456
16457impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16458    type Err = stripe_types::StripeParseError;
16459    fn from_str(s: &str) -> Result<Self, Self::Err> {
16460        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
16461        match s {
16462            "any" => Ok(Any),
16463            "automatic" => Ok(Automatic),
16464            "challenge" => Ok(Challenge),
16465            _ => Err(stripe_types::StripeParseError),
16466        }
16467    }
16468}
16469impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16471        f.write_str(self.as_str())
16472    }
16473}
16474
16475impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16476    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16477        f.write_str(self.as_str())
16478    }
16479}
16480impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
16481    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16482    where
16483        S: serde::Serializer,
16484    {
16485        serializer.serialize_str(self.as_str())
16486    }
16487}
16488#[cfg(feature = "deserialize")]
16489impl<'de> serde::Deserialize<'de>
16490    for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
16491{
16492    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16493        use std::str::FromStr;
16494        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16495        Self::from_str(&s).map_err(|_| {
16496            serde::de::Error::custom(
16497                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
16498            )
16499        })
16500    }
16501}
16502/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16503///
16504/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16505/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16506///
16507/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16508///
16509/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16510///
16511/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16512#[derive(Copy, Clone, Eq, PartialEq)]
16513pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16514    None,
16515    OffSession,
16516    OnSession,
16517}
16518impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16519    pub fn as_str(self) -> &'static str {
16520        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
16521        match self {
16522            None => "none",
16523            OffSession => "off_session",
16524            OnSession => "on_session",
16525        }
16526    }
16527}
16528
16529impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16530    type Err = stripe_types::StripeParseError;
16531    fn from_str(s: &str) -> Result<Self, Self::Err> {
16532        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
16533        match s {
16534            "none" => Ok(None),
16535            "off_session" => Ok(OffSession),
16536            "on_session" => Ok(OnSession),
16537            _ => Err(stripe_types::StripeParseError),
16538        }
16539    }
16540}
16541impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16542    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16543        f.write_str(self.as_str())
16544    }
16545}
16546
16547impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16548    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16549        f.write_str(self.as_str())
16550    }
16551}
16552impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16553    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16554    where
16555        S: serde::Serializer,
16556    {
16557        serializer.serialize_str(self.as_str())
16558    }
16559}
16560#[cfg(feature = "deserialize")]
16561impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
16562    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16563        use std::str::FromStr;
16564        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16565        Self::from_str(&s).map_err(|_| {
16566            serde::de::Error::custom(
16567                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
16568            )
16569        })
16570    }
16571}
16572/// If 3D Secure authentication was performed with a third-party provider,
16573/// the authentication details to use for this payment.
16574#[derive(Clone, Debug, serde::Serialize)]
16575pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
16576    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
16577    #[serde(skip_serializing_if = "Option::is_none")]
16578    pub ares_trans_status:
16579        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
16580    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
16581    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
16582    /// (Most 3D Secure providers will return the base64-encoded version, which
16583    /// is what you should specify here.)
16584    pub cryptogram: String,
16585    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
16586    /// provider and indicates what degree of authentication was performed.
16587    #[serde(skip_serializing_if = "Option::is_none")]
16588    pub electronic_commerce_indicator:
16589        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
16590    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
16591    #[serde(skip_serializing_if = "Option::is_none")]
16592    pub exemption_indicator:
16593        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
16594    /// Network specific 3DS fields. Network specific arguments require an
16595    /// explicit card brand choice. The parameter `payment_method_options.card.network``
16596    /// must be populated accordingly
16597    #[serde(skip_serializing_if = "Option::is_none")]
16598    pub network_options:
16599        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
16600    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
16601    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
16602    #[serde(skip_serializing_if = "Option::is_none")]
16603    pub requestor_challenge_indicator: Option<String>,
16604    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
16605    /// Transaction ID (dsTransID).
16606    pub transaction_id: String,
16607    /// The version of 3D Secure that was performed.
16608    pub version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
16609}
16610impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
16611    pub fn new(
16612        cryptogram: impl Into<String>,
16613        transaction_id: impl Into<String>,
16614        version: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
16615    ) -> Self {
16616        Self {
16617            ares_trans_status: None,
16618            cryptogram: cryptogram.into(),
16619            electronic_commerce_indicator: None,
16620            exemption_indicator: None,
16621            network_options: None,
16622            requestor_challenge_indicator: None,
16623            transaction_id: transaction_id.into(),
16624            version: version.into(),
16625        }
16626    }
16627}
16628/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
16629#[derive(Copy, Clone, Eq, PartialEq)]
16630pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16631    A,
16632    C,
16633    I,
16634    N,
16635    R,
16636    U,
16637    Y,
16638}
16639impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16640    pub fn as_str(self) -> &'static str {
16641        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16642        match self {
16643            A => "A",
16644            C => "C",
16645            I => "I",
16646            N => "N",
16647            R => "R",
16648            U => "U",
16649            Y => "Y",
16650        }
16651    }
16652}
16653
16654impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16655    type Err = stripe_types::StripeParseError;
16656    fn from_str(s: &str) -> Result<Self, Self::Err> {
16657        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
16658        match s {
16659            "A" => Ok(A),
16660            "C" => Ok(C),
16661            "I" => Ok(I),
16662            "N" => Ok(N),
16663            "R" => Ok(R),
16664            "U" => Ok(U),
16665            "Y" => Ok(Y),
16666            _ => Err(stripe_types::StripeParseError),
16667        }
16668    }
16669}
16670impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16672        f.write_str(self.as_str())
16673    }
16674}
16675
16676impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16677    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16678        f.write_str(self.as_str())
16679    }
16680}
16681impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
16682    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16683    where
16684        S: serde::Serializer,
16685    {
16686        serializer.serialize_str(self.as_str())
16687    }
16688}
16689#[cfg(feature = "deserialize")]
16690impl<'de> serde::Deserialize<'de>
16691    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
16692{
16693    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16694        use std::str::FromStr;
16695        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16696        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
16697    }
16698}
16699/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
16700/// provider and indicates what degree of authentication was performed.
16701#[derive(Copy, Clone, Eq, PartialEq)]
16702pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16703    V01,
16704    V02,
16705    V05,
16706    V06,
16707    V07,
16708}
16709impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
16710    pub fn as_str(self) -> &'static str {
16711        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16712        match self {
16713            V01 => "01",
16714            V02 => "02",
16715            V05 => "05",
16716            V06 => "06",
16717            V07 => "07",
16718        }
16719    }
16720}
16721
16722impl std::str::FromStr
16723    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16724{
16725    type Err = stripe_types::StripeParseError;
16726    fn from_str(s: &str) -> Result<Self, Self::Err> {
16727        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
16728        match s {
16729            "01" => Ok(V01),
16730            "02" => Ok(V02),
16731            "05" => Ok(V05),
16732            "06" => Ok(V06),
16733            "07" => Ok(V07),
16734            _ => Err(stripe_types::StripeParseError),
16735        }
16736    }
16737}
16738impl std::fmt::Display
16739    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16740{
16741    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16742        f.write_str(self.as_str())
16743    }
16744}
16745
16746impl std::fmt::Debug
16747    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16748{
16749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16750        f.write_str(self.as_str())
16751    }
16752}
16753impl serde::Serialize
16754    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16755{
16756    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16757    where
16758        S: serde::Serializer,
16759    {
16760        serializer.serialize_str(self.as_str())
16761    }
16762}
16763#[cfg(feature = "deserialize")]
16764impl<'de> serde::Deserialize<'de>
16765    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
16766{
16767    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16768        use std::str::FromStr;
16769        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16770        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
16771    }
16772}
16773/// The exemption requested via 3DS and accepted by the issuer at authentication time.
16774#[derive(Copy, Clone, Eq, PartialEq)]
16775pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16776    LowRisk,
16777    None,
16778}
16779impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16780    pub fn as_str(self) -> &'static str {
16781        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
16782        match self {
16783            LowRisk => "low_risk",
16784            None => "none",
16785        }
16786    }
16787}
16788
16789impl std::str::FromStr
16790    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16791{
16792    type Err = stripe_types::StripeParseError;
16793    fn from_str(s: &str) -> Result<Self, Self::Err> {
16794        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
16795        match s {
16796            "low_risk" => Ok(LowRisk),
16797            "none" => Ok(None),
16798            _ => Err(stripe_types::StripeParseError),
16799        }
16800    }
16801}
16802impl std::fmt::Display
16803    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16804{
16805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16806        f.write_str(self.as_str())
16807    }
16808}
16809
16810impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
16811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16812        f.write_str(self.as_str())
16813    }
16814}
16815impl serde::Serialize
16816    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16817{
16818    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16819    where
16820        S: serde::Serializer,
16821    {
16822        serializer.serialize_str(self.as_str())
16823    }
16824}
16825#[cfg(feature = "deserialize")]
16826impl<'de> serde::Deserialize<'de>
16827    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
16828{
16829    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16830        use std::str::FromStr;
16831        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16832        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
16833    }
16834}
16835/// Network specific 3DS fields. Network specific arguments require an
16836/// explicit card brand choice. The parameter `payment_method_options.card.network``
16837/// must be populated accordingly
16838#[derive(Clone, Debug, serde::Serialize)]
16839pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16840    /// Cartes Bancaires-specific 3DS fields.
16841    #[serde(skip_serializing_if = "Option::is_none")]
16842    pub cartes_bancaires: Option<
16843        UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
16844    >,
16845}
16846impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16847    pub fn new() -> Self {
16848        Self { cartes_bancaires: None }
16849    }
16850}
16851impl Default for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
16852    fn default() -> Self {
16853        Self::new()
16854    }
16855}
16856/// Cartes Bancaires-specific 3DS fields.
16857#[derive(Clone, Debug, serde::Serialize)]
16858pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16859    /// The cryptogram calculation algorithm used by the card Issuer's ACS
16860    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
16861    /// messageExtension: CB-AVALGO
16862pub cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
16863    /// The exemption indicator returned from Cartes Bancaires in the ARes.
16864    /// message extension: CB-EXEMPTION; string (4 characters)
16865    /// This is a 3 byte bitmap (low significant byte first and most significant
16866    /// bit first) that has been Base64 encoded
16867#[serde(skip_serializing_if = "Option::is_none")]
16868pub cb_exemption: Option<String>,
16869    /// The risk score returned from Cartes Bancaires in the ARes.
16870    /// message extension: CB-SCORE; numeric value 0-99
16871#[serde(skip_serializing_if = "Option::is_none")]
16872pub cb_score: Option<i64>,
16873
16874}
16875impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
16876    pub fn new(
16877        cb_avalgo: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
16878    ) -> Self {
16879        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
16880    }
16881}
16882/// The cryptogram calculation algorithm used by the card Issuer's ACS
16883/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
16884/// messageExtension: CB-AVALGO
16885#[derive(Copy, Clone, Eq, PartialEq)]
16886pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16887{
16888    V0,
16889    V1,
16890    V2,
16891    V3,
16892    V4,
16893    A,
16894}
16895impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
16896    pub fn as_str(self) -> &'static str {
16897        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16898        match self {
16899            V0 => "0",
16900            V1 => "1",
16901            V2 => "2",
16902            V3 => "3",
16903            V4 => "4",
16904            A => "A",
16905        }
16906    }
16907}
16908
16909impl std::str::FromStr
16910    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16911{
16912    type Err = stripe_types::StripeParseError;
16913    fn from_str(s: &str) -> Result<Self, Self::Err> {
16914        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
16915        match s {
16916            "0" => Ok(V0),
16917            "1" => Ok(V1),
16918            "2" => Ok(V2),
16919            "3" => Ok(V3),
16920            "4" => Ok(V4),
16921            "A" => Ok(A),
16922            _ => Err(stripe_types::StripeParseError),
16923        }
16924    }
16925}
16926impl std::fmt::Display
16927    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16928{
16929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16930        f.write_str(self.as_str())
16931    }
16932}
16933
16934impl std::fmt::Debug
16935    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16936{
16937    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16938        f.write_str(self.as_str())
16939    }
16940}
16941impl serde::Serialize
16942    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16943{
16944    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16945    where
16946        S: serde::Serializer,
16947    {
16948        serializer.serialize_str(self.as_str())
16949    }
16950}
16951#[cfg(feature = "deserialize")]
16952impl<'de> serde::Deserialize<'de>
16953    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
16954{
16955    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16956        use std::str::FromStr;
16957        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16958        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
16959    }
16960}
16961/// The version of 3D Secure that was performed.
16962#[derive(Copy, Clone, Eq, PartialEq)]
16963pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16964    V1_0_2,
16965    V2_1_0,
16966    V2_2_0,
16967}
16968impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16969    pub fn as_str(self) -> &'static str {
16970        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
16971        match self {
16972            V1_0_2 => "1.0.2",
16973            V2_1_0 => "2.1.0",
16974            V2_2_0 => "2.2.0",
16975        }
16976    }
16977}
16978
16979impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16980    type Err = stripe_types::StripeParseError;
16981    fn from_str(s: &str) -> Result<Self, Self::Err> {
16982        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
16983        match s {
16984            "1.0.2" => Ok(V1_0_2),
16985            "2.1.0" => Ok(V2_1_0),
16986            "2.2.0" => Ok(V2_2_0),
16987            _ => Err(stripe_types::StripeParseError),
16988        }
16989    }
16990}
16991impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16992    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16993        f.write_str(self.as_str())
16994    }
16995}
16996
16997impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
16998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16999        f.write_str(self.as_str())
17000    }
17001}
17002impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
17003    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17004    where
17005        S: serde::Serializer,
17006    {
17007        serializer.serialize_str(self.as_str())
17008    }
17009}
17010#[cfg(feature = "deserialize")]
17011impl<'de> serde::Deserialize<'de>
17012    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
17013{
17014    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17015        use std::str::FromStr;
17016        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17017        Self::from_str(&s).map_err(|_| {
17018            serde::de::Error::custom(
17019                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
17020            )
17021        })
17022    }
17023}
17024/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
17025#[derive(Copy, Clone, Debug, serde::Serialize)]
17026pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent {
17027    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
17028    #[serde(skip_serializing_if = "Option::is_none")]
17029    pub request_extended_authorization: Option<bool>,
17030    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
17031    /// 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.
17032    #[serde(skip_serializing_if = "Option::is_none")]
17033    pub request_incremental_authorization_support: Option<bool>,
17034    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
17035    #[serde(skip_serializing_if = "Option::is_none")]
17036    pub routing: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
17037}
17038impl UpdatePaymentIntentPaymentMethodOptionsCardPresent {
17039    pub fn new() -> Self {
17040        Self {
17041            request_extended_authorization: None,
17042            request_incremental_authorization_support: None,
17043            routing: None,
17044        }
17045    }
17046}
17047impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresent {
17048    fn default() -> Self {
17049        Self::new()
17050    }
17051}
17052/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
17053#[derive(Copy, Clone, Debug, serde::Serialize)]
17054pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
17055    /// Routing requested priority
17056    #[serde(skip_serializing_if = "Option::is_none")]
17057    pub requested_priority:
17058        Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
17059}
17060impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
17061    pub fn new() -> Self {
17062        Self { requested_priority: None }
17063    }
17064}
17065impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
17066    fn default() -> Self {
17067        Self::new()
17068    }
17069}
17070/// Routing requested priority
17071#[derive(Copy, Clone, Eq, PartialEq)]
17072pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
17073    Domestic,
17074    International,
17075}
17076impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
17077    pub fn as_str(self) -> &'static str {
17078        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
17079        match self {
17080            Domestic => "domestic",
17081            International => "international",
17082        }
17083    }
17084}
17085
17086impl std::str::FromStr
17087    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17088{
17089    type Err = stripe_types::StripeParseError;
17090    fn from_str(s: &str) -> Result<Self, Self::Err> {
17091        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
17092        match s {
17093            "domestic" => Ok(Domestic),
17094            "international" => Ok(International),
17095            _ => Err(stripe_types::StripeParseError),
17096        }
17097    }
17098}
17099impl std::fmt::Display
17100    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17101{
17102    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17103        f.write_str(self.as_str())
17104    }
17105}
17106
17107impl std::fmt::Debug
17108    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17109{
17110    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17111        f.write_str(self.as_str())
17112    }
17113}
17114impl serde::Serialize
17115    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17116{
17117    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17118    where
17119        S: serde::Serializer,
17120    {
17121        serializer.serialize_str(self.as_str())
17122    }
17123}
17124#[cfg(feature = "deserialize")]
17125impl<'de> serde::Deserialize<'de>
17126    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
17127{
17128    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17129        use std::str::FromStr;
17130        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17131        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
17132    }
17133}
17134/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
17135#[derive(Copy, Clone, Debug, serde::Serialize)]
17136pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp {
17137    /// Controls when the funds are captured from the customer's account.
17138    ///
17139    /// 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.
17140    ///
17141    /// 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.
17142    #[serde(skip_serializing_if = "Option::is_none")]
17143    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
17144    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17145    ///
17146    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17147    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17148    ///
17149    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17150    ///
17151    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17152    ///
17153    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17154    #[serde(skip_serializing_if = "Option::is_none")]
17155    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
17156}
17157impl UpdatePaymentIntentPaymentMethodOptionsCashapp {
17158    pub fn new() -> Self {
17159        Self { capture_method: None, setup_future_usage: None }
17160    }
17161}
17162impl Default for UpdatePaymentIntentPaymentMethodOptionsCashapp {
17163    fn default() -> Self {
17164        Self::new()
17165    }
17166}
17167/// Controls when the funds are captured from the customer's account.
17168///
17169/// 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.
17170///
17171/// 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.
17172#[derive(Copy, Clone, Eq, PartialEq)]
17173pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17174    Manual,
17175}
17176impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17177    pub fn as_str(self) -> &'static str {
17178        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
17179        match self {
17180            Manual => "manual",
17181        }
17182    }
17183}
17184
17185impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17186    type Err = stripe_types::StripeParseError;
17187    fn from_str(s: &str) -> Result<Self, Self::Err> {
17188        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
17189        match s {
17190            "manual" => Ok(Manual),
17191            _ => Err(stripe_types::StripeParseError),
17192        }
17193    }
17194}
17195impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17197        f.write_str(self.as_str())
17198    }
17199}
17200
17201impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17203        f.write_str(self.as_str())
17204    }
17205}
17206impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17207    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17208    where
17209        S: serde::Serializer,
17210    {
17211        serializer.serialize_str(self.as_str())
17212    }
17213}
17214#[cfg(feature = "deserialize")]
17215impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
17216    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17217        use std::str::FromStr;
17218        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17219        Self::from_str(&s).map_err(|_| {
17220            serde::de::Error::custom(
17221                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod",
17222            )
17223        })
17224    }
17225}
17226/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17227///
17228/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17229/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17230///
17231/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17232///
17233/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17234///
17235/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17236#[derive(Copy, Clone, Eq, PartialEq)]
17237pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17238    None,
17239    OffSession,
17240    OnSession,
17241}
17242impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17243    pub fn as_str(self) -> &'static str {
17244        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
17245        match self {
17246            None => "none",
17247            OffSession => "off_session",
17248            OnSession => "on_session",
17249        }
17250    }
17251}
17252
17253impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17254    type Err = stripe_types::StripeParseError;
17255    fn from_str(s: &str) -> Result<Self, Self::Err> {
17256        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
17257        match s {
17258            "none" => Ok(None),
17259            "off_session" => Ok(OffSession),
17260            "on_session" => Ok(OnSession),
17261            _ => Err(stripe_types::StripeParseError),
17262        }
17263    }
17264}
17265impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17266    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17267        f.write_str(self.as_str())
17268    }
17269}
17270
17271impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17272    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17273        f.write_str(self.as_str())
17274    }
17275}
17276impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
17277    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17278    where
17279        S: serde::Serializer,
17280    {
17281        serializer.serialize_str(self.as_str())
17282    }
17283}
17284#[cfg(feature = "deserialize")]
17285impl<'de> serde::Deserialize<'de>
17286    for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
17287{
17288    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17289        use std::str::FromStr;
17290        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17291        Self::from_str(&s).map_err(|_| {
17292            serde::de::Error::custom(
17293                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
17294            )
17295        })
17296    }
17297}
17298/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
17299#[derive(Copy, Clone, Debug, serde::Serialize)]
17300pub struct UpdatePaymentIntentPaymentMethodOptionsCrypto {
17301    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17302    ///
17303    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17304    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17305    ///
17306    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17307    ///
17308    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17309    ///
17310    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17311    #[serde(skip_serializing_if = "Option::is_none")]
17312    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
17313}
17314impl UpdatePaymentIntentPaymentMethodOptionsCrypto {
17315    pub fn new() -> Self {
17316        Self { setup_future_usage: None }
17317    }
17318}
17319impl Default for UpdatePaymentIntentPaymentMethodOptionsCrypto {
17320    fn default() -> Self {
17321        Self::new()
17322    }
17323}
17324/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17325///
17326/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17327/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17328///
17329/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17330///
17331/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17332///
17333/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17334#[derive(Copy, Clone, Eq, PartialEq)]
17335pub enum UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17336    None,
17337}
17338impl UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17339    pub fn as_str(self) -> &'static str {
17340        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
17341        match self {
17342            None => "none",
17343        }
17344    }
17345}
17346
17347impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17348    type Err = stripe_types::StripeParseError;
17349    fn from_str(s: &str) -> Result<Self, Self::Err> {
17350        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
17351        match s {
17352            "none" => Ok(None),
17353            _ => Err(stripe_types::StripeParseError),
17354        }
17355    }
17356}
17357impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17358    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17359        f.write_str(self.as_str())
17360    }
17361}
17362
17363impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17364    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17365        f.write_str(self.as_str())
17366    }
17367}
17368impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
17369    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17370    where
17371        S: serde::Serializer,
17372    {
17373        serializer.serialize_str(self.as_str())
17374    }
17375}
17376#[cfg(feature = "deserialize")]
17377impl<'de> serde::Deserialize<'de>
17378    for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
17379{
17380    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17381        use std::str::FromStr;
17382        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17383        Self::from_str(&s).map_err(|_| {
17384            serde::de::Error::custom(
17385                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
17386            )
17387        })
17388    }
17389}
17390/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
17391#[derive(Clone, Debug, serde::Serialize)]
17392pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
17393    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
17394    #[serde(skip_serializing_if = "Option::is_none")]
17395    pub bank_transfer: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
17396    /// The funding method type to be used when there are not enough funds in the customer balance.
17397    /// Permitted values include: `bank_transfer`.
17398    #[serde(skip_serializing_if = "Option::is_none")]
17399    pub funding_type: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
17400    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17401    ///
17402    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17403    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17404    ///
17405    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17406    ///
17407    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17408    ///
17409    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17410    #[serde(skip_serializing_if = "Option::is_none")]
17411    pub setup_future_usage:
17412        Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
17413}
17414impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
17415    pub fn new() -> Self {
17416        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
17417    }
17418}
17419impl Default for UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
17420    fn default() -> Self {
17421        Self::new()
17422    }
17423}
17424/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
17425#[derive(Clone, Debug, serde::Serialize)]
17426pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
17427    /// Configuration for the eu_bank_transfer funding type.
17428    #[serde(skip_serializing_if = "Option::is_none")]
17429    pub eu_bank_transfer: Option<EuBankTransferParams>,
17430    /// List of address types that should be returned in the financial_addresses response.
17431    /// If not specified, all valid types will be returned.
17432    ///
17433    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
17434    #[serde(skip_serializing_if = "Option::is_none")]
17435    pub requested_address_types: Option<
17436        Vec<
17437            UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
17438        >,
17439    >,
17440    /// 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`.
17441    #[serde(rename = "type")]
17442    pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
17443}
17444impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
17445    pub fn new(
17446        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
17447    ) -> Self {
17448        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
17449    }
17450}
17451/// List of address types that should be returned in the financial_addresses response.
17452/// If not specified, all valid types will be returned.
17453///
17454/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
17455#[derive(Copy, Clone, Eq, PartialEq)]
17456pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
17457    Aba,
17458    Iban,
17459    Sepa,
17460    SortCode,
17461    Spei,
17462    Swift,
17463    Zengin,
17464}
17465impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
17466    pub fn as_str(self) -> &'static str {
17467        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
17468        match self {
17469            Aba => "aba",
17470            Iban => "iban",
17471            Sepa => "sepa",
17472            SortCode => "sort_code",
17473            Spei => "spei",
17474            Swift => "swift",
17475            Zengin => "zengin",
17476        }
17477    }
17478}
17479
17480impl std::str::FromStr
17481    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17482{
17483    type Err = stripe_types::StripeParseError;
17484    fn from_str(s: &str) -> Result<Self, Self::Err> {
17485        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
17486        match s {
17487            "aba" => Ok(Aba),
17488            "iban" => Ok(Iban),
17489            "sepa" => Ok(Sepa),
17490            "sort_code" => Ok(SortCode),
17491            "spei" => Ok(Spei),
17492            "swift" => Ok(Swift),
17493            "zengin" => Ok(Zengin),
17494            _ => Err(stripe_types::StripeParseError),
17495        }
17496    }
17497}
17498impl std::fmt::Display
17499    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17500{
17501    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17502        f.write_str(self.as_str())
17503    }
17504}
17505
17506impl std::fmt::Debug
17507    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17508{
17509    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17510        f.write_str(self.as_str())
17511    }
17512}
17513impl serde::Serialize
17514    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17515{
17516    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17517    where
17518        S: serde::Serializer,
17519    {
17520        serializer.serialize_str(self.as_str())
17521    }
17522}
17523#[cfg(feature = "deserialize")]
17524impl<'de> serde::Deserialize<'de>
17525    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
17526{
17527    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17528        use std::str::FromStr;
17529        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17530        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
17531    }
17532}
17533/// 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`.
17534#[derive(Copy, Clone, Eq, PartialEq)]
17535pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17536    EuBankTransfer,
17537    GbBankTransfer,
17538    JpBankTransfer,
17539    MxBankTransfer,
17540    UsBankTransfer,
17541}
17542impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17543    pub fn as_str(self) -> &'static str {
17544        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
17545        match self {
17546            EuBankTransfer => "eu_bank_transfer",
17547            GbBankTransfer => "gb_bank_transfer",
17548            JpBankTransfer => "jp_bank_transfer",
17549            MxBankTransfer => "mx_bank_transfer",
17550            UsBankTransfer => "us_bank_transfer",
17551        }
17552    }
17553}
17554
17555impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17556    type Err = stripe_types::StripeParseError;
17557    fn from_str(s: &str) -> Result<Self, Self::Err> {
17558        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
17559        match s {
17560            "eu_bank_transfer" => Ok(EuBankTransfer),
17561            "gb_bank_transfer" => Ok(GbBankTransfer),
17562            "jp_bank_transfer" => Ok(JpBankTransfer),
17563            "mx_bank_transfer" => Ok(MxBankTransfer),
17564            "us_bank_transfer" => Ok(UsBankTransfer),
17565            _ => Err(stripe_types::StripeParseError),
17566        }
17567    }
17568}
17569impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17570    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17571        f.write_str(self.as_str())
17572    }
17573}
17574
17575impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17576    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17577        f.write_str(self.as_str())
17578    }
17579}
17580impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
17581    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17582    where
17583        S: serde::Serializer,
17584    {
17585        serializer.serialize_str(self.as_str())
17586    }
17587}
17588#[cfg(feature = "deserialize")]
17589impl<'de> serde::Deserialize<'de>
17590    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
17591{
17592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17593        use std::str::FromStr;
17594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17595        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
17596    }
17597}
17598/// The funding method type to be used when there are not enough funds in the customer balance.
17599/// Permitted values include: `bank_transfer`.
17600#[derive(Copy, Clone, Eq, PartialEq)]
17601pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17602    BankTransfer,
17603}
17604impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17605    pub fn as_str(self) -> &'static str {
17606        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
17607        match self {
17608            BankTransfer => "bank_transfer",
17609        }
17610    }
17611}
17612
17613impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17614    type Err = stripe_types::StripeParseError;
17615    fn from_str(s: &str) -> Result<Self, Self::Err> {
17616        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
17617        match s {
17618            "bank_transfer" => Ok(BankTransfer),
17619            _ => Err(stripe_types::StripeParseError),
17620        }
17621    }
17622}
17623impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17624    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17625        f.write_str(self.as_str())
17626    }
17627}
17628
17629impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17630    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17631        f.write_str(self.as_str())
17632    }
17633}
17634impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
17635    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17636    where
17637        S: serde::Serializer,
17638    {
17639        serializer.serialize_str(self.as_str())
17640    }
17641}
17642#[cfg(feature = "deserialize")]
17643impl<'de> serde::Deserialize<'de>
17644    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
17645{
17646    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17647        use std::str::FromStr;
17648        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17649        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
17650    }
17651}
17652/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17653///
17654/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17655/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17656///
17657/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17658///
17659/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17660///
17661/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17662#[derive(Copy, Clone, Eq, PartialEq)]
17663pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17664    None,
17665}
17666impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17667    pub fn as_str(self) -> &'static str {
17668        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
17669        match self {
17670            None => "none",
17671        }
17672    }
17673}
17674
17675impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17676    type Err = stripe_types::StripeParseError;
17677    fn from_str(s: &str) -> Result<Self, Self::Err> {
17678        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
17679        match s {
17680            "none" => Ok(None),
17681            _ => Err(stripe_types::StripeParseError),
17682        }
17683    }
17684}
17685impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17686    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17687        f.write_str(self.as_str())
17688    }
17689}
17690
17691impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17692    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17693        f.write_str(self.as_str())
17694    }
17695}
17696impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
17697    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17698    where
17699        S: serde::Serializer,
17700    {
17701        serializer.serialize_str(self.as_str())
17702    }
17703}
17704#[cfg(feature = "deserialize")]
17705impl<'de> serde::Deserialize<'de>
17706    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
17707{
17708    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17709        use std::str::FromStr;
17710        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17711        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
17712    }
17713}
17714/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
17715#[derive(Copy, Clone, Debug, serde::Serialize)]
17716pub struct UpdatePaymentIntentPaymentMethodOptionsEps {
17717    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17718    ///
17719    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17720    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17721    ///
17722    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17723    ///
17724    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17725    ///
17726    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17727    #[serde(skip_serializing_if = "Option::is_none")]
17728    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
17729}
17730impl UpdatePaymentIntentPaymentMethodOptionsEps {
17731    pub fn new() -> Self {
17732        Self { setup_future_usage: None }
17733    }
17734}
17735impl Default for UpdatePaymentIntentPaymentMethodOptionsEps {
17736    fn default() -> Self {
17737        Self::new()
17738    }
17739}
17740/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17741///
17742/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17743/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17744///
17745/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17746///
17747/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17748///
17749/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17750#[derive(Copy, Clone, Eq, PartialEq)]
17751pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17752    None,
17753}
17754impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17755    pub fn as_str(self) -> &'static str {
17756        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
17757        match self {
17758            None => "none",
17759        }
17760    }
17761}
17762
17763impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17764    type Err = stripe_types::StripeParseError;
17765    fn from_str(s: &str) -> Result<Self, Self::Err> {
17766        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
17767        match s {
17768            "none" => Ok(None),
17769            _ => Err(stripe_types::StripeParseError),
17770        }
17771    }
17772}
17773impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17774    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17775        f.write_str(self.as_str())
17776    }
17777}
17778
17779impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17780    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17781        f.write_str(self.as_str())
17782    }
17783}
17784impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17785    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17786    where
17787        S: serde::Serializer,
17788    {
17789        serializer.serialize_str(self.as_str())
17790    }
17791}
17792#[cfg(feature = "deserialize")]
17793impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
17794    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17795        use std::str::FromStr;
17796        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17797        Self::from_str(&s).map_err(|_| {
17798            serde::de::Error::custom(
17799                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
17800            )
17801        })
17802    }
17803}
17804/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
17805#[derive(Copy, Clone, Debug, serde::Serialize)]
17806pub struct UpdatePaymentIntentPaymentMethodOptionsFpx {
17807    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17808    ///
17809    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17810    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17811    ///
17812    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17813    ///
17814    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17815    ///
17816    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17817    #[serde(skip_serializing_if = "Option::is_none")]
17818    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
17819}
17820impl UpdatePaymentIntentPaymentMethodOptionsFpx {
17821    pub fn new() -> Self {
17822        Self { setup_future_usage: None }
17823    }
17824}
17825impl Default for UpdatePaymentIntentPaymentMethodOptionsFpx {
17826    fn default() -> Self {
17827        Self::new()
17828    }
17829}
17830/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17831///
17832/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17833/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17834///
17835/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17836///
17837/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17838///
17839/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17840#[derive(Copy, Clone, Eq, PartialEq)]
17841pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17842    None,
17843}
17844impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17845    pub fn as_str(self) -> &'static str {
17846        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
17847        match self {
17848            None => "none",
17849        }
17850    }
17851}
17852
17853impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17854    type Err = stripe_types::StripeParseError;
17855    fn from_str(s: &str) -> Result<Self, Self::Err> {
17856        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
17857        match s {
17858            "none" => Ok(None),
17859            _ => Err(stripe_types::StripeParseError),
17860        }
17861    }
17862}
17863impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17865        f.write_str(self.as_str())
17866    }
17867}
17868
17869impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17871        f.write_str(self.as_str())
17872    }
17873}
17874impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17875    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17876    where
17877        S: serde::Serializer,
17878    {
17879        serializer.serialize_str(self.as_str())
17880    }
17881}
17882#[cfg(feature = "deserialize")]
17883impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
17884    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17885        use std::str::FromStr;
17886        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17887        Self::from_str(&s).map_err(|_| {
17888            serde::de::Error::custom(
17889                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
17890            )
17891        })
17892    }
17893}
17894/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
17895#[derive(Copy, Clone, Debug, serde::Serialize)]
17896pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay {
17897    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17898    ///
17899    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17900    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17901    ///
17902    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17903    ///
17904    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17905    ///
17906    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17907    #[serde(skip_serializing_if = "Option::is_none")]
17908    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
17909}
17910impl UpdatePaymentIntentPaymentMethodOptionsGiropay {
17911    pub fn new() -> Self {
17912        Self { setup_future_usage: None }
17913    }
17914}
17915impl Default for UpdatePaymentIntentPaymentMethodOptionsGiropay {
17916    fn default() -> Self {
17917        Self::new()
17918    }
17919}
17920/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17921///
17922/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17923/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17924///
17925/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17926///
17927/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17928///
17929/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17930#[derive(Copy, Clone, Eq, PartialEq)]
17931pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17932    None,
17933}
17934impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17935    pub fn as_str(self) -> &'static str {
17936        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
17937        match self {
17938            None => "none",
17939        }
17940    }
17941}
17942
17943impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17944    type Err = stripe_types::StripeParseError;
17945    fn from_str(s: &str) -> Result<Self, Self::Err> {
17946        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
17947        match s {
17948            "none" => Ok(None),
17949            _ => Err(stripe_types::StripeParseError),
17950        }
17951    }
17952}
17953impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17955        f.write_str(self.as_str())
17956    }
17957}
17958
17959impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17960    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17961        f.write_str(self.as_str())
17962    }
17963}
17964impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
17965    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17966    where
17967        S: serde::Serializer,
17968    {
17969        serializer.serialize_str(self.as_str())
17970    }
17971}
17972#[cfg(feature = "deserialize")]
17973impl<'de> serde::Deserialize<'de>
17974    for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
17975{
17976    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17977        use std::str::FromStr;
17978        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17979        Self::from_str(&s).map_err(|_| {
17980            serde::de::Error::custom(
17981                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
17982            )
17983        })
17984    }
17985}
17986/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
17987#[derive(Copy, Clone, Debug, serde::Serialize)]
17988pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay {
17989    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17990    ///
17991    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17992    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17993    ///
17994    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17995    ///
17996    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17997    ///
17998    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17999    #[serde(skip_serializing_if = "Option::is_none")]
18000    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
18001}
18002impl UpdatePaymentIntentPaymentMethodOptionsGrabpay {
18003    pub fn new() -> Self {
18004        Self { setup_future_usage: None }
18005    }
18006}
18007impl Default for UpdatePaymentIntentPaymentMethodOptionsGrabpay {
18008    fn default() -> Self {
18009        Self::new()
18010    }
18011}
18012/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18013///
18014/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18015/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18016///
18017/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18018///
18019/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18020///
18021/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18022#[derive(Copy, Clone, Eq, PartialEq)]
18023pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18024    None,
18025}
18026impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18027    pub fn as_str(self) -> &'static str {
18028        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
18029        match self {
18030            None => "none",
18031        }
18032    }
18033}
18034
18035impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18036    type Err = stripe_types::StripeParseError;
18037    fn from_str(s: &str) -> Result<Self, Self::Err> {
18038        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
18039        match s {
18040            "none" => Ok(None),
18041            _ => Err(stripe_types::StripeParseError),
18042        }
18043    }
18044}
18045impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18046    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18047        f.write_str(self.as_str())
18048    }
18049}
18050
18051impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18052    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18053        f.write_str(self.as_str())
18054    }
18055}
18056impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
18057    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18058    where
18059        S: serde::Serializer,
18060    {
18061        serializer.serialize_str(self.as_str())
18062    }
18063}
18064#[cfg(feature = "deserialize")]
18065impl<'de> serde::Deserialize<'de>
18066    for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
18067{
18068    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18069        use std::str::FromStr;
18070        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18071        Self::from_str(&s).map_err(|_| {
18072            serde::de::Error::custom(
18073                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
18074            )
18075        })
18076    }
18077}
18078/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
18079#[derive(Copy, Clone, Debug, serde::Serialize)]
18080pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal {
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    #[serde(skip_serializing_if = "Option::is_none")]
18092    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
18093}
18094impl UpdatePaymentIntentPaymentMethodOptionsIdeal {
18095    pub fn new() -> Self {
18096        Self { setup_future_usage: None }
18097    }
18098}
18099impl Default for UpdatePaymentIntentPaymentMethodOptionsIdeal {
18100    fn default() -> Self {
18101        Self::new()
18102    }
18103}
18104/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18105///
18106/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18107/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18108///
18109/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18110///
18111/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18112///
18113/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18114#[derive(Copy, Clone, Eq, PartialEq)]
18115pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18116    None,
18117    OffSession,
18118}
18119impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18120    pub fn as_str(self) -> &'static str {
18121        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
18122        match self {
18123            None => "none",
18124            OffSession => "off_session",
18125        }
18126    }
18127}
18128
18129impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18130    type Err = stripe_types::StripeParseError;
18131    fn from_str(s: &str) -> Result<Self, Self::Err> {
18132        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
18133        match s {
18134            "none" => Ok(None),
18135            "off_session" => Ok(OffSession),
18136            _ => Err(stripe_types::StripeParseError),
18137        }
18138    }
18139}
18140impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18141    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18142        f.write_str(self.as_str())
18143    }
18144}
18145
18146impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18147    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18148        f.write_str(self.as_str())
18149    }
18150}
18151impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18152    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18153    where
18154        S: serde::Serializer,
18155    {
18156        serializer.serialize_str(self.as_str())
18157    }
18158}
18159#[cfg(feature = "deserialize")]
18160impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
18161    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18162        use std::str::FromStr;
18163        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18164        Self::from_str(&s).map_err(|_| {
18165            serde::de::Error::custom(
18166                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
18167            )
18168        })
18169    }
18170}
18171/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
18172#[derive(Copy, Clone, Debug, serde::Serialize)]
18173pub struct UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
18174    /// Controls when the funds are captured from the customer's account.
18175    ///
18176    /// 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.
18177    ///
18178    /// 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.
18179    #[serde(skip_serializing_if = "Option::is_none")]
18180    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
18181    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18182    ///
18183    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18184    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18185    ///
18186    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18187    ///
18188    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18189    #[serde(skip_serializing_if = "Option::is_none")]
18190    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
18191}
18192impl UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
18193    pub fn new() -> Self {
18194        Self { capture_method: None, setup_future_usage: None }
18195    }
18196}
18197impl Default for UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
18198    fn default() -> Self {
18199        Self::new()
18200    }
18201}
18202/// Controls when the funds are captured from the customer's account.
18203///
18204/// 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.
18205///
18206/// 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.
18207#[derive(Copy, Clone, Eq, PartialEq)]
18208pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18209    Manual,
18210}
18211impl UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18212    pub fn as_str(self) -> &'static str {
18213        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
18214        match self {
18215            Manual => "manual",
18216        }
18217    }
18218}
18219
18220impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18221    type Err = stripe_types::StripeParseError;
18222    fn from_str(s: &str) -> Result<Self, Self::Err> {
18223        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
18224        match s {
18225            "manual" => Ok(Manual),
18226            _ => Err(stripe_types::StripeParseError),
18227        }
18228    }
18229}
18230impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18231    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18232        f.write_str(self.as_str())
18233    }
18234}
18235
18236impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18237    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18238        f.write_str(self.as_str())
18239    }
18240}
18241impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18242    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18243    where
18244        S: serde::Serializer,
18245    {
18246        serializer.serialize_str(self.as_str())
18247    }
18248}
18249#[cfg(feature = "deserialize")]
18250impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
18251    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18252        use std::str::FromStr;
18253        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18254        Self::from_str(&s).map_err(|_| {
18255            serde::de::Error::custom(
18256                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
18257            )
18258        })
18259    }
18260}
18261/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18262///
18263/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18264/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18265///
18266/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18267///
18268/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18269#[derive(Copy, Clone, Eq, PartialEq)]
18270pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18271    None,
18272    OffSession,
18273}
18274impl UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18275    pub fn as_str(self) -> &'static str {
18276        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
18277        match self {
18278            None => "none",
18279            OffSession => "off_session",
18280        }
18281    }
18282}
18283
18284impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18285    type Err = stripe_types::StripeParseError;
18286    fn from_str(s: &str) -> Result<Self, Self::Err> {
18287        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
18288        match s {
18289            "none" => Ok(None),
18290            "off_session" => Ok(OffSession),
18291            _ => Err(stripe_types::StripeParseError),
18292        }
18293    }
18294}
18295impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18297        f.write_str(self.as_str())
18298    }
18299}
18300
18301impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18303        f.write_str(self.as_str())
18304    }
18305}
18306impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
18307    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18308    where
18309        S: serde::Serializer,
18310    {
18311        serializer.serialize_str(self.as_str())
18312    }
18313}
18314#[cfg(feature = "deserialize")]
18315impl<'de> serde::Deserialize<'de>
18316    for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
18317{
18318    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18319        use std::str::FromStr;
18320        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18321        Self::from_str(&s).map_err(|_| {
18322            serde::de::Error::custom(
18323                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage",
18324            )
18325        })
18326    }
18327}
18328/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
18329#[derive(Clone, Debug, serde::Serialize)]
18330pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna {
18331    /// Controls when the funds are captured from the customer's account.
18332    ///
18333    /// 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.
18334    ///
18335    /// 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.
18336    #[serde(skip_serializing_if = "Option::is_none")]
18337    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
18338    /// On-demand details if setting up or charging an on-demand payment.
18339    #[serde(skip_serializing_if = "Option::is_none")]
18340    pub on_demand: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
18341    /// Preferred language of the Klarna authorization page that the customer is redirected to
18342    #[serde(skip_serializing_if = "Option::is_none")]
18343    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
18344    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18345    ///
18346    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18347    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18348    ///
18349    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18350    ///
18351    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18352    ///
18353    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18354    #[serde(skip_serializing_if = "Option::is_none")]
18355    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
18356    /// Subscription details if setting up or charging a subscription.
18357    #[serde(skip_serializing_if = "Option::is_none")]
18358    pub subscriptions: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
18359}
18360impl UpdatePaymentIntentPaymentMethodOptionsKlarna {
18361    pub fn new() -> Self {
18362        Self {
18363            capture_method: None,
18364            on_demand: None,
18365            preferred_locale: None,
18366            setup_future_usage: None,
18367            subscriptions: None,
18368        }
18369    }
18370}
18371impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarna {
18372    fn default() -> Self {
18373        Self::new()
18374    }
18375}
18376/// Controls when the funds are captured from the customer's account.
18377///
18378/// 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.
18379///
18380/// 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.
18381#[derive(Copy, Clone, Eq, PartialEq)]
18382pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18383    Manual,
18384}
18385impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18386    pub fn as_str(self) -> &'static str {
18387        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
18388        match self {
18389            Manual => "manual",
18390        }
18391    }
18392}
18393
18394impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18395    type Err = stripe_types::StripeParseError;
18396    fn from_str(s: &str) -> Result<Self, Self::Err> {
18397        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
18398        match s {
18399            "manual" => Ok(Manual),
18400            _ => Err(stripe_types::StripeParseError),
18401        }
18402    }
18403}
18404impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18405    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18406        f.write_str(self.as_str())
18407    }
18408}
18409
18410impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18411    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18412        f.write_str(self.as_str())
18413    }
18414}
18415impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18416    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18417    where
18418        S: serde::Serializer,
18419    {
18420        serializer.serialize_str(self.as_str())
18421    }
18422}
18423#[cfg(feature = "deserialize")]
18424impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
18425    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18426        use std::str::FromStr;
18427        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18428        Self::from_str(&s).map_err(|_| {
18429            serde::de::Error::custom(
18430                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
18431            )
18432        })
18433    }
18434}
18435/// On-demand details if setting up or charging an on-demand payment.
18436#[derive(Copy, Clone, Debug, serde::Serialize)]
18437pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
18438    /// Your average amount value.
18439    /// You can use a value across your customer base, or segment based on customer type, country, etc.
18440    #[serde(skip_serializing_if = "Option::is_none")]
18441    pub average_amount: Option<i64>,
18442    /// The maximum value you may charge a customer per purchase.
18443    /// You can use a value across your customer base, or segment based on customer type, country, etc.
18444    #[serde(skip_serializing_if = "Option::is_none")]
18445    pub maximum_amount: Option<i64>,
18446    /// The lowest or minimum value you may charge a customer per purchase.
18447    /// You can use a value across your customer base, or segment based on customer type, country, etc.
18448    #[serde(skip_serializing_if = "Option::is_none")]
18449    pub minimum_amount: Option<i64>,
18450    /// Interval at which the customer is making purchases
18451    #[serde(skip_serializing_if = "Option::is_none")]
18452    pub purchase_interval:
18453        Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
18454    /// The number of `purchase_interval` between charges
18455    #[serde(skip_serializing_if = "Option::is_none")]
18456    pub purchase_interval_count: Option<u64>,
18457}
18458impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
18459    pub fn new() -> Self {
18460        Self {
18461            average_amount: None,
18462            maximum_amount: None,
18463            minimum_amount: None,
18464            purchase_interval: None,
18465            purchase_interval_count: None,
18466        }
18467    }
18468}
18469impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
18470    fn default() -> Self {
18471        Self::new()
18472    }
18473}
18474/// Interval at which the customer is making purchases
18475#[derive(Copy, Clone, Eq, PartialEq)]
18476pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18477    Day,
18478    Month,
18479    Week,
18480    Year,
18481}
18482impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18483    pub fn as_str(self) -> &'static str {
18484        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
18485        match self {
18486            Day => "day",
18487            Month => "month",
18488            Week => "week",
18489            Year => "year",
18490        }
18491    }
18492}
18493
18494impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18495    type Err = stripe_types::StripeParseError;
18496    fn from_str(s: &str) -> Result<Self, Self::Err> {
18497        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
18498        match s {
18499            "day" => Ok(Day),
18500            "month" => Ok(Month),
18501            "week" => Ok(Week),
18502            "year" => Ok(Year),
18503            _ => Err(stripe_types::StripeParseError),
18504        }
18505    }
18506}
18507impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18508    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18509        f.write_str(self.as_str())
18510    }
18511}
18512
18513impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18514    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18515        f.write_str(self.as_str())
18516    }
18517}
18518impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
18519    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18520    where
18521        S: serde::Serializer,
18522    {
18523        serializer.serialize_str(self.as_str())
18524    }
18525}
18526#[cfg(feature = "deserialize")]
18527impl<'de> serde::Deserialize<'de>
18528    for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
18529{
18530    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18531        use std::str::FromStr;
18532        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18533        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
18534    }
18535}
18536/// Preferred language of the Klarna authorization page that the customer is redirected to
18537#[derive(Clone, Eq, PartialEq)]
18538#[non_exhaustive]
18539pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18540    CsMinusCz,
18541    DaMinusDk,
18542    DeMinusAt,
18543    DeMinusCh,
18544    DeMinusDe,
18545    ElMinusGr,
18546    EnMinusAt,
18547    EnMinusAu,
18548    EnMinusBe,
18549    EnMinusCa,
18550    EnMinusCh,
18551    EnMinusCz,
18552    EnMinusDe,
18553    EnMinusDk,
18554    EnMinusEs,
18555    EnMinusFi,
18556    EnMinusFr,
18557    EnMinusGb,
18558    EnMinusGr,
18559    EnMinusIe,
18560    EnMinusIt,
18561    EnMinusNl,
18562    EnMinusNo,
18563    EnMinusNz,
18564    EnMinusPl,
18565    EnMinusPt,
18566    EnMinusRo,
18567    EnMinusSe,
18568    EnMinusUs,
18569    EsMinusEs,
18570    EsMinusUs,
18571    FiMinusFi,
18572    FrMinusBe,
18573    FrMinusCa,
18574    FrMinusCh,
18575    FrMinusFr,
18576    ItMinusCh,
18577    ItMinusIt,
18578    NbMinusNo,
18579    NlMinusBe,
18580    NlMinusNl,
18581    PlMinusPl,
18582    PtMinusPt,
18583    RoMinusRo,
18584    SvMinusFi,
18585    SvMinusSe,
18586    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18587    Unknown(String),
18588}
18589impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18590    pub fn as_str(&self) -> &str {
18591        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
18592        match self {
18593            CsMinusCz => "cs-CZ",
18594            DaMinusDk => "da-DK",
18595            DeMinusAt => "de-AT",
18596            DeMinusCh => "de-CH",
18597            DeMinusDe => "de-DE",
18598            ElMinusGr => "el-GR",
18599            EnMinusAt => "en-AT",
18600            EnMinusAu => "en-AU",
18601            EnMinusBe => "en-BE",
18602            EnMinusCa => "en-CA",
18603            EnMinusCh => "en-CH",
18604            EnMinusCz => "en-CZ",
18605            EnMinusDe => "en-DE",
18606            EnMinusDk => "en-DK",
18607            EnMinusEs => "en-ES",
18608            EnMinusFi => "en-FI",
18609            EnMinusFr => "en-FR",
18610            EnMinusGb => "en-GB",
18611            EnMinusGr => "en-GR",
18612            EnMinusIe => "en-IE",
18613            EnMinusIt => "en-IT",
18614            EnMinusNl => "en-NL",
18615            EnMinusNo => "en-NO",
18616            EnMinusNz => "en-NZ",
18617            EnMinusPl => "en-PL",
18618            EnMinusPt => "en-PT",
18619            EnMinusRo => "en-RO",
18620            EnMinusSe => "en-SE",
18621            EnMinusUs => "en-US",
18622            EsMinusEs => "es-ES",
18623            EsMinusUs => "es-US",
18624            FiMinusFi => "fi-FI",
18625            FrMinusBe => "fr-BE",
18626            FrMinusCa => "fr-CA",
18627            FrMinusCh => "fr-CH",
18628            FrMinusFr => "fr-FR",
18629            ItMinusCh => "it-CH",
18630            ItMinusIt => "it-IT",
18631            NbMinusNo => "nb-NO",
18632            NlMinusBe => "nl-BE",
18633            NlMinusNl => "nl-NL",
18634            PlMinusPl => "pl-PL",
18635            PtMinusPt => "pt-PT",
18636            RoMinusRo => "ro-RO",
18637            SvMinusFi => "sv-FI",
18638            SvMinusSe => "sv-SE",
18639            Unknown(v) => v,
18640        }
18641    }
18642}
18643
18644impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18645    type Err = std::convert::Infallible;
18646    fn from_str(s: &str) -> Result<Self, Self::Err> {
18647        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
18648        match s {
18649            "cs-CZ" => Ok(CsMinusCz),
18650            "da-DK" => Ok(DaMinusDk),
18651            "de-AT" => Ok(DeMinusAt),
18652            "de-CH" => Ok(DeMinusCh),
18653            "de-DE" => Ok(DeMinusDe),
18654            "el-GR" => Ok(ElMinusGr),
18655            "en-AT" => Ok(EnMinusAt),
18656            "en-AU" => Ok(EnMinusAu),
18657            "en-BE" => Ok(EnMinusBe),
18658            "en-CA" => Ok(EnMinusCa),
18659            "en-CH" => Ok(EnMinusCh),
18660            "en-CZ" => Ok(EnMinusCz),
18661            "en-DE" => Ok(EnMinusDe),
18662            "en-DK" => Ok(EnMinusDk),
18663            "en-ES" => Ok(EnMinusEs),
18664            "en-FI" => Ok(EnMinusFi),
18665            "en-FR" => Ok(EnMinusFr),
18666            "en-GB" => Ok(EnMinusGb),
18667            "en-GR" => Ok(EnMinusGr),
18668            "en-IE" => Ok(EnMinusIe),
18669            "en-IT" => Ok(EnMinusIt),
18670            "en-NL" => Ok(EnMinusNl),
18671            "en-NO" => Ok(EnMinusNo),
18672            "en-NZ" => Ok(EnMinusNz),
18673            "en-PL" => Ok(EnMinusPl),
18674            "en-PT" => Ok(EnMinusPt),
18675            "en-RO" => Ok(EnMinusRo),
18676            "en-SE" => Ok(EnMinusSe),
18677            "en-US" => Ok(EnMinusUs),
18678            "es-ES" => Ok(EsMinusEs),
18679            "es-US" => Ok(EsMinusUs),
18680            "fi-FI" => Ok(FiMinusFi),
18681            "fr-BE" => Ok(FrMinusBe),
18682            "fr-CA" => Ok(FrMinusCa),
18683            "fr-CH" => Ok(FrMinusCh),
18684            "fr-FR" => Ok(FrMinusFr),
18685            "it-CH" => Ok(ItMinusCh),
18686            "it-IT" => Ok(ItMinusIt),
18687            "nb-NO" => Ok(NbMinusNo),
18688            "nl-BE" => Ok(NlMinusBe),
18689            "nl-NL" => Ok(NlMinusNl),
18690            "pl-PL" => Ok(PlMinusPl),
18691            "pt-PT" => Ok(PtMinusPt),
18692            "ro-RO" => Ok(RoMinusRo),
18693            "sv-FI" => Ok(SvMinusFi),
18694            "sv-SE" => Ok(SvMinusSe),
18695            v => Ok(Unknown(v.to_owned())),
18696        }
18697    }
18698}
18699impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18700    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18701        f.write_str(self.as_str())
18702    }
18703}
18704
18705impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18706    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18707        f.write_str(self.as_str())
18708    }
18709}
18710impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18711    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18712    where
18713        S: serde::Serializer,
18714    {
18715        serializer.serialize_str(self.as_str())
18716    }
18717}
18718#[cfg(feature = "deserialize")]
18719impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
18720    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18721        use std::str::FromStr;
18722        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18723        Ok(Self::from_str(&s).unwrap())
18724    }
18725}
18726/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18727///
18728/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18729/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18730///
18731/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18732///
18733/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18734///
18735/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18736#[derive(Copy, Clone, Eq, PartialEq)]
18737pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18738    None,
18739    OffSession,
18740    OnSession,
18741}
18742impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18743    pub fn as_str(self) -> &'static str {
18744        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
18745        match self {
18746            None => "none",
18747            OffSession => "off_session",
18748            OnSession => "on_session",
18749        }
18750    }
18751}
18752
18753impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18754    type Err = stripe_types::StripeParseError;
18755    fn from_str(s: &str) -> Result<Self, Self::Err> {
18756        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
18757        match s {
18758            "none" => Ok(None),
18759            "off_session" => Ok(OffSession),
18760            "on_session" => Ok(OnSession),
18761            _ => Err(stripe_types::StripeParseError),
18762        }
18763    }
18764}
18765impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18767        f.write_str(self.as_str())
18768    }
18769}
18770
18771impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18773        f.write_str(self.as_str())
18774    }
18775}
18776impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
18777    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18778    where
18779        S: serde::Serializer,
18780    {
18781        serializer.serialize_str(self.as_str())
18782    }
18783}
18784#[cfg(feature = "deserialize")]
18785impl<'de> serde::Deserialize<'de>
18786    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
18787{
18788    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18789        use std::str::FromStr;
18790        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18791        Self::from_str(&s).map_err(|_| {
18792            serde::de::Error::custom(
18793                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
18794            )
18795        })
18796    }
18797}
18798/// Subscription details if setting up or charging a subscription.
18799#[derive(Clone, Debug, serde::Serialize)]
18800pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
18801    /// Unit of time between subscription charges.
18802    pub interval: UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
18803    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
18804    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
18805    #[serde(skip_serializing_if = "Option::is_none")]
18806    pub interval_count: Option<u64>,
18807    /// Name for subscription.
18808    #[serde(skip_serializing_if = "Option::is_none")]
18809    pub name: Option<String>,
18810    /// Describes the upcoming charge for this subscription.
18811    #[serde(skip_serializing_if = "Option::is_none")]
18812    pub next_billing: Option<SubscriptionNextBillingParam>,
18813    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
18814    /// Use a value that persists across subscription charges.
18815    pub reference: String,
18816}
18817impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
18818    pub fn new(
18819        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
18820        reference: impl Into<String>,
18821    ) -> Self {
18822        Self {
18823            interval: interval.into(),
18824            interval_count: None,
18825            name: None,
18826            next_billing: None,
18827            reference: reference.into(),
18828        }
18829    }
18830}
18831/// Unit of time between subscription charges.
18832#[derive(Copy, Clone, Eq, PartialEq)]
18833pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18834    Day,
18835    Month,
18836    Week,
18837    Year,
18838}
18839impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18840    pub fn as_str(self) -> &'static str {
18841        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
18842        match self {
18843            Day => "day",
18844            Month => "month",
18845            Week => "week",
18846            Year => "year",
18847        }
18848    }
18849}
18850
18851impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18852    type Err = stripe_types::StripeParseError;
18853    fn from_str(s: &str) -> Result<Self, Self::Err> {
18854        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
18855        match s {
18856            "day" => Ok(Day),
18857            "month" => Ok(Month),
18858            "week" => Ok(Week),
18859            "year" => Ok(Year),
18860            _ => Err(stripe_types::StripeParseError),
18861        }
18862    }
18863}
18864impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18865    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18866        f.write_str(self.as_str())
18867    }
18868}
18869
18870impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18871    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18872        f.write_str(self.as_str())
18873    }
18874}
18875impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
18876    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18877    where
18878        S: serde::Serializer,
18879    {
18880        serializer.serialize_str(self.as_str())
18881    }
18882}
18883#[cfg(feature = "deserialize")]
18884impl<'de> serde::Deserialize<'de>
18885    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
18886{
18887    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18888        use std::str::FromStr;
18889        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18890        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
18891    }
18892}
18893/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
18894#[derive(Clone, Debug, serde::Serialize)]
18895pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini {
18896    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
18897    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
18898    /// We recommend to use the customer's phone number.
18899    #[serde(skip_serializing_if = "Option::is_none")]
18900    pub confirmation_number: Option<String>,
18901    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
18902    /// 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.
18903    /// Defaults to 3 days.
18904    #[serde(skip_serializing_if = "Option::is_none")]
18905    pub expires_after_days: Option<u32>,
18906    /// The timestamp at which the Konbini payment instructions will expire.
18907    /// Only one of `expires_after_days` or `expires_at` may be set.
18908    #[serde(skip_serializing_if = "Option::is_none")]
18909    pub expires_at: Option<stripe_types::Timestamp>,
18910    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
18911    #[serde(skip_serializing_if = "Option::is_none")]
18912    pub product_description: Option<String>,
18913    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18914    ///
18915    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18916    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18917    ///
18918    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18919    ///
18920    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18921    ///
18922    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18923    #[serde(skip_serializing_if = "Option::is_none")]
18924    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
18925}
18926impl UpdatePaymentIntentPaymentMethodOptionsKonbini {
18927    pub fn new() -> Self {
18928        Self {
18929            confirmation_number: None,
18930            expires_after_days: None,
18931            expires_at: None,
18932            product_description: None,
18933            setup_future_usage: None,
18934        }
18935    }
18936}
18937impl Default for UpdatePaymentIntentPaymentMethodOptionsKonbini {
18938    fn default() -> Self {
18939        Self::new()
18940    }
18941}
18942/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18943///
18944/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18945/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18946///
18947/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18948///
18949/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18950///
18951/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18952#[derive(Copy, Clone, Eq, PartialEq)]
18953pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18954    None,
18955}
18956impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18957    pub fn as_str(self) -> &'static str {
18958        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
18959        match self {
18960            None => "none",
18961        }
18962    }
18963}
18964
18965impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18966    type Err = stripe_types::StripeParseError;
18967    fn from_str(s: &str) -> Result<Self, Self::Err> {
18968        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
18969        match s {
18970            "none" => Ok(None),
18971            _ => Err(stripe_types::StripeParseError),
18972        }
18973    }
18974}
18975impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18976    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18977        f.write_str(self.as_str())
18978    }
18979}
18980
18981impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18982    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18983        f.write_str(self.as_str())
18984    }
18985}
18986impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
18987    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18988    where
18989        S: serde::Serializer,
18990    {
18991        serializer.serialize_str(self.as_str())
18992    }
18993}
18994#[cfg(feature = "deserialize")]
18995impl<'de> serde::Deserialize<'de>
18996    for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
18997{
18998    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18999        use std::str::FromStr;
19000        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19001        Self::from_str(&s).map_err(|_| {
19002            serde::de::Error::custom(
19003                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
19004            )
19005        })
19006    }
19007}
19008/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
19009#[derive(Copy, Clone, Debug, serde::Serialize)]
19010pub struct UpdatePaymentIntentPaymentMethodOptionsKrCard {
19011    /// Controls when the funds are captured from the customer's account.
19012    ///
19013    /// 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.
19014    ///
19015    /// 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.
19016    #[serde(skip_serializing_if = "Option::is_none")]
19017    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
19018    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19019    ///
19020    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19021    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19022    ///
19023    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19024    ///
19025    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19026    #[serde(skip_serializing_if = "Option::is_none")]
19027    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
19028}
19029impl UpdatePaymentIntentPaymentMethodOptionsKrCard {
19030    pub fn new() -> Self {
19031        Self { capture_method: None, setup_future_usage: None }
19032    }
19033}
19034impl Default for UpdatePaymentIntentPaymentMethodOptionsKrCard {
19035    fn default() -> Self {
19036        Self::new()
19037    }
19038}
19039/// Controls when the funds are captured from the customer's account.
19040///
19041/// 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.
19042///
19043/// 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.
19044#[derive(Copy, Clone, Eq, PartialEq)]
19045pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19046    Manual,
19047}
19048impl UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19049    pub fn as_str(self) -> &'static str {
19050        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
19051        match self {
19052            Manual => "manual",
19053        }
19054    }
19055}
19056
19057impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19058    type Err = stripe_types::StripeParseError;
19059    fn from_str(s: &str) -> Result<Self, Self::Err> {
19060        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
19061        match s {
19062            "manual" => Ok(Manual),
19063            _ => Err(stripe_types::StripeParseError),
19064        }
19065    }
19066}
19067impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19068    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19069        f.write_str(self.as_str())
19070    }
19071}
19072
19073impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19074    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19075        f.write_str(self.as_str())
19076    }
19077}
19078impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19079    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19080    where
19081        S: serde::Serializer,
19082    {
19083        serializer.serialize_str(self.as_str())
19084    }
19085}
19086#[cfg(feature = "deserialize")]
19087impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
19088    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19089        use std::str::FromStr;
19090        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19091        Self::from_str(&s).map_err(|_| {
19092            serde::de::Error::custom(
19093                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
19094            )
19095        })
19096    }
19097}
19098/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19099///
19100/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19101/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19102///
19103/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19104///
19105/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19106#[derive(Copy, Clone, Eq, PartialEq)]
19107pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19108    None,
19109    OffSession,
19110}
19111impl UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19112    pub fn as_str(self) -> &'static str {
19113        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
19114        match self {
19115            None => "none",
19116            OffSession => "off_session",
19117        }
19118    }
19119}
19120
19121impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19122    type Err = stripe_types::StripeParseError;
19123    fn from_str(s: &str) -> Result<Self, Self::Err> {
19124        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
19125        match s {
19126            "none" => Ok(None),
19127            "off_session" => Ok(OffSession),
19128            _ => Err(stripe_types::StripeParseError),
19129        }
19130    }
19131}
19132impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19133    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19134        f.write_str(self.as_str())
19135    }
19136}
19137
19138impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19139    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19140        f.write_str(self.as_str())
19141    }
19142}
19143impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
19144    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19145    where
19146        S: serde::Serializer,
19147    {
19148        serializer.serialize_str(self.as_str())
19149    }
19150}
19151#[cfg(feature = "deserialize")]
19152impl<'de> serde::Deserialize<'de>
19153    for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
19154{
19155    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19156        use std::str::FromStr;
19157        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19158        Self::from_str(&s).map_err(|_| {
19159            serde::de::Error::custom(
19160                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
19161            )
19162        })
19163    }
19164}
19165/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
19166#[derive(Clone, Debug, serde::Serialize)]
19167pub struct UpdatePaymentIntentPaymentMethodOptionsLink {
19168    /// Controls when the funds are captured from the customer's account.
19169    ///
19170    /// 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.
19171    ///
19172    /// 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.
19173    #[serde(skip_serializing_if = "Option::is_none")]
19174    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
19175    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
19176    #[serde(skip_serializing_if = "Option::is_none")]
19177    pub persistent_token: Option<String>,
19178    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19179    ///
19180    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19181    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19182    ///
19183    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19184    ///
19185    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19186    ///
19187    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19188    #[serde(skip_serializing_if = "Option::is_none")]
19189    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
19190}
19191impl UpdatePaymentIntentPaymentMethodOptionsLink {
19192    pub fn new() -> Self {
19193        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
19194    }
19195}
19196impl Default for UpdatePaymentIntentPaymentMethodOptionsLink {
19197    fn default() -> Self {
19198        Self::new()
19199    }
19200}
19201/// Controls when the funds are captured from the customer's account.
19202///
19203/// 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.
19204///
19205/// 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.
19206#[derive(Copy, Clone, Eq, PartialEq)]
19207pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19208    Manual,
19209}
19210impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19211    pub fn as_str(self) -> &'static str {
19212        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
19213        match self {
19214            Manual => "manual",
19215        }
19216    }
19217}
19218
19219impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19220    type Err = stripe_types::StripeParseError;
19221    fn from_str(s: &str) -> Result<Self, Self::Err> {
19222        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
19223        match s {
19224            "manual" => Ok(Manual),
19225            _ => Err(stripe_types::StripeParseError),
19226        }
19227    }
19228}
19229impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19231        f.write_str(self.as_str())
19232    }
19233}
19234
19235impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19236    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19237        f.write_str(self.as_str())
19238    }
19239}
19240impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19241    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19242    where
19243        S: serde::Serializer,
19244    {
19245        serializer.serialize_str(self.as_str())
19246    }
19247}
19248#[cfg(feature = "deserialize")]
19249impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
19250    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19251        use std::str::FromStr;
19252        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19253        Self::from_str(&s).map_err(|_| {
19254            serde::de::Error::custom(
19255                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod",
19256            )
19257        })
19258    }
19259}
19260/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19261///
19262/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19263/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19264///
19265/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19266///
19267/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19268///
19269/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19270#[derive(Copy, Clone, Eq, PartialEq)]
19271pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19272    None,
19273    OffSession,
19274}
19275impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19276    pub fn as_str(self) -> &'static str {
19277        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
19278        match self {
19279            None => "none",
19280            OffSession => "off_session",
19281        }
19282    }
19283}
19284
19285impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19286    type Err = stripe_types::StripeParseError;
19287    fn from_str(s: &str) -> Result<Self, Self::Err> {
19288        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
19289        match s {
19290            "none" => Ok(None),
19291            "off_session" => Ok(OffSession),
19292            _ => Err(stripe_types::StripeParseError),
19293        }
19294    }
19295}
19296impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19298        f.write_str(self.as_str())
19299    }
19300}
19301
19302impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19303    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19304        f.write_str(self.as_str())
19305    }
19306}
19307impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19308    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19309    where
19310        S: serde::Serializer,
19311    {
19312        serializer.serialize_str(self.as_str())
19313    }
19314}
19315#[cfg(feature = "deserialize")]
19316impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
19317    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19318        use std::str::FromStr;
19319        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19320        Self::from_str(&s).map_err(|_| {
19321            serde::de::Error::custom(
19322                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
19323            )
19324        })
19325    }
19326}
19327/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
19328#[derive(Copy, Clone, Debug, serde::Serialize)]
19329pub struct UpdatePaymentIntentPaymentMethodOptionsMbWay {
19330    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19331    ///
19332    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19333    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19334    ///
19335    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19336    ///
19337    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19338    ///
19339    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19340    #[serde(skip_serializing_if = "Option::is_none")]
19341    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
19342}
19343impl UpdatePaymentIntentPaymentMethodOptionsMbWay {
19344    pub fn new() -> Self {
19345        Self { setup_future_usage: None }
19346    }
19347}
19348impl Default for UpdatePaymentIntentPaymentMethodOptionsMbWay {
19349    fn default() -> Self {
19350        Self::new()
19351    }
19352}
19353/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19354///
19355/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19356/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19357///
19358/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19359///
19360/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19361///
19362/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19363#[derive(Copy, Clone, Eq, PartialEq)]
19364pub enum UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19365    None,
19366}
19367impl UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19368    pub fn as_str(self) -> &'static str {
19369        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
19370        match self {
19371            None => "none",
19372        }
19373    }
19374}
19375
19376impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19377    type Err = stripe_types::StripeParseError;
19378    fn from_str(s: &str) -> Result<Self, Self::Err> {
19379        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
19380        match s {
19381            "none" => Ok(None),
19382            _ => Err(stripe_types::StripeParseError),
19383        }
19384    }
19385}
19386impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19387    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19388        f.write_str(self.as_str())
19389    }
19390}
19391
19392impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19394        f.write_str(self.as_str())
19395    }
19396}
19397impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19398    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19399    where
19400        S: serde::Serializer,
19401    {
19402        serializer.serialize_str(self.as_str())
19403    }
19404}
19405#[cfg(feature = "deserialize")]
19406impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
19407    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19408        use std::str::FromStr;
19409        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19410        Self::from_str(&s).map_err(|_| {
19411            serde::de::Error::custom(
19412                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
19413            )
19414        })
19415    }
19416}
19417/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
19418#[derive(Copy, Clone, Debug, serde::Serialize)]
19419pub struct UpdatePaymentIntentPaymentMethodOptionsMobilepay {
19420    /// Controls when the funds are captured from the customer's account.
19421    ///
19422    /// 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.
19423    ///
19424    /// 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.
19425    #[serde(skip_serializing_if = "Option::is_none")]
19426    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
19427    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19428    ///
19429    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19430    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19431    ///
19432    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19433    ///
19434    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19435    ///
19436    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19437    #[serde(skip_serializing_if = "Option::is_none")]
19438    pub setup_future_usage:
19439        Option<UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
19440}
19441impl UpdatePaymentIntentPaymentMethodOptionsMobilepay {
19442    pub fn new() -> Self {
19443        Self { capture_method: None, setup_future_usage: None }
19444    }
19445}
19446impl Default for UpdatePaymentIntentPaymentMethodOptionsMobilepay {
19447    fn default() -> Self {
19448        Self::new()
19449    }
19450}
19451/// Controls when the funds are captured from the customer's account.
19452///
19453/// 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.
19454///
19455/// 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.
19456#[derive(Copy, Clone, Eq, PartialEq)]
19457pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19458    Manual,
19459}
19460impl UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19461    pub fn as_str(self) -> &'static str {
19462        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
19463        match self {
19464            Manual => "manual",
19465        }
19466    }
19467}
19468
19469impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19470    type Err = stripe_types::StripeParseError;
19471    fn from_str(s: &str) -> Result<Self, Self::Err> {
19472        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
19473        match s {
19474            "manual" => Ok(Manual),
19475            _ => Err(stripe_types::StripeParseError),
19476        }
19477    }
19478}
19479impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19480    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19481        f.write_str(self.as_str())
19482    }
19483}
19484
19485impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19486    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19487        f.write_str(self.as_str())
19488    }
19489}
19490impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
19491    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19492    where
19493        S: serde::Serializer,
19494    {
19495        serializer.serialize_str(self.as_str())
19496    }
19497}
19498#[cfg(feature = "deserialize")]
19499impl<'de> serde::Deserialize<'de>
19500    for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
19501{
19502    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19503        use std::str::FromStr;
19504        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19505        Self::from_str(&s).map_err(|_| {
19506            serde::de::Error::custom(
19507                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
19508            )
19509        })
19510    }
19511}
19512/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19513///
19514/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19515/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19516///
19517/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19518///
19519/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19520///
19521/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19522#[derive(Copy, Clone, Eq, PartialEq)]
19523pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19524    None,
19525}
19526impl UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19527    pub fn as_str(self) -> &'static str {
19528        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
19529        match self {
19530            None => "none",
19531        }
19532    }
19533}
19534
19535impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19536    type Err = stripe_types::StripeParseError;
19537    fn from_str(s: &str) -> Result<Self, Self::Err> {
19538        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
19539        match s {
19540            "none" => Ok(None),
19541            _ => Err(stripe_types::StripeParseError),
19542        }
19543    }
19544}
19545impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19547        f.write_str(self.as_str())
19548    }
19549}
19550
19551impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19553        f.write_str(self.as_str())
19554    }
19555}
19556impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
19557    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19558    where
19559        S: serde::Serializer,
19560    {
19561        serializer.serialize_str(self.as_str())
19562    }
19563}
19564#[cfg(feature = "deserialize")]
19565impl<'de> serde::Deserialize<'de>
19566    for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
19567{
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(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
19572    }
19573}
19574/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
19575#[derive(Copy, Clone, Debug, serde::Serialize)]
19576pub struct UpdatePaymentIntentPaymentMethodOptionsMultibanco {
19577    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19578    ///
19579    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19580    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19581    ///
19582    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19583    ///
19584    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19585    ///
19586    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19587    #[serde(skip_serializing_if = "Option::is_none")]
19588    pub setup_future_usage:
19589        Option<UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
19590}
19591impl UpdatePaymentIntentPaymentMethodOptionsMultibanco {
19592    pub fn new() -> Self {
19593        Self { setup_future_usage: None }
19594    }
19595}
19596impl Default for UpdatePaymentIntentPaymentMethodOptionsMultibanco {
19597    fn default() -> Self {
19598        Self::new()
19599    }
19600}
19601/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19602///
19603/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19604/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19605///
19606/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19607///
19608/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19609///
19610/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19611#[derive(Copy, Clone, Eq, PartialEq)]
19612pub enum UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19613    None,
19614}
19615impl UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19616    pub fn as_str(self) -> &'static str {
19617        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
19618        match self {
19619            None => "none",
19620        }
19621    }
19622}
19623
19624impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19625    type Err = stripe_types::StripeParseError;
19626    fn from_str(s: &str) -> Result<Self, Self::Err> {
19627        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
19628        match s {
19629            "none" => Ok(None),
19630            _ => Err(stripe_types::StripeParseError),
19631        }
19632    }
19633}
19634impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19635    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19636        f.write_str(self.as_str())
19637    }
19638}
19639
19640impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19641    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19642        f.write_str(self.as_str())
19643    }
19644}
19645impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
19646    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19647    where
19648        S: serde::Serializer,
19649    {
19650        serializer.serialize_str(self.as_str())
19651    }
19652}
19653#[cfg(feature = "deserialize")]
19654impl<'de> serde::Deserialize<'de>
19655    for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
19656{
19657    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19658        use std::str::FromStr;
19659        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19660        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
19661    }
19662}
19663/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
19664#[derive(Copy, Clone, Debug, serde::Serialize)]
19665pub struct UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19666    /// Controls when the funds are captured from the customer's account.
19667    ///
19668    /// 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.
19669    ///
19670    /// 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.
19671    #[serde(skip_serializing_if = "Option::is_none")]
19672    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
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    #[serde(skip_serializing_if = "Option::is_none")]
19682    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
19683}
19684impl UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19685    pub fn new() -> Self {
19686        Self { capture_method: None, setup_future_usage: None }
19687    }
19688}
19689impl Default for UpdatePaymentIntentPaymentMethodOptionsNaverPay {
19690    fn default() -> Self {
19691        Self::new()
19692    }
19693}
19694/// Controls when the funds are captured from the customer's account.
19695///
19696/// 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.
19697///
19698/// 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.
19699#[derive(Copy, Clone, Eq, PartialEq)]
19700pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19701    Manual,
19702}
19703impl UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19704    pub fn as_str(self) -> &'static str {
19705        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
19706        match self {
19707            Manual => "manual",
19708        }
19709    }
19710}
19711
19712impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19713    type Err = stripe_types::StripeParseError;
19714    fn from_str(s: &str) -> Result<Self, Self::Err> {
19715        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
19716        match s {
19717            "manual" => Ok(Manual),
19718            _ => Err(stripe_types::StripeParseError),
19719        }
19720    }
19721}
19722impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19723    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19724        f.write_str(self.as_str())
19725    }
19726}
19727
19728impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19729    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19730        f.write_str(self.as_str())
19731    }
19732}
19733impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19734    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19735    where
19736        S: serde::Serializer,
19737    {
19738        serializer.serialize_str(self.as_str())
19739    }
19740}
19741#[cfg(feature = "deserialize")]
19742impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
19743    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19744        use std::str::FromStr;
19745        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19746        Self::from_str(&s).map_err(|_| {
19747            serde::de::Error::custom(
19748                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
19749            )
19750        })
19751    }
19752}
19753/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19754///
19755/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19756/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19757///
19758/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19759///
19760/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19761#[derive(Copy, Clone, Eq, PartialEq)]
19762pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19763    None,
19764    OffSession,
19765}
19766impl UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19767    pub fn as_str(self) -> &'static str {
19768        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
19769        match self {
19770            None => "none",
19771            OffSession => "off_session",
19772        }
19773    }
19774}
19775
19776impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19777    type Err = stripe_types::StripeParseError;
19778    fn from_str(s: &str) -> Result<Self, Self::Err> {
19779        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
19780        match s {
19781            "none" => Ok(None),
19782            "off_session" => Ok(OffSession),
19783            _ => Err(stripe_types::StripeParseError),
19784        }
19785    }
19786}
19787impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19788    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19789        f.write_str(self.as_str())
19790    }
19791}
19792
19793impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19795        f.write_str(self.as_str())
19796    }
19797}
19798impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
19799    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19800    where
19801        S: serde::Serializer,
19802    {
19803        serializer.serialize_str(self.as_str())
19804    }
19805}
19806#[cfg(feature = "deserialize")]
19807impl<'de> serde::Deserialize<'de>
19808    for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
19809{
19810    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19811        use std::str::FromStr;
19812        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19813        Self::from_str(&s).map_err(|_| {
19814            serde::de::Error::custom(
19815                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage",
19816            )
19817        })
19818    }
19819}
19820/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
19821#[derive(Clone, Debug, serde::Serialize)]
19822pub struct UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19823    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19824    ///
19825    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19826    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19827    ///
19828    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19829    ///
19830    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19831    ///
19832    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19833    #[serde(skip_serializing_if = "Option::is_none")]
19834    pub setup_future_usage:
19835        Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
19836    /// Controls when Stripe will attempt to debit the funds from the customer's account.
19837    /// The date must be a string in YYYY-MM-DD format.
19838    /// The date must be in the future and between 3 and 15 calendar days from now.
19839    #[serde(skip_serializing_if = "Option::is_none")]
19840    pub target_date: Option<String>,
19841}
19842impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19843    pub fn new() -> Self {
19844        Self { setup_future_usage: None, target_date: None }
19845    }
19846}
19847impl Default for UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
19848    fn default() -> Self {
19849        Self::new()
19850    }
19851}
19852/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19853///
19854/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19855/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19856///
19857/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19858///
19859/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19860///
19861/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19862#[derive(Copy, Clone, Eq, PartialEq)]
19863pub enum UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19864    None,
19865    OffSession,
19866    OnSession,
19867}
19868impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19869    pub fn as_str(self) -> &'static str {
19870        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
19871        match self {
19872            None => "none",
19873            OffSession => "off_session",
19874            OnSession => "on_session",
19875        }
19876    }
19877}
19878
19879impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19880    type Err = stripe_types::StripeParseError;
19881    fn from_str(s: &str) -> Result<Self, Self::Err> {
19882        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
19883        match s {
19884            "none" => Ok(None),
19885            "off_session" => Ok(OffSession),
19886            "on_session" => Ok(OnSession),
19887            _ => Err(stripe_types::StripeParseError),
19888        }
19889    }
19890}
19891impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19892    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19893        f.write_str(self.as_str())
19894    }
19895}
19896
19897impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19898    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19899        f.write_str(self.as_str())
19900    }
19901}
19902impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
19903    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19904    where
19905        S: serde::Serializer,
19906    {
19907        serializer.serialize_str(self.as_str())
19908    }
19909}
19910#[cfg(feature = "deserialize")]
19911impl<'de> serde::Deserialize<'de>
19912    for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
19913{
19914    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19915        use std::str::FromStr;
19916        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19917        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
19918    }
19919}
19920/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
19921#[derive(Copy, Clone, Debug, serde::Serialize)]
19922pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo {
19923    /// The number of calendar days before an OXXO voucher expires.
19924    /// 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.
19925    #[serde(skip_serializing_if = "Option::is_none")]
19926    pub expires_after_days: Option<u32>,
19927    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19928    ///
19929    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19930    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19931    ///
19932    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19933    ///
19934    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19935    ///
19936    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19937    #[serde(skip_serializing_if = "Option::is_none")]
19938    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
19939}
19940impl UpdatePaymentIntentPaymentMethodOptionsOxxo {
19941    pub fn new() -> Self {
19942        Self { expires_after_days: None, setup_future_usage: None }
19943    }
19944}
19945impl Default for UpdatePaymentIntentPaymentMethodOptionsOxxo {
19946    fn default() -> Self {
19947        Self::new()
19948    }
19949}
19950/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19951///
19952/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19953/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19954///
19955/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19956///
19957/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19958///
19959/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19960#[derive(Copy, Clone, Eq, PartialEq)]
19961pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19962    None,
19963}
19964impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19965    pub fn as_str(self) -> &'static str {
19966        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
19967        match self {
19968            None => "none",
19969        }
19970    }
19971}
19972
19973impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19974    type Err = stripe_types::StripeParseError;
19975    fn from_str(s: &str) -> Result<Self, Self::Err> {
19976        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
19977        match s {
19978            "none" => Ok(None),
19979            _ => Err(stripe_types::StripeParseError),
19980        }
19981    }
19982}
19983impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19984    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19985        f.write_str(self.as_str())
19986    }
19987}
19988
19989impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19990    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19991        f.write_str(self.as_str())
19992    }
19993}
19994impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
19995    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19996    where
19997        S: serde::Serializer,
19998    {
19999        serializer.serialize_str(self.as_str())
20000    }
20001}
20002#[cfg(feature = "deserialize")]
20003impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
20004    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20005        use std::str::FromStr;
20006        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20007        Self::from_str(&s).map_err(|_| {
20008            serde::de::Error::custom(
20009                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
20010            )
20011        })
20012    }
20013}
20014/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
20015#[derive(Copy, Clone, Debug, serde::Serialize)]
20016pub struct UpdatePaymentIntentPaymentMethodOptionsP24 {
20017    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20018    ///
20019    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20020    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20021    ///
20022    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20023    ///
20024    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20025    ///
20026    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20027    #[serde(skip_serializing_if = "Option::is_none")]
20028    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
20029    /// Confirm that the payer has accepted the P24 terms and conditions.
20030    #[serde(skip_serializing_if = "Option::is_none")]
20031    pub tos_shown_and_accepted: Option<bool>,
20032}
20033impl UpdatePaymentIntentPaymentMethodOptionsP24 {
20034    pub fn new() -> Self {
20035        Self { setup_future_usage: None, tos_shown_and_accepted: None }
20036    }
20037}
20038impl Default for UpdatePaymentIntentPaymentMethodOptionsP24 {
20039    fn default() -> Self {
20040        Self::new()
20041    }
20042}
20043/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20044///
20045/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20046/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20047///
20048/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20049///
20050/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20051///
20052/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20053#[derive(Copy, Clone, Eq, PartialEq)]
20054pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20055    None,
20056}
20057impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20058    pub fn as_str(self) -> &'static str {
20059        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
20060        match self {
20061            None => "none",
20062        }
20063    }
20064}
20065
20066impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20067    type Err = stripe_types::StripeParseError;
20068    fn from_str(s: &str) -> Result<Self, Self::Err> {
20069        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
20070        match s {
20071            "none" => Ok(None),
20072            _ => Err(stripe_types::StripeParseError),
20073        }
20074    }
20075}
20076impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20077    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20078        f.write_str(self.as_str())
20079    }
20080}
20081
20082impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20083    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20084        f.write_str(self.as_str())
20085    }
20086}
20087impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20088    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20089    where
20090        S: serde::Serializer,
20091    {
20092        serializer.serialize_str(self.as_str())
20093    }
20094}
20095#[cfg(feature = "deserialize")]
20096impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
20097    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20098        use std::str::FromStr;
20099        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20100        Self::from_str(&s).map_err(|_| {
20101            serde::de::Error::custom(
20102                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
20103            )
20104        })
20105    }
20106}
20107/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
20108#[derive(Copy, Clone, Debug, serde::Serialize)]
20109pub struct UpdatePaymentIntentPaymentMethodOptionsPayco {
20110    /// Controls when the funds are captured from the customer's account.
20111    ///
20112    /// 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.
20113    ///
20114    /// 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.
20115    #[serde(skip_serializing_if = "Option::is_none")]
20116    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
20117}
20118impl UpdatePaymentIntentPaymentMethodOptionsPayco {
20119    pub fn new() -> Self {
20120        Self { capture_method: None }
20121    }
20122}
20123impl Default for UpdatePaymentIntentPaymentMethodOptionsPayco {
20124    fn default() -> Self {
20125        Self::new()
20126    }
20127}
20128/// Controls when the funds are captured from the customer's account.
20129///
20130/// 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.
20131///
20132/// 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.
20133#[derive(Copy, Clone, Eq, PartialEq)]
20134pub enum UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20135    Manual,
20136}
20137impl UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20138    pub fn as_str(self) -> &'static str {
20139        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
20140        match self {
20141            Manual => "manual",
20142        }
20143    }
20144}
20145
20146impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20147    type Err = stripe_types::StripeParseError;
20148    fn from_str(s: &str) -> Result<Self, Self::Err> {
20149        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
20150        match s {
20151            "manual" => Ok(Manual),
20152            _ => Err(stripe_types::StripeParseError),
20153        }
20154    }
20155}
20156impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20157    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20158        f.write_str(self.as_str())
20159    }
20160}
20161
20162impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20163    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20164        f.write_str(self.as_str())
20165    }
20166}
20167impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20168    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20169    where
20170        S: serde::Serializer,
20171    {
20172        serializer.serialize_str(self.as_str())
20173    }
20174}
20175#[cfg(feature = "deserialize")]
20176impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
20177    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20178        use std::str::FromStr;
20179        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20180        Self::from_str(&s).map_err(|_| {
20181            serde::de::Error::custom(
20182                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
20183            )
20184        })
20185    }
20186}
20187/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
20188#[derive(Copy, Clone, Debug, serde::Serialize)]
20189pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow {
20190    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20191    ///
20192    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20193    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20194    ///
20195    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20196    ///
20197    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20198    ///
20199    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20200    #[serde(skip_serializing_if = "Option::is_none")]
20201    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
20202}
20203impl UpdatePaymentIntentPaymentMethodOptionsPaynow {
20204    pub fn new() -> Self {
20205        Self { setup_future_usage: None }
20206    }
20207}
20208impl Default for UpdatePaymentIntentPaymentMethodOptionsPaynow {
20209    fn default() -> Self {
20210        Self::new()
20211    }
20212}
20213/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20214///
20215/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20216/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20217///
20218/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20219///
20220/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20221///
20222/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20223#[derive(Copy, Clone, Eq, PartialEq)]
20224pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20225    None,
20226}
20227impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20228    pub fn as_str(self) -> &'static str {
20229        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
20230        match self {
20231            None => "none",
20232        }
20233    }
20234}
20235
20236impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20237    type Err = stripe_types::StripeParseError;
20238    fn from_str(s: &str) -> Result<Self, Self::Err> {
20239        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
20240        match s {
20241            "none" => Ok(None),
20242            _ => Err(stripe_types::StripeParseError),
20243        }
20244    }
20245}
20246impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20247    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20248        f.write_str(self.as_str())
20249    }
20250}
20251
20252impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20253    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20254        f.write_str(self.as_str())
20255    }
20256}
20257impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
20258    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20259    where
20260        S: serde::Serializer,
20261    {
20262        serializer.serialize_str(self.as_str())
20263    }
20264}
20265#[cfg(feature = "deserialize")]
20266impl<'de> serde::Deserialize<'de>
20267    for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
20268{
20269    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20270        use std::str::FromStr;
20271        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20272        Self::from_str(&s).map_err(|_| {
20273            serde::de::Error::custom(
20274                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
20275            )
20276        })
20277    }
20278}
20279/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
20280#[derive(Clone, Debug, serde::Serialize)]
20281pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal {
20282    /// Controls when the funds will be captured from the customer's account.
20283    #[serde(skip_serializing_if = "Option::is_none")]
20284    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
20285    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
20286    #[serde(skip_serializing_if = "Option::is_none")]
20287    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
20288    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
20289    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
20290    #[serde(skip_serializing_if = "Option::is_none")]
20291    pub reference: Option<String>,
20292    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
20293    #[serde(skip_serializing_if = "Option::is_none")]
20294    pub risk_correlation_id: Option<String>,
20295    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20296    ///
20297    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20298    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20299    ///
20300    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20301    ///
20302    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20303    ///
20304    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20305    #[serde(skip_serializing_if = "Option::is_none")]
20306    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
20307}
20308impl UpdatePaymentIntentPaymentMethodOptionsPaypal {
20309    pub fn new() -> Self {
20310        Self {
20311            capture_method: None,
20312            preferred_locale: None,
20313            reference: None,
20314            risk_correlation_id: None,
20315            setup_future_usage: None,
20316        }
20317    }
20318}
20319impl Default for UpdatePaymentIntentPaymentMethodOptionsPaypal {
20320    fn default() -> Self {
20321        Self::new()
20322    }
20323}
20324/// Controls when the funds will be captured from the customer's account.
20325#[derive(Copy, Clone, Eq, PartialEq)]
20326pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20327    Manual,
20328}
20329impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20330    pub fn as_str(self) -> &'static str {
20331        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
20332        match self {
20333            Manual => "manual",
20334        }
20335    }
20336}
20337
20338impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20339    type Err = stripe_types::StripeParseError;
20340    fn from_str(s: &str) -> Result<Self, Self::Err> {
20341        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
20342        match s {
20343            "manual" => Ok(Manual),
20344            _ => Err(stripe_types::StripeParseError),
20345        }
20346    }
20347}
20348impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20349    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20350        f.write_str(self.as_str())
20351    }
20352}
20353
20354impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20355    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20356        f.write_str(self.as_str())
20357    }
20358}
20359impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20360    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20361    where
20362        S: serde::Serializer,
20363    {
20364        serializer.serialize_str(self.as_str())
20365    }
20366}
20367#[cfg(feature = "deserialize")]
20368impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
20369    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20370        use std::str::FromStr;
20371        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20372        Self::from_str(&s).map_err(|_| {
20373            serde::de::Error::custom(
20374                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
20375            )
20376        })
20377    }
20378}
20379/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
20380#[derive(Clone, Eq, PartialEq)]
20381#[non_exhaustive]
20382pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20383    CsMinusCz,
20384    DaMinusDk,
20385    DeMinusAt,
20386    DeMinusDe,
20387    DeMinusLu,
20388    ElMinusGr,
20389    EnMinusGb,
20390    EnMinusUs,
20391    EsMinusEs,
20392    FiMinusFi,
20393    FrMinusBe,
20394    FrMinusFr,
20395    FrMinusLu,
20396    HuMinusHu,
20397    ItMinusIt,
20398    NlMinusBe,
20399    NlMinusNl,
20400    PlMinusPl,
20401    PtMinusPt,
20402    SkMinusSk,
20403    SvMinusSe,
20404    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20405    Unknown(String),
20406}
20407impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20408    pub fn as_str(&self) -> &str {
20409        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
20410        match self {
20411            CsMinusCz => "cs-CZ",
20412            DaMinusDk => "da-DK",
20413            DeMinusAt => "de-AT",
20414            DeMinusDe => "de-DE",
20415            DeMinusLu => "de-LU",
20416            ElMinusGr => "el-GR",
20417            EnMinusGb => "en-GB",
20418            EnMinusUs => "en-US",
20419            EsMinusEs => "es-ES",
20420            FiMinusFi => "fi-FI",
20421            FrMinusBe => "fr-BE",
20422            FrMinusFr => "fr-FR",
20423            FrMinusLu => "fr-LU",
20424            HuMinusHu => "hu-HU",
20425            ItMinusIt => "it-IT",
20426            NlMinusBe => "nl-BE",
20427            NlMinusNl => "nl-NL",
20428            PlMinusPl => "pl-PL",
20429            PtMinusPt => "pt-PT",
20430            SkMinusSk => "sk-SK",
20431            SvMinusSe => "sv-SE",
20432            Unknown(v) => v,
20433        }
20434    }
20435}
20436
20437impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20438    type Err = std::convert::Infallible;
20439    fn from_str(s: &str) -> Result<Self, Self::Err> {
20440        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
20441        match s {
20442            "cs-CZ" => Ok(CsMinusCz),
20443            "da-DK" => Ok(DaMinusDk),
20444            "de-AT" => Ok(DeMinusAt),
20445            "de-DE" => Ok(DeMinusDe),
20446            "de-LU" => Ok(DeMinusLu),
20447            "el-GR" => Ok(ElMinusGr),
20448            "en-GB" => Ok(EnMinusGb),
20449            "en-US" => Ok(EnMinusUs),
20450            "es-ES" => Ok(EsMinusEs),
20451            "fi-FI" => Ok(FiMinusFi),
20452            "fr-BE" => Ok(FrMinusBe),
20453            "fr-FR" => Ok(FrMinusFr),
20454            "fr-LU" => Ok(FrMinusLu),
20455            "hu-HU" => Ok(HuMinusHu),
20456            "it-IT" => Ok(ItMinusIt),
20457            "nl-BE" => Ok(NlMinusBe),
20458            "nl-NL" => Ok(NlMinusNl),
20459            "pl-PL" => Ok(PlMinusPl),
20460            "pt-PT" => Ok(PtMinusPt),
20461            "sk-SK" => Ok(SkMinusSk),
20462            "sv-SE" => Ok(SvMinusSe),
20463            v => Ok(Unknown(v.to_owned())),
20464        }
20465    }
20466}
20467impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20468    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20469        f.write_str(self.as_str())
20470    }
20471}
20472
20473impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20474    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20475        f.write_str(self.as_str())
20476    }
20477}
20478impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20479    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20480    where
20481        S: serde::Serializer,
20482    {
20483        serializer.serialize_str(self.as_str())
20484    }
20485}
20486#[cfg(feature = "deserialize")]
20487impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
20488    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20489        use std::str::FromStr;
20490        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20491        Ok(Self::from_str(&s).unwrap())
20492    }
20493}
20494/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20495///
20496/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20497/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20498///
20499/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20500///
20501/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20502///
20503/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20504#[derive(Copy, Clone, Eq, PartialEq)]
20505pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20506    None,
20507    OffSession,
20508}
20509impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20510    pub fn as_str(self) -> &'static str {
20511        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
20512        match self {
20513            None => "none",
20514            OffSession => "off_session",
20515        }
20516    }
20517}
20518
20519impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20520    type Err = stripe_types::StripeParseError;
20521    fn from_str(s: &str) -> Result<Self, Self::Err> {
20522        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
20523        match s {
20524            "none" => Ok(None),
20525            "off_session" => Ok(OffSession),
20526            _ => Err(stripe_types::StripeParseError),
20527        }
20528    }
20529}
20530impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20531    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20532        f.write_str(self.as_str())
20533    }
20534}
20535
20536impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20537    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20538        f.write_str(self.as_str())
20539    }
20540}
20541impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
20542    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20543    where
20544        S: serde::Serializer,
20545    {
20546        serializer.serialize_str(self.as_str())
20547    }
20548}
20549#[cfg(feature = "deserialize")]
20550impl<'de> serde::Deserialize<'de>
20551    for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
20552{
20553    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20554        use std::str::FromStr;
20555        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20556        Self::from_str(&s).map_err(|_| {
20557            serde::de::Error::custom(
20558                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
20559            )
20560        })
20561    }
20562}
20563/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
20564#[derive(Copy, Clone, Debug, serde::Serialize)]
20565pub struct UpdatePaymentIntentPaymentMethodOptionsPix {
20566    /// Determines if the amount includes the IOF tax. Defaults to `never`.
20567    #[serde(skip_serializing_if = "Option::is_none")]
20568    pub amount_includes_iof: Option<UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
20569    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
20570    /// Defaults to 86400 seconds.
20571    #[serde(skip_serializing_if = "Option::is_none")]
20572    pub expires_after_seconds: Option<i64>,
20573    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
20574    /// Defaults to 1 day in the future.
20575    #[serde(skip_serializing_if = "Option::is_none")]
20576    pub expires_at: Option<stripe_types::Timestamp>,
20577    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20578    ///
20579    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20580    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20581    ///
20582    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20583    ///
20584    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20585    ///
20586    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20587    #[serde(skip_serializing_if = "Option::is_none")]
20588    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
20589}
20590impl UpdatePaymentIntentPaymentMethodOptionsPix {
20591    pub fn new() -> Self {
20592        Self {
20593            amount_includes_iof: None,
20594            expires_after_seconds: None,
20595            expires_at: None,
20596            setup_future_usage: None,
20597        }
20598    }
20599}
20600impl Default for UpdatePaymentIntentPaymentMethodOptionsPix {
20601    fn default() -> Self {
20602        Self::new()
20603    }
20604}
20605/// Determines if the amount includes the IOF tax. Defaults to `never`.
20606#[derive(Copy, Clone, Eq, PartialEq)]
20607pub enum UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20608    Always,
20609    Never,
20610}
20611impl UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20612    pub fn as_str(self) -> &'static str {
20613        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
20614        match self {
20615            Always => "always",
20616            Never => "never",
20617        }
20618    }
20619}
20620
20621impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20622    type Err = stripe_types::StripeParseError;
20623    fn from_str(s: &str) -> Result<Self, Self::Err> {
20624        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
20625        match s {
20626            "always" => Ok(Always),
20627            "never" => Ok(Never),
20628            _ => Err(stripe_types::StripeParseError),
20629        }
20630    }
20631}
20632impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20634        f.write_str(self.as_str())
20635    }
20636}
20637
20638impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20639    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20640        f.write_str(self.as_str())
20641    }
20642}
20643impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20644    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20645    where
20646        S: serde::Serializer,
20647    {
20648        serializer.serialize_str(self.as_str())
20649    }
20650}
20651#[cfg(feature = "deserialize")]
20652impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
20653    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20654        use std::str::FromStr;
20655        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20656        Self::from_str(&s).map_err(|_| {
20657            serde::de::Error::custom(
20658                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
20659            )
20660        })
20661    }
20662}
20663/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20664///
20665/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20666/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20667///
20668/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20669///
20670/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20671///
20672/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20673#[derive(Copy, Clone, Eq, PartialEq)]
20674pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20675    None,
20676}
20677impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20678    pub fn as_str(self) -> &'static str {
20679        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
20680        match self {
20681            None => "none",
20682        }
20683    }
20684}
20685
20686impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20687    type Err = stripe_types::StripeParseError;
20688    fn from_str(s: &str) -> Result<Self, Self::Err> {
20689        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
20690        match s {
20691            "none" => Ok(None),
20692            _ => Err(stripe_types::StripeParseError),
20693        }
20694    }
20695}
20696impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20697    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20698        f.write_str(self.as_str())
20699    }
20700}
20701
20702impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20703    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20704        f.write_str(self.as_str())
20705    }
20706}
20707impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20708    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20709    where
20710        S: serde::Serializer,
20711    {
20712        serializer.serialize_str(self.as_str())
20713    }
20714}
20715#[cfg(feature = "deserialize")]
20716impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
20717    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20718        use std::str::FromStr;
20719        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20720        Self::from_str(&s).map_err(|_| {
20721            serde::de::Error::custom(
20722                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
20723            )
20724        })
20725    }
20726}
20727/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
20728#[derive(Copy, Clone, Debug, serde::Serialize)]
20729pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20730    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20731    ///
20732    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20733    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20734    ///
20735    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20736    ///
20737    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20738    ///
20739    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20740    #[serde(skip_serializing_if = "Option::is_none")]
20741    pub setup_future_usage:
20742        Option<UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
20743}
20744impl UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20745    pub fn new() -> Self {
20746        Self { setup_future_usage: None }
20747    }
20748}
20749impl Default for UpdatePaymentIntentPaymentMethodOptionsPromptpay {
20750    fn default() -> Self {
20751        Self::new()
20752    }
20753}
20754/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20755///
20756/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20757/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20758///
20759/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20760///
20761/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20762///
20763/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20764#[derive(Copy, Clone, Eq, PartialEq)]
20765pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20766    None,
20767}
20768impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20769    pub fn as_str(self) -> &'static str {
20770        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
20771        match self {
20772            None => "none",
20773        }
20774    }
20775}
20776
20777impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20778    type Err = stripe_types::StripeParseError;
20779    fn from_str(s: &str) -> Result<Self, Self::Err> {
20780        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
20781        match s {
20782            "none" => Ok(None),
20783            _ => Err(stripe_types::StripeParseError),
20784        }
20785    }
20786}
20787impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20788    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20789        f.write_str(self.as_str())
20790    }
20791}
20792
20793impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20795        f.write_str(self.as_str())
20796    }
20797}
20798impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
20799    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20800    where
20801        S: serde::Serializer,
20802    {
20803        serializer.serialize_str(self.as_str())
20804    }
20805}
20806#[cfg(feature = "deserialize")]
20807impl<'de> serde::Deserialize<'de>
20808    for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
20809{
20810    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20811        use std::str::FromStr;
20812        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20813        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
20814    }
20815}
20816/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
20817#[derive(Copy, Clone, Debug, serde::Serialize)]
20818pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20819    /// Controls when the funds are captured from the customer's account.
20820    ///
20821    /// 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.
20822    ///
20823    /// 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.
20824    #[serde(skip_serializing_if = "Option::is_none")]
20825    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
20826    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20827    ///
20828    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20829    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20830    ///
20831    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20832    ///
20833    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20834    #[serde(skip_serializing_if = "Option::is_none")]
20835    pub setup_future_usage:
20836        Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
20837}
20838impl UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20839    pub fn new() -> Self {
20840        Self { capture_method: None, setup_future_usage: None }
20841    }
20842}
20843impl Default for UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
20844    fn default() -> Self {
20845        Self::new()
20846    }
20847}
20848/// Controls when the funds are captured from the customer's account.
20849///
20850/// 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.
20851///
20852/// 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.
20853#[derive(Copy, Clone, Eq, PartialEq)]
20854pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20855    Manual,
20856}
20857impl UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20858    pub fn as_str(self) -> &'static str {
20859        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
20860        match self {
20861            Manual => "manual",
20862        }
20863    }
20864}
20865
20866impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20867    type Err = stripe_types::StripeParseError;
20868    fn from_str(s: &str) -> Result<Self, Self::Err> {
20869        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
20870        match s {
20871            "manual" => Ok(Manual),
20872            _ => Err(stripe_types::StripeParseError),
20873        }
20874    }
20875}
20876impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20877    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20878        f.write_str(self.as_str())
20879    }
20880}
20881
20882impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20883    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20884        f.write_str(self.as_str())
20885    }
20886}
20887impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
20888    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20889    where
20890        S: serde::Serializer,
20891    {
20892        serializer.serialize_str(self.as_str())
20893    }
20894}
20895#[cfg(feature = "deserialize")]
20896impl<'de> serde::Deserialize<'de>
20897    for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
20898{
20899    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20900        use std::str::FromStr;
20901        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20902        Self::from_str(&s).map_err(|_| {
20903            serde::de::Error::custom(
20904                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
20905            )
20906        })
20907    }
20908}
20909/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20910///
20911/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20912/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20913///
20914/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20915///
20916/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20917#[derive(Copy, Clone, Eq, PartialEq)]
20918pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20919    None,
20920    OffSession,
20921}
20922impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20923    pub fn as_str(self) -> &'static str {
20924        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
20925        match self {
20926            None => "none",
20927            OffSession => "off_session",
20928        }
20929    }
20930}
20931
20932impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20933    type Err = stripe_types::StripeParseError;
20934    fn from_str(s: &str) -> Result<Self, Self::Err> {
20935        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
20936        match s {
20937            "none" => Ok(None),
20938            "off_session" => Ok(OffSession),
20939            _ => Err(stripe_types::StripeParseError),
20940        }
20941    }
20942}
20943impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20944    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20945        f.write_str(self.as_str())
20946    }
20947}
20948
20949impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20950    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20951        f.write_str(self.as_str())
20952    }
20953}
20954impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
20955    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20956    where
20957        S: serde::Serializer,
20958    {
20959        serializer.serialize_str(self.as_str())
20960    }
20961}
20962#[cfg(feature = "deserialize")]
20963impl<'de> serde::Deserialize<'de>
20964    for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
20965{
20966    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20967        use std::str::FromStr;
20968        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20969        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
20970    }
20971}
20972/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
20973#[derive(Copy, Clone, Debug, serde::Serialize)]
20974pub struct UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
20975    /// Controls when the funds are captured from the customer's account.
20976    ///
20977    /// 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.
20978    ///
20979    /// 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.
20980    #[serde(skip_serializing_if = "Option::is_none")]
20981    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
20982}
20983impl UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
20984    pub fn new() -> Self {
20985        Self { capture_method: None }
20986    }
20987}
20988impl Default for UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
20989    fn default() -> Self {
20990        Self::new()
20991    }
20992}
20993/// Controls when the funds are captured from the customer's account.
20994///
20995/// 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.
20996///
20997/// 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.
20998#[derive(Copy, Clone, Eq, PartialEq)]
20999pub enum UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21000    Manual,
21001}
21002impl UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21003    pub fn as_str(self) -> &'static str {
21004        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
21005        match self {
21006            Manual => "manual",
21007        }
21008    }
21009}
21010
21011impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21012    type Err = stripe_types::StripeParseError;
21013    fn from_str(s: &str) -> Result<Self, Self::Err> {
21014        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
21015        match s {
21016            "manual" => Ok(Manual),
21017            _ => Err(stripe_types::StripeParseError),
21018        }
21019    }
21020}
21021impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21023        f.write_str(self.as_str())
21024    }
21025}
21026
21027impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21028    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21029        f.write_str(self.as_str())
21030    }
21031}
21032impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
21033    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21034    where
21035        S: serde::Serializer,
21036    {
21037        serializer.serialize_str(self.as_str())
21038    }
21039}
21040#[cfg(feature = "deserialize")]
21041impl<'de> serde::Deserialize<'de>
21042    for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
21043{
21044    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21045        use std::str::FromStr;
21046        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21047        Self::from_str(&s).map_err(|_| {
21048            serde::de::Error::custom(
21049                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
21050            )
21051        })
21052    }
21053}
21054/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
21055#[derive(Copy, Clone, Debug, serde::Serialize)]
21056pub struct UpdatePaymentIntentPaymentMethodOptionsSatispay {
21057    /// Controls when the funds are captured from the customer's account.
21058    ///
21059    /// 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.
21060    ///
21061    /// 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.
21062    #[serde(skip_serializing_if = "Option::is_none")]
21063    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
21064}
21065impl UpdatePaymentIntentPaymentMethodOptionsSatispay {
21066    pub fn new() -> Self {
21067        Self { capture_method: None }
21068    }
21069}
21070impl Default for UpdatePaymentIntentPaymentMethodOptionsSatispay {
21071    fn default() -> Self {
21072        Self::new()
21073    }
21074}
21075/// Controls when the funds are captured from the customer's account.
21076///
21077/// 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.
21078///
21079/// 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.
21080#[derive(Copy, Clone, Eq, PartialEq)]
21081pub enum UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21082    Manual,
21083}
21084impl UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21085    pub fn as_str(self) -> &'static str {
21086        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
21087        match self {
21088            Manual => "manual",
21089        }
21090    }
21091}
21092
21093impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21094    type Err = stripe_types::StripeParseError;
21095    fn from_str(s: &str) -> Result<Self, Self::Err> {
21096        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
21097        match s {
21098            "manual" => Ok(Manual),
21099            _ => Err(stripe_types::StripeParseError),
21100        }
21101    }
21102}
21103impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21104    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21105        f.write_str(self.as_str())
21106    }
21107}
21108
21109impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21110    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21111        f.write_str(self.as_str())
21112    }
21113}
21114impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21115    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21116    where
21117        S: serde::Serializer,
21118    {
21119        serializer.serialize_str(self.as_str())
21120    }
21121}
21122#[cfg(feature = "deserialize")]
21123impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
21124    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21125        use std::str::FromStr;
21126        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21127        Self::from_str(&s).map_err(|_| {
21128            serde::de::Error::custom(
21129                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
21130            )
21131        })
21132    }
21133}
21134/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
21135#[derive(Clone, Debug, serde::Serialize)]
21136pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
21137    /// Additional fields for Mandate creation
21138    #[serde(skip_serializing_if = "Option::is_none")]
21139    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
21140    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21141    ///
21142    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21143    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21144    ///
21145    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21146    ///
21147    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21148    ///
21149    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21150    #[serde(skip_serializing_if = "Option::is_none")]
21151    pub setup_future_usage:
21152        Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
21153    /// Controls when Stripe will attempt to debit the funds from the customer's account.
21154    /// The date must be a string in YYYY-MM-DD format.
21155    /// The date must be in the future and between 3 and 15 calendar days from now.
21156    #[serde(skip_serializing_if = "Option::is_none")]
21157    pub target_date: Option<String>,
21158}
21159impl UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
21160    pub fn new() -> Self {
21161        Self { mandate_options: None, setup_future_usage: None, target_date: None }
21162    }
21163}
21164impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
21165    fn default() -> Self {
21166        Self::new()
21167    }
21168}
21169/// Additional fields for Mandate creation
21170#[derive(Clone, Debug, serde::Serialize)]
21171pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
21172    /// Prefix used to generate the Mandate reference.
21173    /// Must be at most 12 characters long.
21174    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
21175    /// Cannot begin with 'STRIPE'.
21176    #[serde(skip_serializing_if = "Option::is_none")]
21177    pub reference_prefix: Option<String>,
21178}
21179impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
21180    pub fn new() -> Self {
21181        Self { reference_prefix: None }
21182    }
21183}
21184impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
21185    fn default() -> Self {
21186        Self::new()
21187    }
21188}
21189/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21190///
21191/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21192/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21193///
21194/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21195///
21196/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21197///
21198/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21199#[derive(Copy, Clone, Eq, PartialEq)]
21200pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21201    None,
21202    OffSession,
21203    OnSession,
21204}
21205impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21206    pub fn as_str(self) -> &'static str {
21207        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
21208        match self {
21209            None => "none",
21210            OffSession => "off_session",
21211            OnSession => "on_session",
21212        }
21213    }
21214}
21215
21216impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21217    type Err = stripe_types::StripeParseError;
21218    fn from_str(s: &str) -> Result<Self, Self::Err> {
21219        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
21220        match s {
21221            "none" => Ok(None),
21222            "off_session" => Ok(OffSession),
21223            "on_session" => Ok(OnSession),
21224            _ => Err(stripe_types::StripeParseError),
21225        }
21226    }
21227}
21228impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21229    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21230        f.write_str(self.as_str())
21231    }
21232}
21233
21234impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21235    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21236        f.write_str(self.as_str())
21237    }
21238}
21239impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
21240    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21241    where
21242        S: serde::Serializer,
21243    {
21244        serializer.serialize_str(self.as_str())
21245    }
21246}
21247#[cfg(feature = "deserialize")]
21248impl<'de> serde::Deserialize<'de>
21249    for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
21250{
21251    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21252        use std::str::FromStr;
21253        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21254        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
21255    }
21256}
21257/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
21258#[derive(Copy, Clone, Debug, serde::Serialize)]
21259pub struct UpdatePaymentIntentPaymentMethodOptionsSofort {
21260    /// Language shown to the payer on redirect.
21261    #[serde(skip_serializing_if = "Option::is_none")]
21262    pub preferred_language: Option<UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
21263    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21264    ///
21265    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21266    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21267    ///
21268    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21269    ///
21270    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21271    ///
21272    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21273    #[serde(skip_serializing_if = "Option::is_none")]
21274    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
21275}
21276impl UpdatePaymentIntentPaymentMethodOptionsSofort {
21277    pub fn new() -> Self {
21278        Self { preferred_language: None, setup_future_usage: None }
21279    }
21280}
21281impl Default for UpdatePaymentIntentPaymentMethodOptionsSofort {
21282    fn default() -> Self {
21283        Self::new()
21284    }
21285}
21286/// Language shown to the payer on redirect.
21287#[derive(Copy, Clone, Eq, PartialEq)]
21288pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21289    De,
21290    En,
21291    Es,
21292    Fr,
21293    It,
21294    Nl,
21295    Pl,
21296}
21297impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21298    pub fn as_str(self) -> &'static str {
21299        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
21300        match self {
21301            De => "de",
21302            En => "en",
21303            Es => "es",
21304            Fr => "fr",
21305            It => "it",
21306            Nl => "nl",
21307            Pl => "pl",
21308        }
21309    }
21310}
21311
21312impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21313    type Err = stripe_types::StripeParseError;
21314    fn from_str(s: &str) -> Result<Self, Self::Err> {
21315        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
21316        match s {
21317            "de" => Ok(De),
21318            "en" => Ok(En),
21319            "es" => Ok(Es),
21320            "fr" => Ok(Fr),
21321            "it" => Ok(It),
21322            "nl" => Ok(Nl),
21323            "pl" => Ok(Pl),
21324            _ => Err(stripe_types::StripeParseError),
21325        }
21326    }
21327}
21328impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21329    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21330        f.write_str(self.as_str())
21331    }
21332}
21333
21334impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21336        f.write_str(self.as_str())
21337    }
21338}
21339impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
21340    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21341    where
21342        S: serde::Serializer,
21343    {
21344        serializer.serialize_str(self.as_str())
21345    }
21346}
21347#[cfg(feature = "deserialize")]
21348impl<'de> serde::Deserialize<'de>
21349    for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
21350{
21351    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21352        use std::str::FromStr;
21353        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21354        Self::from_str(&s).map_err(|_| {
21355            serde::de::Error::custom(
21356                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
21357            )
21358        })
21359    }
21360}
21361/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21362///
21363/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21364/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21365///
21366/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21367///
21368/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21369///
21370/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21371#[derive(Copy, Clone, Eq, PartialEq)]
21372pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21373    None,
21374    OffSession,
21375}
21376impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21377    pub fn as_str(self) -> &'static str {
21378        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
21379        match self {
21380            None => "none",
21381            OffSession => "off_session",
21382        }
21383    }
21384}
21385
21386impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21387    type Err = stripe_types::StripeParseError;
21388    fn from_str(s: &str) -> Result<Self, Self::Err> {
21389        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
21390        match s {
21391            "none" => Ok(None),
21392            "off_session" => Ok(OffSession),
21393            _ => Err(stripe_types::StripeParseError),
21394        }
21395    }
21396}
21397impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21398    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21399        f.write_str(self.as_str())
21400    }
21401}
21402
21403impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21404    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21405        f.write_str(self.as_str())
21406    }
21407}
21408impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
21409    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21410    where
21411        S: serde::Serializer,
21412    {
21413        serializer.serialize_str(self.as_str())
21414    }
21415}
21416#[cfg(feature = "deserialize")]
21417impl<'de> serde::Deserialize<'de>
21418    for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
21419{
21420    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21421        use std::str::FromStr;
21422        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21423        Self::from_str(&s).map_err(|_| {
21424            serde::de::Error::custom(
21425                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
21426            )
21427        })
21428    }
21429}
21430/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
21431#[derive(Clone, Debug, serde::Serialize)]
21432pub struct UpdatePaymentIntentPaymentMethodOptionsSwish {
21433    /// A reference for this payment to be displayed in the Swish app.
21434    #[serde(skip_serializing_if = "Option::is_none")]
21435    pub reference: Option<String>,
21436    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21437    ///
21438    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21439    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21440    ///
21441    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21442    ///
21443    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21444    ///
21445    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21446    #[serde(skip_serializing_if = "Option::is_none")]
21447    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
21448}
21449impl UpdatePaymentIntentPaymentMethodOptionsSwish {
21450    pub fn new() -> Self {
21451        Self { reference: None, setup_future_usage: None }
21452    }
21453}
21454impl Default for UpdatePaymentIntentPaymentMethodOptionsSwish {
21455    fn default() -> Self {
21456        Self::new()
21457    }
21458}
21459/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21460///
21461/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21462/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21463///
21464/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21465///
21466/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21467///
21468/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21469#[derive(Copy, Clone, Eq, PartialEq)]
21470pub enum UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21471    None,
21472}
21473impl UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21474    pub fn as_str(self) -> &'static str {
21475        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
21476        match self {
21477            None => "none",
21478        }
21479    }
21480}
21481
21482impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21483    type Err = stripe_types::StripeParseError;
21484    fn from_str(s: &str) -> Result<Self, Self::Err> {
21485        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
21486        match s {
21487            "none" => Ok(None),
21488            _ => Err(stripe_types::StripeParseError),
21489        }
21490    }
21491}
21492impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21494        f.write_str(self.as_str())
21495    }
21496}
21497
21498impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21499    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21500        f.write_str(self.as_str())
21501    }
21502}
21503impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21504    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21505    where
21506        S: serde::Serializer,
21507    {
21508        serializer.serialize_str(self.as_str())
21509    }
21510}
21511#[cfg(feature = "deserialize")]
21512impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
21513    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21514        use std::str::FromStr;
21515        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21516        Self::from_str(&s).map_err(|_| {
21517            serde::de::Error::custom(
21518                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
21519            )
21520        })
21521    }
21522}
21523/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
21524#[derive(Copy, Clone, Debug, serde::Serialize)]
21525pub struct UpdatePaymentIntentPaymentMethodOptionsTwint {
21526    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21527    ///
21528    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21529    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21530    ///
21531    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21532    ///
21533    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21534    ///
21535    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21536    #[serde(skip_serializing_if = "Option::is_none")]
21537    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
21538}
21539impl UpdatePaymentIntentPaymentMethodOptionsTwint {
21540    pub fn new() -> Self {
21541        Self { setup_future_usage: None }
21542    }
21543}
21544impl Default for UpdatePaymentIntentPaymentMethodOptionsTwint {
21545    fn default() -> Self {
21546        Self::new()
21547    }
21548}
21549/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21550///
21551/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21552/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21553///
21554/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21555///
21556/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21557///
21558/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21559#[derive(Copy, Clone, Eq, PartialEq)]
21560pub enum UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21561    None,
21562}
21563impl UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21564    pub fn as_str(self) -> &'static str {
21565        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
21566        match self {
21567            None => "none",
21568        }
21569    }
21570}
21571
21572impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21573    type Err = stripe_types::StripeParseError;
21574    fn from_str(s: &str) -> Result<Self, Self::Err> {
21575        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
21576        match s {
21577            "none" => Ok(None),
21578            _ => Err(stripe_types::StripeParseError),
21579        }
21580    }
21581}
21582impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21584        f.write_str(self.as_str())
21585    }
21586}
21587
21588impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21589    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21590        f.write_str(self.as_str())
21591    }
21592}
21593impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21594    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21595    where
21596        S: serde::Serializer,
21597    {
21598        serializer.serialize_str(self.as_str())
21599    }
21600}
21601#[cfg(feature = "deserialize")]
21602impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
21603    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21604        use std::str::FromStr;
21605        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21606        Self::from_str(&s).map_err(|_| {
21607            serde::de::Error::custom(
21608                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
21609            )
21610        })
21611    }
21612}
21613/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
21614#[derive(Clone, Debug, serde::Serialize)]
21615pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21616    /// Additional fields for Financial Connections Session creation
21617    #[serde(skip_serializing_if = "Option::is_none")]
21618    pub financial_connections:
21619        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
21620    /// Additional fields for Mandate creation
21621    #[serde(skip_serializing_if = "Option::is_none")]
21622    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
21623    /// Additional fields for network related functions
21624    #[serde(skip_serializing_if = "Option::is_none")]
21625    pub networks: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
21626    /// Preferred transaction settlement speed
21627    #[serde(skip_serializing_if = "Option::is_none")]
21628    pub preferred_settlement_speed:
21629        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
21630    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21631    ///
21632    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21633    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21634    ///
21635    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21636    ///
21637    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21638    ///
21639    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21640    #[serde(skip_serializing_if = "Option::is_none")]
21641    pub setup_future_usage:
21642        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
21643    /// Controls when Stripe will attempt to debit the funds from the customer's account.
21644    /// The date must be a string in YYYY-MM-DD format.
21645    /// The date must be in the future and between 3 and 15 calendar days from now.
21646    #[serde(skip_serializing_if = "Option::is_none")]
21647    pub target_date: Option<String>,
21648    /// Bank account verification method.
21649    #[serde(skip_serializing_if = "Option::is_none")]
21650    pub verification_method:
21651        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
21652}
21653impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21654    pub fn new() -> Self {
21655        Self {
21656            financial_connections: None,
21657            mandate_options: None,
21658            networks: None,
21659            preferred_settlement_speed: None,
21660            setup_future_usage: None,
21661            target_date: None,
21662            verification_method: None,
21663        }
21664    }
21665}
21666impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
21667    fn default() -> Self {
21668        Self::new()
21669    }
21670}
21671/// Additional fields for Financial Connections Session creation
21672#[derive(Clone, Debug, serde::Serialize)]
21673pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21674    /// Provide filters for the linked accounts that the customer can select for the payment method.
21675    #[serde(skip_serializing_if = "Option::is_none")]
21676    pub filters:
21677        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
21678    /// The list of permissions to request.
21679    /// If this parameter is passed, the `payment_method` permission must be included.
21680    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
21681    #[serde(skip_serializing_if = "Option::is_none")]
21682    pub permissions: Option<
21683        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
21684    >,
21685    /// List of data features that you would like to retrieve upon account creation.
21686    #[serde(skip_serializing_if = "Option::is_none")]
21687    pub prefetch: Option<
21688        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
21689    >,
21690    /// For webview integrations only.
21691    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
21692    #[serde(skip_serializing_if = "Option::is_none")]
21693    pub return_url: Option<String>,
21694}
21695impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21696    pub fn new() -> Self {
21697        Self { filters: None, permissions: None, prefetch: None, return_url: None }
21698    }
21699}
21700impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
21701    fn default() -> Self {
21702        Self::new()
21703    }
21704}
21705/// Provide filters for the linked accounts that the customer can select for the payment method.
21706#[derive(Clone, Debug, serde::Serialize)]
21707pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21708        /// The account subcategories to use to filter for selectable accounts.
21709    /// Valid subcategories are `checking` and `savings`.
21710#[serde(skip_serializing_if = "Option::is_none")]
21711pub account_subcategories: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
21712
21713}
21714impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21715    pub fn new() -> Self {
21716        Self { account_subcategories: None }
21717    }
21718}
21719impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
21720    fn default() -> Self {
21721        Self::new()
21722    }
21723}
21724/// The account subcategories to use to filter for selectable accounts.
21725/// Valid subcategories are `checking` and `savings`.
21726#[derive(Copy, Clone, Eq, PartialEq)]
21727pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
21728{
21729    Checking,
21730    Savings,
21731}
21732impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21733    pub fn as_str(self) -> &'static str {
21734        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
21735        match self {
21736Checking => "checking",
21737Savings => "savings",
21738
21739        }
21740    }
21741}
21742
21743impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21744    type Err = stripe_types::StripeParseError;
21745    fn from_str(s: &str) -> Result<Self, Self::Err> {
21746        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
21747        match s {
21748    "checking" => Ok(Checking),
21749"savings" => Ok(Savings),
21750_ => Err(stripe_types::StripeParseError)
21751
21752        }
21753    }
21754}
21755impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21756    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21757        f.write_str(self.as_str())
21758    }
21759}
21760
21761impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21762    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21763        f.write_str(self.as_str())
21764    }
21765}
21766impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21767    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
21768        serializer.serialize_str(self.as_str())
21769    }
21770}
21771#[cfg(feature = "deserialize")]
21772impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
21773    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21774        use std::str::FromStr;
21775        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21776        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
21777    }
21778}
21779/// The list of permissions to request.
21780/// If this parameter is passed, the `payment_method` permission must be included.
21781/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
21782#[derive(Copy, Clone, Eq, PartialEq)]
21783pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
21784    Balances,
21785    Ownership,
21786    PaymentMethod,
21787    Transactions,
21788}
21789impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
21790    pub fn as_str(self) -> &'static str {
21791        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
21792        match self {
21793            Balances => "balances",
21794            Ownership => "ownership",
21795            PaymentMethod => "payment_method",
21796            Transactions => "transactions",
21797        }
21798    }
21799}
21800
21801impl std::str::FromStr
21802    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21803{
21804    type Err = stripe_types::StripeParseError;
21805    fn from_str(s: &str) -> Result<Self, Self::Err> {
21806        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
21807        match s {
21808            "balances" => Ok(Balances),
21809            "ownership" => Ok(Ownership),
21810            "payment_method" => Ok(PaymentMethod),
21811            "transactions" => Ok(Transactions),
21812            _ => Err(stripe_types::StripeParseError),
21813        }
21814    }
21815}
21816impl std::fmt::Display
21817    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21818{
21819    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21820        f.write_str(self.as_str())
21821    }
21822}
21823
21824impl std::fmt::Debug
21825    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21826{
21827    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21828        f.write_str(self.as_str())
21829    }
21830}
21831impl serde::Serialize
21832    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21833{
21834    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21835    where
21836        S: serde::Serializer,
21837    {
21838        serializer.serialize_str(self.as_str())
21839    }
21840}
21841#[cfg(feature = "deserialize")]
21842impl<'de> serde::Deserialize<'de>
21843    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
21844{
21845    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21846        use std::str::FromStr;
21847        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21848        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
21849    }
21850}
21851/// List of data features that you would like to retrieve upon account creation.
21852#[derive(Copy, Clone, Eq, PartialEq)]
21853pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
21854    Balances,
21855    Ownership,
21856    Transactions,
21857}
21858impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
21859    pub fn as_str(self) -> &'static str {
21860        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
21861        match self {
21862            Balances => "balances",
21863            Ownership => "ownership",
21864            Transactions => "transactions",
21865        }
21866    }
21867}
21868
21869impl std::str::FromStr
21870    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21871{
21872    type Err = stripe_types::StripeParseError;
21873    fn from_str(s: &str) -> Result<Self, Self::Err> {
21874        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
21875        match s {
21876            "balances" => Ok(Balances),
21877            "ownership" => Ok(Ownership),
21878            "transactions" => Ok(Transactions),
21879            _ => Err(stripe_types::StripeParseError),
21880        }
21881    }
21882}
21883impl std::fmt::Display
21884    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21885{
21886    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21887        f.write_str(self.as_str())
21888    }
21889}
21890
21891impl std::fmt::Debug
21892    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21893{
21894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21895        f.write_str(self.as_str())
21896    }
21897}
21898impl serde::Serialize
21899    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21900{
21901    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21902    where
21903        S: serde::Serializer,
21904    {
21905        serializer.serialize_str(self.as_str())
21906    }
21907}
21908#[cfg(feature = "deserialize")]
21909impl<'de> serde::Deserialize<'de>
21910    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
21911{
21912    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21913        use std::str::FromStr;
21914        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21915        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
21916    }
21917}
21918/// Additional fields for Mandate creation
21919#[derive(Copy, Clone, Debug, serde::Serialize)]
21920pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
21921    /// The method used to collect offline mandate customer acceptance.
21922    #[serde(skip_serializing_if = "Option::is_none")]
21923    pub collection_method:
21924        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
21925}
21926impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
21927    pub fn new() -> Self {
21928        Self { collection_method: None }
21929    }
21930}
21931impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
21932    fn default() -> Self {
21933        Self::new()
21934    }
21935}
21936/// The method used to collect offline mandate customer acceptance.
21937#[derive(Copy, Clone, Eq, PartialEq)]
21938pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
21939    Paper,
21940}
21941impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
21942    pub fn as_str(self) -> &'static str {
21943        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
21944        match self {
21945            Paper => "paper",
21946        }
21947    }
21948}
21949
21950impl std::str::FromStr
21951    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21952{
21953    type Err = stripe_types::StripeParseError;
21954    fn from_str(s: &str) -> Result<Self, Self::Err> {
21955        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
21956        match s {
21957            "paper" => Ok(Paper),
21958            _ => Err(stripe_types::StripeParseError),
21959        }
21960    }
21961}
21962impl std::fmt::Display
21963    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21964{
21965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21966        f.write_str(self.as_str())
21967    }
21968}
21969
21970impl std::fmt::Debug
21971    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21972{
21973    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21974        f.write_str(self.as_str())
21975    }
21976}
21977impl serde::Serialize
21978    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21979{
21980    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21981    where
21982        S: serde::Serializer,
21983    {
21984        serializer.serialize_str(self.as_str())
21985    }
21986}
21987#[cfg(feature = "deserialize")]
21988impl<'de> serde::Deserialize<'de>
21989    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
21990{
21991    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21992        use std::str::FromStr;
21993        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21994        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
21995    }
21996}
21997/// Additional fields for network related functions
21998#[derive(Clone, Debug, serde::Serialize)]
21999pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
22000    /// Triggers validations to run across the selected networks
22001    #[serde(skip_serializing_if = "Option::is_none")]
22002    pub requested:
22003        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
22004}
22005impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
22006    pub fn new() -> Self {
22007        Self { requested: None }
22008    }
22009}
22010impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
22011    fn default() -> Self {
22012        Self::new()
22013    }
22014}
22015/// Triggers validations to run across the selected networks
22016#[derive(Copy, Clone, Eq, PartialEq)]
22017pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22018    Ach,
22019    UsDomesticWire,
22020}
22021impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22022    pub fn as_str(self) -> &'static str {
22023        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
22024        match self {
22025            Ach => "ach",
22026            UsDomesticWire => "us_domestic_wire",
22027        }
22028    }
22029}
22030
22031impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22032    type Err = stripe_types::StripeParseError;
22033    fn from_str(s: &str) -> Result<Self, Self::Err> {
22034        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
22035        match s {
22036            "ach" => Ok(Ach),
22037            "us_domestic_wire" => Ok(UsDomesticWire),
22038            _ => Err(stripe_types::StripeParseError),
22039        }
22040    }
22041}
22042impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22043    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22044        f.write_str(self.as_str())
22045    }
22046}
22047
22048impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22050        f.write_str(self.as_str())
22051    }
22052}
22053impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
22054    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22055    where
22056        S: serde::Serializer,
22057    {
22058        serializer.serialize_str(self.as_str())
22059    }
22060}
22061#[cfg(feature = "deserialize")]
22062impl<'de> serde::Deserialize<'de>
22063    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
22064{
22065    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22066        use std::str::FromStr;
22067        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22068        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
22069    }
22070}
22071/// Preferred transaction settlement speed
22072#[derive(Copy, Clone, Eq, PartialEq)]
22073pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
22074    Fastest,
22075    Standard,
22076}
22077impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
22078    pub fn as_str(self) -> &'static str {
22079        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
22080        match self {
22081            Fastest => "fastest",
22082            Standard => "standard",
22083        }
22084    }
22085}
22086
22087impl std::str::FromStr
22088    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22089{
22090    type Err = stripe_types::StripeParseError;
22091    fn from_str(s: &str) -> Result<Self, Self::Err> {
22092        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
22093        match s {
22094            "fastest" => Ok(Fastest),
22095            "standard" => Ok(Standard),
22096            _ => Err(stripe_types::StripeParseError),
22097        }
22098    }
22099}
22100impl std::fmt::Display
22101    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22102{
22103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22104        f.write_str(self.as_str())
22105    }
22106}
22107
22108impl std::fmt::Debug
22109    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22110{
22111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22112        f.write_str(self.as_str())
22113    }
22114}
22115impl serde::Serialize
22116    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22117{
22118    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22119    where
22120        S: serde::Serializer,
22121    {
22122        serializer.serialize_str(self.as_str())
22123    }
22124}
22125#[cfg(feature = "deserialize")]
22126impl<'de> serde::Deserialize<'de>
22127    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
22128{
22129    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22130        use std::str::FromStr;
22131        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22132        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
22133    }
22134}
22135/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22136///
22137/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22138/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22139///
22140/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22141///
22142/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22143///
22144/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22145#[derive(Copy, Clone, Eq, PartialEq)]
22146pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22147    None,
22148    OffSession,
22149    OnSession,
22150}
22151impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22152    pub fn as_str(self) -> &'static str {
22153        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
22154        match self {
22155            None => "none",
22156            OffSession => "off_session",
22157            OnSession => "on_session",
22158        }
22159    }
22160}
22161
22162impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22163    type Err = stripe_types::StripeParseError;
22164    fn from_str(s: &str) -> Result<Self, Self::Err> {
22165        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
22166        match s {
22167            "none" => Ok(None),
22168            "off_session" => Ok(OffSession),
22169            "on_session" => Ok(OnSession),
22170            _ => Err(stripe_types::StripeParseError),
22171        }
22172    }
22173}
22174impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22175    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22176        f.write_str(self.as_str())
22177    }
22178}
22179
22180impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22182        f.write_str(self.as_str())
22183    }
22184}
22185impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
22186    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22187    where
22188        S: serde::Serializer,
22189    {
22190        serializer.serialize_str(self.as_str())
22191    }
22192}
22193#[cfg(feature = "deserialize")]
22194impl<'de> serde::Deserialize<'de>
22195    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
22196{
22197    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22198        use std::str::FromStr;
22199        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22200        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
22201    }
22202}
22203/// Bank account verification method.
22204#[derive(Copy, Clone, Eq, PartialEq)]
22205pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22206    Automatic,
22207    Instant,
22208    Microdeposits,
22209}
22210impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22211    pub fn as_str(self) -> &'static str {
22212        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
22213        match self {
22214            Automatic => "automatic",
22215            Instant => "instant",
22216            Microdeposits => "microdeposits",
22217        }
22218    }
22219}
22220
22221impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22222    type Err = stripe_types::StripeParseError;
22223    fn from_str(s: &str) -> Result<Self, Self::Err> {
22224        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
22225        match s {
22226            "automatic" => Ok(Automatic),
22227            "instant" => Ok(Instant),
22228            "microdeposits" => Ok(Microdeposits),
22229            _ => Err(stripe_types::StripeParseError),
22230        }
22231    }
22232}
22233impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22234    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22235        f.write_str(self.as_str())
22236    }
22237}
22238
22239impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22240    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22241        f.write_str(self.as_str())
22242    }
22243}
22244impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
22245    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22246    where
22247        S: serde::Serializer,
22248    {
22249        serializer.serialize_str(self.as_str())
22250    }
22251}
22252#[cfg(feature = "deserialize")]
22253impl<'de> serde::Deserialize<'de>
22254    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
22255{
22256    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22257        use std::str::FromStr;
22258        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22259        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
22260    }
22261}
22262/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
22263#[derive(Clone, Debug, serde::Serialize)]
22264pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay {
22265    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
22266    #[serde(skip_serializing_if = "Option::is_none")]
22267    pub app_id: Option<String>,
22268    /// The client type that the end customer will pay from
22269    #[serde(skip_serializing_if = "Option::is_none")]
22270    pub client: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPayClient>,
22271    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22272    ///
22273    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22274    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22275    ///
22276    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22277    ///
22278    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22279    ///
22280    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22281    #[serde(skip_serializing_if = "Option::is_none")]
22282    pub setup_future_usage:
22283        Option<UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
22284}
22285impl UpdatePaymentIntentPaymentMethodOptionsWechatPay {
22286    pub fn new() -> Self {
22287        Self { app_id: None, client: None, setup_future_usage: None }
22288    }
22289}
22290impl Default for UpdatePaymentIntentPaymentMethodOptionsWechatPay {
22291    fn default() -> Self {
22292        Self::new()
22293    }
22294}
22295/// The client type that the end customer will pay from
22296#[derive(Copy, Clone, Eq, PartialEq)]
22297pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22298    Android,
22299    Ios,
22300    Web,
22301}
22302impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22303    pub fn as_str(self) -> &'static str {
22304        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
22305        match self {
22306            Android => "android",
22307            Ios => "ios",
22308            Web => "web",
22309        }
22310    }
22311}
22312
22313impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22314    type Err = stripe_types::StripeParseError;
22315    fn from_str(s: &str) -> Result<Self, Self::Err> {
22316        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
22317        match s {
22318            "android" => Ok(Android),
22319            "ios" => Ok(Ios),
22320            "web" => Ok(Web),
22321            _ => Err(stripe_types::StripeParseError),
22322        }
22323    }
22324}
22325impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22326    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22327        f.write_str(self.as_str())
22328    }
22329}
22330
22331impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22332    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22333        f.write_str(self.as_str())
22334    }
22335}
22336impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22337    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22338    where
22339        S: serde::Serializer,
22340    {
22341        serializer.serialize_str(self.as_str())
22342    }
22343}
22344#[cfg(feature = "deserialize")]
22345impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
22346    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22347        use std::str::FromStr;
22348        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22349        Self::from_str(&s).map_err(|_| {
22350            serde::de::Error::custom(
22351                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient",
22352            )
22353        })
22354    }
22355}
22356/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22357///
22358/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22359/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22360///
22361/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22362///
22363/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22364///
22365/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22366#[derive(Copy, Clone, Eq, PartialEq)]
22367pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22368    None,
22369}
22370impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22371    pub fn as_str(self) -> &'static str {
22372        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
22373        match self {
22374            None => "none",
22375        }
22376    }
22377}
22378
22379impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22380    type Err = stripe_types::StripeParseError;
22381    fn from_str(s: &str) -> Result<Self, Self::Err> {
22382        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
22383        match s {
22384            "none" => Ok(None),
22385            _ => Err(stripe_types::StripeParseError),
22386        }
22387    }
22388}
22389impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22390    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22391        f.write_str(self.as_str())
22392    }
22393}
22394
22395impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22396    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22397        f.write_str(self.as_str())
22398    }
22399}
22400impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
22401    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22402    where
22403        S: serde::Serializer,
22404    {
22405        serializer.serialize_str(self.as_str())
22406    }
22407}
22408#[cfg(feature = "deserialize")]
22409impl<'de> serde::Deserialize<'de>
22410    for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
22411{
22412    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22413        use std::str::FromStr;
22414        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22415        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
22416    }
22417}
22418/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
22419#[derive(Copy, Clone, Debug, serde::Serialize)]
22420pub struct UpdatePaymentIntentPaymentMethodOptionsZip {
22421    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22422    ///
22423    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22424    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22425    ///
22426    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22427    ///
22428    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22429    ///
22430    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22431    #[serde(skip_serializing_if = "Option::is_none")]
22432    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
22433}
22434impl UpdatePaymentIntentPaymentMethodOptionsZip {
22435    pub fn new() -> Self {
22436        Self { setup_future_usage: None }
22437    }
22438}
22439impl Default for UpdatePaymentIntentPaymentMethodOptionsZip {
22440    fn default() -> Self {
22441        Self::new()
22442    }
22443}
22444/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22445///
22446/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22447/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22448///
22449/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22450///
22451/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22452///
22453/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22454#[derive(Copy, Clone, Eq, PartialEq)]
22455pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22456    None,
22457}
22458impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22459    pub fn as_str(self) -> &'static str {
22460        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
22461        match self {
22462            None => "none",
22463        }
22464    }
22465}
22466
22467impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22468    type Err = stripe_types::StripeParseError;
22469    fn from_str(s: &str) -> Result<Self, Self::Err> {
22470        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
22471        match s {
22472            "none" => Ok(None),
22473            _ => Err(stripe_types::StripeParseError),
22474        }
22475    }
22476}
22477impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22479        f.write_str(self.as_str())
22480    }
22481}
22482
22483impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22484    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22485        f.write_str(self.as_str())
22486    }
22487}
22488impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22489    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22490    where
22491        S: serde::Serializer,
22492    {
22493        serializer.serialize_str(self.as_str())
22494    }
22495}
22496#[cfg(feature = "deserialize")]
22497impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
22498    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22499        use std::str::FromStr;
22500        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22501        Self::from_str(&s).map_err(|_| {
22502            serde::de::Error::custom(
22503                "Unknown value for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
22504            )
22505        })
22506    }
22507}
22508/// Shipping information for this PaymentIntent.
22509#[derive(Clone, Debug, serde::Serialize)]
22510pub struct UpdatePaymentIntentShipping {
22511    /// Shipping address.
22512    pub address: UpdatePaymentIntentShippingAddress,
22513    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
22514    #[serde(skip_serializing_if = "Option::is_none")]
22515    pub carrier: Option<String>,
22516    /// Recipient name.
22517    pub name: String,
22518    /// Recipient phone (including extension).
22519    #[serde(skip_serializing_if = "Option::is_none")]
22520    pub phone: Option<String>,
22521    /// The tracking number for a physical product, obtained from the delivery service.
22522    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
22523    #[serde(skip_serializing_if = "Option::is_none")]
22524    pub tracking_number: Option<String>,
22525}
22526impl UpdatePaymentIntentShipping {
22527    pub fn new(
22528        address: impl Into<UpdatePaymentIntentShippingAddress>,
22529        name: impl Into<String>,
22530    ) -> Self {
22531        Self {
22532            address: address.into(),
22533            carrier: None,
22534            name: name.into(),
22535            phone: None,
22536            tracking_number: None,
22537        }
22538    }
22539}
22540/// Shipping address.
22541#[derive(Clone, Debug, serde::Serialize)]
22542pub struct UpdatePaymentIntentShippingAddress {
22543    /// City, district, suburb, town, or village.
22544    #[serde(skip_serializing_if = "Option::is_none")]
22545    pub city: Option<String>,
22546    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
22547    #[serde(skip_serializing_if = "Option::is_none")]
22548    pub country: Option<String>,
22549    /// Address line 1, such as the street, PO Box, or company name.
22550    #[serde(skip_serializing_if = "Option::is_none")]
22551    pub line1: Option<String>,
22552    /// Address line 2, such as the apartment, suite, unit, or building.
22553    #[serde(skip_serializing_if = "Option::is_none")]
22554    pub line2: Option<String>,
22555    /// ZIP or postal code.
22556    #[serde(skip_serializing_if = "Option::is_none")]
22557    pub postal_code: Option<String>,
22558    /// State, county, province, or region.
22559    #[serde(skip_serializing_if = "Option::is_none")]
22560    pub state: Option<String>,
22561}
22562impl UpdatePaymentIntentShippingAddress {
22563    pub fn new() -> Self {
22564        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
22565    }
22566}
22567impl Default for UpdatePaymentIntentShippingAddress {
22568    fn default() -> Self {
22569        Self::new()
22570    }
22571}
22572/// Use this parameter to automatically create a Transfer when the payment succeeds.
22573/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22574#[derive(Copy, Clone, Debug, serde::Serialize)]
22575pub struct UpdatePaymentIntentTransferData {
22576    /// The amount that will be transferred automatically when a charge succeeds.
22577    #[serde(skip_serializing_if = "Option::is_none")]
22578    pub amount: Option<i64>,
22579}
22580impl UpdatePaymentIntentTransferData {
22581    pub fn new() -> Self {
22582        Self { amount: None }
22583    }
22584}
22585impl Default for UpdatePaymentIntentTransferData {
22586    fn default() -> Self {
22587        Self::new()
22588    }
22589}
22590/// Updates properties on a PaymentIntent object without confirming.
22591///
22592/// Depending on which properties you update, you might need to confirm the
22593/// PaymentIntent again. For example, updating the `payment_method`
22594/// always requires you to confirm the PaymentIntent again. If you prefer to
22595/// update and confirm at the same time, we recommend updating properties through
22596/// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
22597#[derive(Clone, Debug, serde::Serialize)]
22598pub struct UpdatePaymentIntent {
22599    inner: UpdatePaymentIntentBuilder,
22600    intent: stripe_shared::PaymentIntentId,
22601}
22602impl UpdatePaymentIntent {
22603    /// Construct a new `UpdatePaymentIntent`.
22604    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22605        Self { intent: intent.into(), inner: UpdatePaymentIntentBuilder::new() }
22606    }
22607    /// Amount intended to be collected by this PaymentIntent.
22608    /// 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).
22609    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
22610    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
22611    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
22612        self.inner.amount = Some(amount.into());
22613        self
22614    }
22615    /// Provides industry-specific information about the amount.
22616    pub fn amount_details(
22617        mut self,
22618        amount_details: impl Into<UpdatePaymentIntentAmountDetails>,
22619    ) -> Self {
22620        self.inner.amount_details = Some(amount_details.into());
22621        self
22622    }
22623    /// 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.
22624    /// The amount of the application fee collected will be capped at the total amount captured.
22625    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22626    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
22627        self.inner.application_fee_amount = Some(application_fee_amount.into());
22628        self
22629    }
22630    /// Controls when the funds will be captured from the customer's account.
22631    pub fn capture_method(
22632        mut self,
22633        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
22634    ) -> Self {
22635        self.inner.capture_method = Some(capture_method.into());
22636        self
22637    }
22638    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
22639    /// Must be a [supported currency](https://stripe.com/docs/currencies).
22640    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
22641        self.inner.currency = Some(currency.into());
22642        self
22643    }
22644    /// ID of the Customer this PaymentIntent belongs to, if one exists.
22645    ///
22646    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
22647    ///
22648    /// 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.
22649    /// 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.
22650    pub fn customer(mut self, customer: impl Into<String>) -> Self {
22651        self.inner.customer = Some(customer.into());
22652        self
22653    }
22654    /// An arbitrary string attached to the object. Often useful for displaying to users.
22655    pub fn description(mut self, description: impl Into<String>) -> Self {
22656        self.inner.description = Some(description.into());
22657        self
22658    }
22659    /// The list of payment method types to exclude from use with this payment.
22660    pub fn excluded_payment_method_types(
22661        mut self,
22662        excluded_payment_method_types: impl Into<
22663            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
22664        >,
22665    ) -> Self {
22666        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
22667        self
22668    }
22669    /// Specifies which fields in the response should be expanded.
22670    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22671        self.inner.expand = Some(expand.into());
22672        self
22673    }
22674    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
22675    /// This can be useful for storing additional information about the object in a structured format.
22676    /// Individual keys can be unset by posting an empty value to them.
22677    /// All keys can be unset by posting an empty value to `metadata`.
22678    pub fn metadata(
22679        mut self,
22680        metadata: impl Into<std::collections::HashMap<String, String>>,
22681    ) -> Self {
22682        self.inner.metadata = Some(metadata.into());
22683        self
22684    }
22685    /// Provides industry-specific information about the charge.
22686    pub fn payment_details(
22687        mut self,
22688        payment_details: impl Into<UpdatePaymentIntentPaymentDetails>,
22689    ) -> Self {
22690        self.inner.payment_details = Some(payment_details.into());
22691        self
22692    }
22693    /// 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.
22694    /// To unset this field to null, pass in an empty string.
22695    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
22696        self.inner.payment_method = Some(payment_method.into());
22697        self
22698    }
22699    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
22700    pub fn payment_method_configuration(
22701        mut self,
22702        payment_method_configuration: impl Into<String>,
22703    ) -> Self {
22704        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
22705        self
22706    }
22707    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
22708    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
22709    /// property on the PaymentIntent.
22710    pub fn payment_method_data(
22711        mut self,
22712        payment_method_data: impl Into<UpdatePaymentIntentPaymentMethodData>,
22713    ) -> Self {
22714        self.inner.payment_method_data = Some(payment_method_data.into());
22715        self
22716    }
22717    /// Payment-method-specific configuration for this PaymentIntent.
22718    pub fn payment_method_options(
22719        mut self,
22720        payment_method_options: impl Into<UpdatePaymentIntentPaymentMethodOptions>,
22721    ) -> Self {
22722        self.inner.payment_method_options = Some(payment_method_options.into());
22723        self
22724    }
22725    /// The list of payment method types (for example, card) that this PaymentIntent can use.
22726    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
22727    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
22728    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
22729        self.inner.payment_method_types = Some(payment_method_types.into());
22730        self
22731    }
22732    /// Email address that the receipt for the resulting payment will be sent to.
22733    /// 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).
22734    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
22735        self.inner.receipt_email = Some(receipt_email.into());
22736        self
22737    }
22738    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22739    ///
22740    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22741    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22742    ///
22743    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22744    ///
22745    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22746    ///
22747    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22748    pub fn setup_future_usage(
22749        mut self,
22750        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
22751    ) -> Self {
22752        self.inner.setup_future_usage = Some(setup_future_usage.into());
22753        self
22754    }
22755    /// Shipping information for this PaymentIntent.
22756    pub fn shipping(mut self, shipping: impl Into<UpdatePaymentIntentShipping>) -> Self {
22757        self.inner.shipping = Some(shipping.into());
22758        self
22759    }
22760    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
22761    /// This value overrides the account's default statement descriptor.
22762    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
22763    ///
22764    /// Setting this value for a card charge returns an error.
22765    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
22766    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
22767        self.inner.statement_descriptor = Some(statement_descriptor.into());
22768        self
22769    }
22770    /// Provides information about a card charge.
22771    /// 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.
22772    pub fn statement_descriptor_suffix(
22773        mut self,
22774        statement_descriptor_suffix: impl Into<String>,
22775    ) -> Self {
22776        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
22777        self
22778    }
22779    /// Use this parameter to automatically create a Transfer when the payment succeeds.
22780    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22781    pub fn transfer_data(
22782        mut self,
22783        transfer_data: impl Into<UpdatePaymentIntentTransferData>,
22784    ) -> Self {
22785        self.inner.transfer_data = Some(transfer_data.into());
22786        self
22787    }
22788    /// A string that identifies the resulting payment as part of a group.
22789    /// You can only provide `transfer_group` if it hasn't been set.
22790    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
22791    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
22792        self.inner.transfer_group = Some(transfer_group.into());
22793        self
22794    }
22795}
22796impl UpdatePaymentIntent {
22797    /// Send the request and return the deserialized response.
22798    pub async fn send<C: StripeClient>(
22799        &self,
22800        client: &C,
22801    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22802        self.customize().send(client).await
22803    }
22804
22805    /// Send the request and return the deserialized response, blocking until completion.
22806    pub fn send_blocking<C: StripeBlockingClient>(
22807        &self,
22808        client: &C,
22809    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22810        self.customize().send_blocking(client)
22811    }
22812}
22813
22814impl StripeRequest for UpdatePaymentIntent {
22815    type Output = stripe_shared::PaymentIntent;
22816
22817    fn build(&self) -> RequestBuilder {
22818        let intent = &self.intent;
22819        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}"))
22820            .form(&self.inner)
22821    }
22822}
22823#[derive(Clone, Debug, serde::Serialize)]
22824struct ApplyCustomerBalancePaymentIntentBuilder {
22825    #[serde(skip_serializing_if = "Option::is_none")]
22826    amount: Option<i64>,
22827    #[serde(skip_serializing_if = "Option::is_none")]
22828    currency: Option<stripe_types::Currency>,
22829    #[serde(skip_serializing_if = "Option::is_none")]
22830    expand: Option<Vec<String>>,
22831}
22832impl ApplyCustomerBalancePaymentIntentBuilder {
22833    fn new() -> Self {
22834        Self { amount: None, currency: None, expand: None }
22835    }
22836}
22837/// Manually reconcile the remaining amount for a `customer_balance` PaymentIntent.
22838#[derive(Clone, Debug, serde::Serialize)]
22839pub struct ApplyCustomerBalancePaymentIntent {
22840    inner: ApplyCustomerBalancePaymentIntentBuilder,
22841    intent: stripe_shared::PaymentIntentId,
22842}
22843impl ApplyCustomerBalancePaymentIntent {
22844    /// Construct a new `ApplyCustomerBalancePaymentIntent`.
22845    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22846        Self { intent: intent.into(), inner: ApplyCustomerBalancePaymentIntentBuilder::new() }
22847    }
22848    /// Amount that you intend to apply to this PaymentIntent from the customer’s cash balance.
22849    /// If the PaymentIntent was created by an Invoice, the full amount of the PaymentIntent is applied regardless of this parameter.
22850    ///
22851    /// 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).
22852    /// The maximum amount is the amount of the PaymentIntent.
22853    ///
22854    /// When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent.
22855    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
22856        self.inner.amount = Some(amount.into());
22857        self
22858    }
22859    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
22860    /// Must be a [supported currency](https://stripe.com/docs/currencies).
22861    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
22862        self.inner.currency = Some(currency.into());
22863        self
22864    }
22865    /// Specifies which fields in the response should be expanded.
22866    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
22867        self.inner.expand = Some(expand.into());
22868        self
22869    }
22870}
22871impl ApplyCustomerBalancePaymentIntent {
22872    /// Send the request and return the deserialized response.
22873    pub async fn send<C: StripeClient>(
22874        &self,
22875        client: &C,
22876    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22877        self.customize().send(client).await
22878    }
22879
22880    /// Send the request and return the deserialized response, blocking until completion.
22881    pub fn send_blocking<C: StripeBlockingClient>(
22882        &self,
22883        client: &C,
22884    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
22885        self.customize().send_blocking(client)
22886    }
22887}
22888
22889impl StripeRequest for ApplyCustomerBalancePaymentIntent {
22890    type Output = stripe_shared::PaymentIntent;
22891
22892    fn build(&self) -> RequestBuilder {
22893        let intent = &self.intent;
22894        RequestBuilder::new(
22895            StripeMethod::Post,
22896            format!("/payment_intents/{intent}/apply_customer_balance"),
22897        )
22898        .form(&self.inner)
22899    }
22900}
22901#[derive(Clone, Debug, serde::Serialize)]
22902struct CancelPaymentIntentBuilder {
22903    #[serde(skip_serializing_if = "Option::is_none")]
22904    cancellation_reason: Option<CancelPaymentIntentCancellationReason>,
22905    #[serde(skip_serializing_if = "Option::is_none")]
22906    expand: Option<Vec<String>>,
22907}
22908impl CancelPaymentIntentBuilder {
22909    fn new() -> Self {
22910        Self { cancellation_reason: None, expand: None }
22911    }
22912}
22913/// Reason for canceling this PaymentIntent.
22914/// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
22915#[derive(Copy, Clone, Eq, PartialEq)]
22916pub enum CancelPaymentIntentCancellationReason {
22917    Abandoned,
22918    Duplicate,
22919    Fraudulent,
22920    RequestedByCustomer,
22921}
22922impl CancelPaymentIntentCancellationReason {
22923    pub fn as_str(self) -> &'static str {
22924        use CancelPaymentIntentCancellationReason::*;
22925        match self {
22926            Abandoned => "abandoned",
22927            Duplicate => "duplicate",
22928            Fraudulent => "fraudulent",
22929            RequestedByCustomer => "requested_by_customer",
22930        }
22931    }
22932}
22933
22934impl std::str::FromStr for CancelPaymentIntentCancellationReason {
22935    type Err = stripe_types::StripeParseError;
22936    fn from_str(s: &str) -> Result<Self, Self::Err> {
22937        use CancelPaymentIntentCancellationReason::*;
22938        match s {
22939            "abandoned" => Ok(Abandoned),
22940            "duplicate" => Ok(Duplicate),
22941            "fraudulent" => Ok(Fraudulent),
22942            "requested_by_customer" => Ok(RequestedByCustomer),
22943            _ => Err(stripe_types::StripeParseError),
22944        }
22945    }
22946}
22947impl std::fmt::Display for CancelPaymentIntentCancellationReason {
22948    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22949        f.write_str(self.as_str())
22950    }
22951}
22952
22953impl std::fmt::Debug for CancelPaymentIntentCancellationReason {
22954    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22955        f.write_str(self.as_str())
22956    }
22957}
22958impl serde::Serialize for CancelPaymentIntentCancellationReason {
22959    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22960    where
22961        S: serde::Serializer,
22962    {
22963        serializer.serialize_str(self.as_str())
22964    }
22965}
22966#[cfg(feature = "deserialize")]
22967impl<'de> serde::Deserialize<'de> for CancelPaymentIntentCancellationReason {
22968    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22969        use std::str::FromStr;
22970        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22971        Self::from_str(&s).map_err(|_| {
22972            serde::de::Error::custom("Unknown value for CancelPaymentIntentCancellationReason")
22973        })
22974    }
22975}
22976/// 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`.
22977///
22978///
22979/// After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error.
22980/// For PaymentIntents with a `status` of `requires_capture`, the remaining `amount_capturable` is automatically refunded.
22981///
22982///
22983/// You can’t cancel the PaymentIntent for a Checkout Session.
22984/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
22985#[derive(Clone, Debug, serde::Serialize)]
22986pub struct CancelPaymentIntent {
22987    inner: CancelPaymentIntentBuilder,
22988    intent: stripe_shared::PaymentIntentId,
22989}
22990impl CancelPaymentIntent {
22991    /// Construct a new `CancelPaymentIntent`.
22992    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
22993        Self { intent: intent.into(), inner: CancelPaymentIntentBuilder::new() }
22994    }
22995    /// Reason for canceling this PaymentIntent.
22996    /// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
22997    pub fn cancellation_reason(
22998        mut self,
22999        cancellation_reason: impl Into<CancelPaymentIntentCancellationReason>,
23000    ) -> Self {
23001        self.inner.cancellation_reason = Some(cancellation_reason.into());
23002        self
23003    }
23004    /// Specifies which fields in the response should be expanded.
23005    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
23006        self.inner.expand = Some(expand.into());
23007        self
23008    }
23009}
23010impl CancelPaymentIntent {
23011    /// Send the request and return the deserialized response.
23012    pub async fn send<C: StripeClient>(
23013        &self,
23014        client: &C,
23015    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23016        self.customize().send(client).await
23017    }
23018
23019    /// Send the request and return the deserialized response, blocking until completion.
23020    pub fn send_blocking<C: StripeBlockingClient>(
23021        &self,
23022        client: &C,
23023    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23024        self.customize().send_blocking(client)
23025    }
23026}
23027
23028impl StripeRequest for CancelPaymentIntent {
23029    type Output = stripe_shared::PaymentIntent;
23030
23031    fn build(&self) -> RequestBuilder {
23032        let intent = &self.intent;
23033        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/cancel"))
23034            .form(&self.inner)
23035    }
23036}
23037#[derive(Clone, Debug, serde::Serialize)]
23038struct CapturePaymentIntentBuilder {
23039    #[serde(skip_serializing_if = "Option::is_none")]
23040    amount_details: Option<CapturePaymentIntentAmountDetails>,
23041    #[serde(skip_serializing_if = "Option::is_none")]
23042    amount_to_capture: Option<i64>,
23043    #[serde(skip_serializing_if = "Option::is_none")]
23044    application_fee_amount: Option<i64>,
23045    #[serde(skip_serializing_if = "Option::is_none")]
23046    expand: Option<Vec<String>>,
23047    #[serde(skip_serializing_if = "Option::is_none")]
23048    final_capture: Option<bool>,
23049    #[serde(skip_serializing_if = "Option::is_none")]
23050    metadata: Option<std::collections::HashMap<String, String>>,
23051    #[serde(skip_serializing_if = "Option::is_none")]
23052    payment_details: Option<CapturePaymentIntentPaymentDetails>,
23053    #[serde(skip_serializing_if = "Option::is_none")]
23054    statement_descriptor: Option<String>,
23055    #[serde(skip_serializing_if = "Option::is_none")]
23056    statement_descriptor_suffix: Option<String>,
23057    #[serde(skip_serializing_if = "Option::is_none")]
23058    transfer_data: Option<CapturePaymentIntentTransferData>,
23059}
23060impl CapturePaymentIntentBuilder {
23061    fn new() -> Self {
23062        Self {
23063            amount_details: None,
23064            amount_to_capture: None,
23065            application_fee_amount: None,
23066            expand: None,
23067            final_capture: None,
23068            metadata: None,
23069            payment_details: None,
23070            statement_descriptor: None,
23071            statement_descriptor_suffix: None,
23072            transfer_data: None,
23073        }
23074    }
23075}
23076/// Provides industry-specific information about the amount.
23077#[derive(Clone, Debug, serde::Serialize)]
23078pub struct CapturePaymentIntentAmountDetails {
23079    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23080    /// An integer greater than 0.
23081    ///
23082    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
23083    #[serde(skip_serializing_if = "Option::is_none")]
23084    pub discount_amount: Option<i64>,
23085    /// A list of line items, each containing information about a product in the PaymentIntent.
23086    /// There is a maximum of 100 line items.
23087    #[serde(skip_serializing_if = "Option::is_none")]
23088    pub line_items: Option<Vec<CapturePaymentIntentAmountDetailsLineItems>>,
23089    /// Contains information about the shipping portion of the amount.
23090    #[serde(skip_serializing_if = "Option::is_none")]
23091    pub shipping: Option<AmountDetailsShippingParam>,
23092    /// Contains information about the tax portion of the amount.
23093    #[serde(skip_serializing_if = "Option::is_none")]
23094    pub tax: Option<AmountDetailsTaxParam>,
23095}
23096impl CapturePaymentIntentAmountDetails {
23097    pub fn new() -> Self {
23098        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
23099    }
23100}
23101impl Default for CapturePaymentIntentAmountDetails {
23102    fn default() -> Self {
23103        Self::new()
23104    }
23105}
23106/// A list of line items, each containing information about a product in the PaymentIntent.
23107/// There is a maximum of 100 line items.
23108#[derive(Clone, Debug, serde::Serialize)]
23109pub struct CapturePaymentIntentAmountDetailsLineItems {
23110    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23111    /// An integer greater than 0.
23112    ///
23113    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
23114    #[serde(skip_serializing_if = "Option::is_none")]
23115    pub discount_amount: Option<i64>,
23116    /// Payment method-specific information for line items.
23117    #[serde(skip_serializing_if = "Option::is_none")]
23118    pub payment_method_options:
23119        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
23120    /// The product code of the line item, such as an SKU.
23121    /// Required for L3 rates.
23122    /// At most 12 characters long.
23123    #[serde(skip_serializing_if = "Option::is_none")]
23124    pub product_code: Option<String>,
23125    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
23126    ///
23127    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
23128    /// For Paypal, this field is truncated to 127 characters.
23129    pub product_name: String,
23130    /// The quantity of items. Required for L3 rates. An integer greater than 0.
23131    pub quantity: u64,
23132    /// Contains information about the tax on the item.
23133    #[serde(skip_serializing_if = "Option::is_none")]
23134    pub tax: Option<AmountDetailsLineItemTaxParam>,
23135    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23136    /// Required for L3 rates.
23137    /// An integer greater than or equal to 0.
23138    pub unit_cost: i64,
23139    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
23140    #[serde(skip_serializing_if = "Option::is_none")]
23141    pub unit_of_measure: Option<String>,
23142}
23143impl CapturePaymentIntentAmountDetailsLineItems {
23144    pub fn new(
23145        product_name: impl Into<String>,
23146        quantity: impl Into<u64>,
23147        unit_cost: impl Into<i64>,
23148    ) -> Self {
23149        Self {
23150            discount_amount: None,
23151            payment_method_options: None,
23152            product_code: None,
23153            product_name: product_name.into(),
23154            quantity: quantity.into(),
23155            tax: None,
23156            unit_cost: unit_cost.into(),
23157            unit_of_measure: None,
23158        }
23159    }
23160}
23161/// Payment method-specific information for line items.
23162#[derive(Clone, Debug, serde::Serialize)]
23163pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23164    /// This sub-hash contains line item details that are specific to `card` payment method."
23165    #[serde(skip_serializing_if = "Option::is_none")]
23166    pub card: Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
23167    /// This sub-hash contains line item details that are specific to `card_present` payment method."
23168    #[serde(skip_serializing_if = "Option::is_none")]
23169    pub card_present:
23170        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
23171    /// This sub-hash contains line item details that are specific to `klarna` payment method."
23172    #[serde(skip_serializing_if = "Option::is_none")]
23173    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
23174    /// This sub-hash contains line item details that are specific to `paypal` payment method."
23175    #[serde(skip_serializing_if = "Option::is_none")]
23176    pub paypal: Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
23177}
23178impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23179    pub fn new() -> Self {
23180        Self { card: None, card_present: None, klarna: None, paypal: None }
23181    }
23182}
23183impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23184    fn default() -> Self {
23185        Self::new()
23186    }
23187}
23188/// This sub-hash contains line item details that are specific to `card` payment method."
23189#[derive(Clone, Debug, serde::Serialize)]
23190pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23191    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23192    #[serde(skip_serializing_if = "Option::is_none")]
23193    pub commodity_code: Option<String>,
23194}
23195impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23196    pub fn new() -> Self {
23197        Self { commodity_code: None }
23198    }
23199}
23200impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23201    fn default() -> Self {
23202        Self::new()
23203    }
23204}
23205/// This sub-hash contains line item details that are specific to `card_present` payment method."
23206#[derive(Clone, Debug, serde::Serialize)]
23207pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23208    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23209    #[serde(skip_serializing_if = "Option::is_none")]
23210    pub commodity_code: Option<String>,
23211}
23212impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23213    pub fn new() -> Self {
23214        Self { commodity_code: None }
23215    }
23216}
23217impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23218    fn default() -> Self {
23219        Self::new()
23220    }
23221}
23222/// This sub-hash contains line item details that are specific to `paypal` payment method."
23223#[derive(Clone, Debug, serde::Serialize)]
23224pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23225    /// Type of the line item.
23226    #[serde(skip_serializing_if = "Option::is_none")]
23227    pub category:
23228        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
23229    /// Description of the line item.
23230    #[serde(skip_serializing_if = "Option::is_none")]
23231    pub description: Option<String>,
23232    /// The Stripe account ID of the connected account that sells the item.
23233    #[serde(skip_serializing_if = "Option::is_none")]
23234    pub sold_by: Option<String>,
23235}
23236impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23237    pub fn new() -> Self {
23238        Self { category: None, description: None, sold_by: None }
23239    }
23240}
23241impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23242    fn default() -> Self {
23243        Self::new()
23244    }
23245}
23246/// Type of the line item.
23247#[derive(Copy, Clone, Eq, PartialEq)]
23248pub enum CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23249    DigitalGoods,
23250    Donation,
23251    PhysicalGoods,
23252}
23253impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23254    pub fn as_str(self) -> &'static str {
23255        use CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23256        match self {
23257            DigitalGoods => "digital_goods",
23258            Donation => "donation",
23259            PhysicalGoods => "physical_goods",
23260        }
23261    }
23262}
23263
23264impl std::str::FromStr
23265    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23266{
23267    type Err = stripe_types::StripeParseError;
23268    fn from_str(s: &str) -> Result<Self, Self::Err> {
23269        use CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23270        match s {
23271            "digital_goods" => Ok(DigitalGoods),
23272            "donation" => Ok(Donation),
23273            "physical_goods" => Ok(PhysicalGoods),
23274            _ => Err(stripe_types::StripeParseError),
23275        }
23276    }
23277}
23278impl std::fmt::Display
23279    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23280{
23281    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23282        f.write_str(self.as_str())
23283    }
23284}
23285
23286impl std::fmt::Debug
23287    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23288{
23289    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23290        f.write_str(self.as_str())
23291    }
23292}
23293impl serde::Serialize
23294    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23295{
23296    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23297    where
23298        S: serde::Serializer,
23299    {
23300        serializer.serialize_str(self.as_str())
23301    }
23302}
23303#[cfg(feature = "deserialize")]
23304impl<'de> serde::Deserialize<'de>
23305    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23306{
23307    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23308        use std::str::FromStr;
23309        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23310        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
23311    }
23312}
23313/// Provides industry-specific information about the charge.
23314#[derive(Clone, Debug, serde::Serialize)]
23315pub struct CapturePaymentIntentPaymentDetails {
23316    /// A unique value to identify the customer. This field is available only for card payments.
23317    ///
23318    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
23319    #[serde(skip_serializing_if = "Option::is_none")]
23320    pub customer_reference: Option<String>,
23321    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
23322    ///
23323    /// 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`.
23324    ///
23325    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
23326    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
23327    #[serde(skip_serializing_if = "Option::is_none")]
23328    pub order_reference: Option<String>,
23329}
23330impl CapturePaymentIntentPaymentDetails {
23331    pub fn new() -> Self {
23332        Self { customer_reference: None, order_reference: None }
23333    }
23334}
23335impl Default for CapturePaymentIntentPaymentDetails {
23336    fn default() -> Self {
23337        Self::new()
23338    }
23339}
23340/// The parameters that you can use to automatically create a transfer after the payment
23341/// is captured.
23342/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
23343#[derive(Copy, Clone, Debug, serde::Serialize)]
23344pub struct CapturePaymentIntentTransferData {
23345    /// The amount that will be transferred automatically when a charge succeeds.
23346    #[serde(skip_serializing_if = "Option::is_none")]
23347    pub amount: Option<i64>,
23348}
23349impl CapturePaymentIntentTransferData {
23350    pub fn new() -> Self {
23351        Self { amount: None }
23352    }
23353}
23354impl Default for CapturePaymentIntentTransferData {
23355    fn default() -> Self {
23356        Self::new()
23357    }
23358}
23359/// Capture the funds of an existing uncaptured PaymentIntent when its status is `requires_capture`.
23360///
23361/// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
23362///
23363/// Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
23364#[derive(Clone, Debug, serde::Serialize)]
23365pub struct CapturePaymentIntent {
23366    inner: CapturePaymentIntentBuilder,
23367    intent: stripe_shared::PaymentIntentId,
23368}
23369impl CapturePaymentIntent {
23370    /// Construct a new `CapturePaymentIntent`.
23371    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
23372        Self { intent: intent.into(), inner: CapturePaymentIntentBuilder::new() }
23373    }
23374    /// Provides industry-specific information about the amount.
23375    pub fn amount_details(
23376        mut self,
23377        amount_details: impl Into<CapturePaymentIntentAmountDetails>,
23378    ) -> Self {
23379        self.inner.amount_details = Some(amount_details.into());
23380        self
23381    }
23382    /// The amount to capture from the PaymentIntent, which must be less than or equal to the original amount.
23383    /// Defaults to the full `amount_capturable` if it's not provided.
23384    pub fn amount_to_capture(mut self, amount_to_capture: impl Into<i64>) -> Self {
23385        self.inner.amount_to_capture = Some(amount_to_capture.into());
23386        self
23387    }
23388    /// 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.
23389    /// The amount of the application fee collected will be capped at the total amount captured.
23390    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
23391    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
23392        self.inner.application_fee_amount = Some(application_fee_amount.into());
23393        self
23394    }
23395    /// Specifies which fields in the response should be expanded.
23396    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
23397        self.inner.expand = Some(expand.into());
23398        self
23399    }
23400    /// Defaults to `true`.
23401    /// 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.
23402    /// You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents.
23403    pub fn final_capture(mut self, final_capture: impl Into<bool>) -> Self {
23404        self.inner.final_capture = Some(final_capture.into());
23405        self
23406    }
23407    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
23408    /// This can be useful for storing additional information about the object in a structured format.
23409    /// Individual keys can be unset by posting an empty value to them.
23410    /// All keys can be unset by posting an empty value to `metadata`.
23411    pub fn metadata(
23412        mut self,
23413        metadata: impl Into<std::collections::HashMap<String, String>>,
23414    ) -> Self {
23415        self.inner.metadata = Some(metadata.into());
23416        self
23417    }
23418    /// Provides industry-specific information about the charge.
23419    pub fn payment_details(
23420        mut self,
23421        payment_details: impl Into<CapturePaymentIntentPaymentDetails>,
23422    ) -> Self {
23423        self.inner.payment_details = Some(payment_details.into());
23424        self
23425    }
23426    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
23427    /// This value overrides the account's default statement descriptor.
23428    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
23429    ///
23430    /// Setting this value for a card charge returns an error.
23431    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
23432    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
23433        self.inner.statement_descriptor = Some(statement_descriptor.into());
23434        self
23435    }
23436    /// Provides information about a card charge.
23437    /// 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.
23438    pub fn statement_descriptor_suffix(
23439        mut self,
23440        statement_descriptor_suffix: impl Into<String>,
23441    ) -> Self {
23442        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
23443        self
23444    }
23445    /// The parameters that you can use to automatically create a transfer after the payment
23446    /// is captured.
23447    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
23448    pub fn transfer_data(
23449        mut self,
23450        transfer_data: impl Into<CapturePaymentIntentTransferData>,
23451    ) -> Self {
23452        self.inner.transfer_data = Some(transfer_data.into());
23453        self
23454    }
23455}
23456impl CapturePaymentIntent {
23457    /// Send the request and return the deserialized response.
23458    pub async fn send<C: StripeClient>(
23459        &self,
23460        client: &C,
23461    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23462        self.customize().send(client).await
23463    }
23464
23465    /// Send the request and return the deserialized response, blocking until completion.
23466    pub fn send_blocking<C: StripeBlockingClient>(
23467        &self,
23468        client: &C,
23469    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
23470        self.customize().send_blocking(client)
23471    }
23472}
23473
23474impl StripeRequest for CapturePaymentIntent {
23475    type Output = stripe_shared::PaymentIntent;
23476
23477    fn build(&self) -> RequestBuilder {
23478        let intent = &self.intent;
23479        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/capture"))
23480            .form(&self.inner)
23481    }
23482}
23483#[derive(Clone, Debug, serde::Serialize)]
23484struct ConfirmPaymentIntentBuilder {
23485    #[serde(skip_serializing_if = "Option::is_none")]
23486    amount_details: Option<ConfirmPaymentIntentAmountDetails>,
23487    #[serde(skip_serializing_if = "Option::is_none")]
23488    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
23489    #[serde(skip_serializing_if = "Option::is_none")]
23490    confirmation_token: Option<String>,
23491    #[serde(skip_serializing_if = "Option::is_none")]
23492    error_on_requires_action: Option<bool>,
23493    #[serde(skip_serializing_if = "Option::is_none")]
23494    excluded_payment_method_types:
23495        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
23496    #[serde(skip_serializing_if = "Option::is_none")]
23497    expand: Option<Vec<String>>,
23498    #[serde(skip_serializing_if = "Option::is_none")]
23499    mandate: Option<String>,
23500    #[serde(skip_serializing_if = "Option::is_none")]
23501    mandate_data: Option<ConfirmPaymentIntentMandateData>,
23502    #[serde(skip_serializing_if = "Option::is_none")]
23503    off_session: Option<ConfirmPaymentIntentOffSession>,
23504    #[serde(skip_serializing_if = "Option::is_none")]
23505    payment_details: Option<ConfirmPaymentIntentPaymentDetails>,
23506    #[serde(skip_serializing_if = "Option::is_none")]
23507    payment_method: Option<String>,
23508    #[serde(skip_serializing_if = "Option::is_none")]
23509    payment_method_data: Option<ConfirmPaymentIntentPaymentMethodData>,
23510    #[serde(skip_serializing_if = "Option::is_none")]
23511    payment_method_options: Option<ConfirmPaymentIntentPaymentMethodOptions>,
23512    #[serde(skip_serializing_if = "Option::is_none")]
23513    payment_method_types: Option<Vec<String>>,
23514    #[serde(skip_serializing_if = "Option::is_none")]
23515    radar_options: Option<ConfirmPaymentIntentRadarOptions>,
23516    #[serde(skip_serializing_if = "Option::is_none")]
23517    receipt_email: Option<String>,
23518    #[serde(skip_serializing_if = "Option::is_none")]
23519    return_url: Option<String>,
23520    #[serde(skip_serializing_if = "Option::is_none")]
23521    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
23522    #[serde(skip_serializing_if = "Option::is_none")]
23523    shipping: Option<ConfirmPaymentIntentShipping>,
23524    #[serde(skip_serializing_if = "Option::is_none")]
23525    use_stripe_sdk: Option<bool>,
23526}
23527impl ConfirmPaymentIntentBuilder {
23528    fn new() -> Self {
23529        Self {
23530            amount_details: None,
23531            capture_method: None,
23532            confirmation_token: None,
23533            error_on_requires_action: None,
23534            excluded_payment_method_types: None,
23535            expand: None,
23536            mandate: None,
23537            mandate_data: None,
23538            off_session: None,
23539            payment_details: None,
23540            payment_method: None,
23541            payment_method_data: None,
23542            payment_method_options: None,
23543            payment_method_types: None,
23544            radar_options: None,
23545            receipt_email: None,
23546            return_url: None,
23547            setup_future_usage: None,
23548            shipping: None,
23549            use_stripe_sdk: None,
23550        }
23551    }
23552}
23553/// Provides industry-specific information about the amount.
23554#[derive(Clone, Debug, serde::Serialize)]
23555pub struct ConfirmPaymentIntentAmountDetails {
23556    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23557    /// An integer greater than 0.
23558    ///
23559    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
23560    #[serde(skip_serializing_if = "Option::is_none")]
23561    pub discount_amount: Option<i64>,
23562    /// A list of line items, each containing information about a product in the PaymentIntent.
23563    /// There is a maximum of 100 line items.
23564    #[serde(skip_serializing_if = "Option::is_none")]
23565    pub line_items: Option<Vec<ConfirmPaymentIntentAmountDetailsLineItems>>,
23566    /// Contains information about the shipping portion of the amount.
23567    #[serde(skip_serializing_if = "Option::is_none")]
23568    pub shipping: Option<AmountDetailsShippingParam>,
23569    /// Contains information about the tax portion of the amount.
23570    #[serde(skip_serializing_if = "Option::is_none")]
23571    pub tax: Option<AmountDetailsTaxParam>,
23572}
23573impl ConfirmPaymentIntentAmountDetails {
23574    pub fn new() -> Self {
23575        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
23576    }
23577}
23578impl Default for ConfirmPaymentIntentAmountDetails {
23579    fn default() -> Self {
23580        Self::new()
23581    }
23582}
23583/// A list of line items, each containing information about a product in the PaymentIntent.
23584/// There is a maximum of 100 line items.
23585#[derive(Clone, Debug, serde::Serialize)]
23586pub struct ConfirmPaymentIntentAmountDetailsLineItems {
23587    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23588    /// An integer greater than 0.
23589    ///
23590    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
23591    #[serde(skip_serializing_if = "Option::is_none")]
23592    pub discount_amount: Option<i64>,
23593    /// Payment method-specific information for line items.
23594    #[serde(skip_serializing_if = "Option::is_none")]
23595    pub payment_method_options:
23596        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
23597    /// The product code of the line item, such as an SKU.
23598    /// Required for L3 rates.
23599    /// At most 12 characters long.
23600    #[serde(skip_serializing_if = "Option::is_none")]
23601    pub product_code: Option<String>,
23602    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
23603    ///
23604    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
23605    /// For Paypal, this field is truncated to 127 characters.
23606    pub product_name: String,
23607    /// The quantity of items. Required for L3 rates. An integer greater than 0.
23608    pub quantity: u64,
23609    /// Contains information about the tax on the item.
23610    #[serde(skip_serializing_if = "Option::is_none")]
23611    pub tax: Option<AmountDetailsLineItemTaxParam>,
23612    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
23613    /// Required for L3 rates.
23614    /// An integer greater than or equal to 0.
23615    pub unit_cost: i64,
23616    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
23617    #[serde(skip_serializing_if = "Option::is_none")]
23618    pub unit_of_measure: Option<String>,
23619}
23620impl ConfirmPaymentIntentAmountDetailsLineItems {
23621    pub fn new(
23622        product_name: impl Into<String>,
23623        quantity: impl Into<u64>,
23624        unit_cost: impl Into<i64>,
23625    ) -> Self {
23626        Self {
23627            discount_amount: None,
23628            payment_method_options: None,
23629            product_code: None,
23630            product_name: product_name.into(),
23631            quantity: quantity.into(),
23632            tax: None,
23633            unit_cost: unit_cost.into(),
23634            unit_of_measure: None,
23635        }
23636    }
23637}
23638/// Payment method-specific information for line items.
23639#[derive(Clone, Debug, serde::Serialize)]
23640pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23641    /// This sub-hash contains line item details that are specific to `card` payment method."
23642    #[serde(skip_serializing_if = "Option::is_none")]
23643    pub card: Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
23644    /// This sub-hash contains line item details that are specific to `card_present` payment method."
23645    #[serde(skip_serializing_if = "Option::is_none")]
23646    pub card_present:
23647        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
23648    /// This sub-hash contains line item details that are specific to `klarna` payment method."
23649    #[serde(skip_serializing_if = "Option::is_none")]
23650    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
23651    /// This sub-hash contains line item details that are specific to `paypal` payment method."
23652    #[serde(skip_serializing_if = "Option::is_none")]
23653    pub paypal: Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
23654}
23655impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23656    pub fn new() -> Self {
23657        Self { card: None, card_present: None, klarna: None, paypal: None }
23658    }
23659}
23660impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
23661    fn default() -> Self {
23662        Self::new()
23663    }
23664}
23665/// This sub-hash contains line item details that are specific to `card` payment method."
23666#[derive(Clone, Debug, serde::Serialize)]
23667pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23668    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23669    #[serde(skip_serializing_if = "Option::is_none")]
23670    pub commodity_code: Option<String>,
23671}
23672impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23673    pub fn new() -> Self {
23674        Self { commodity_code: None }
23675    }
23676}
23677impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
23678    fn default() -> Self {
23679        Self::new()
23680    }
23681}
23682/// This sub-hash contains line item details that are specific to `card_present` payment method."
23683#[derive(Clone, Debug, serde::Serialize)]
23684pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23685    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
23686    #[serde(skip_serializing_if = "Option::is_none")]
23687    pub commodity_code: Option<String>,
23688}
23689impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23690    pub fn new() -> Self {
23691        Self { commodity_code: None }
23692    }
23693}
23694impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
23695    fn default() -> Self {
23696        Self::new()
23697    }
23698}
23699/// This sub-hash contains line item details that are specific to `paypal` payment method."
23700#[derive(Clone, Debug, serde::Serialize)]
23701pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23702    /// Type of the line item.
23703    #[serde(skip_serializing_if = "Option::is_none")]
23704    pub category:
23705        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
23706    /// Description of the line item.
23707    #[serde(skip_serializing_if = "Option::is_none")]
23708    pub description: Option<String>,
23709    /// The Stripe account ID of the connected account that sells the item.
23710    #[serde(skip_serializing_if = "Option::is_none")]
23711    pub sold_by: Option<String>,
23712}
23713impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23714    pub fn new() -> Self {
23715        Self { category: None, description: None, sold_by: None }
23716    }
23717}
23718impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
23719    fn default() -> Self {
23720        Self::new()
23721    }
23722}
23723/// Type of the line item.
23724#[derive(Copy, Clone, Eq, PartialEq)]
23725pub enum ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23726    DigitalGoods,
23727    Donation,
23728    PhysicalGoods,
23729}
23730impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
23731    pub fn as_str(self) -> &'static str {
23732        use ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23733        match self {
23734            DigitalGoods => "digital_goods",
23735            Donation => "donation",
23736            PhysicalGoods => "physical_goods",
23737        }
23738    }
23739}
23740
23741impl std::str::FromStr
23742    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23743{
23744    type Err = stripe_types::StripeParseError;
23745    fn from_str(s: &str) -> Result<Self, Self::Err> {
23746        use ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
23747        match s {
23748            "digital_goods" => Ok(DigitalGoods),
23749            "donation" => Ok(Donation),
23750            "physical_goods" => Ok(PhysicalGoods),
23751            _ => Err(stripe_types::StripeParseError),
23752        }
23753    }
23754}
23755impl std::fmt::Display
23756    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23757{
23758    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23759        f.write_str(self.as_str())
23760    }
23761}
23762
23763impl std::fmt::Debug
23764    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23765{
23766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23767        f.write_str(self.as_str())
23768    }
23769}
23770impl serde::Serialize
23771    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23772{
23773    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23774    where
23775        S: serde::Serializer,
23776    {
23777        serializer.serialize_str(self.as_str())
23778    }
23779}
23780#[cfg(feature = "deserialize")]
23781impl<'de> serde::Deserialize<'de>
23782    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
23783{
23784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23785        use std::str::FromStr;
23786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23787        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
23788    }
23789}
23790#[derive(Clone, Debug, serde::Serialize)]
23791#[serde(rename_all = "snake_case")]
23792pub enum ConfirmPaymentIntentMandateData {
23793    #[serde(untagged)]
23794    SecretKeyParam(ConfirmPaymentIntentSecretKeyParam),
23795    #[serde(untagged)]
23796    ClientKeyParam(ConfirmPaymentIntentClientKeyParam),
23797}
23798#[derive(Clone, Debug, serde::Serialize)]
23799pub struct ConfirmPaymentIntentSecretKeyParam {
23800    /// This hash contains details about the customer acceptance of the Mandate.
23801    pub customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance,
23802}
23803impl ConfirmPaymentIntentSecretKeyParam {
23804    pub fn new(
23805        customer_acceptance: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptance>,
23806    ) -> Self {
23807        Self { customer_acceptance: customer_acceptance.into() }
23808    }
23809}
23810/// This hash contains details about the customer acceptance of the Mandate.
23811#[derive(Clone, Debug, serde::Serialize)]
23812pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
23813    /// The time at which the customer accepted the Mandate.
23814    #[serde(skip_serializing_if = "Option::is_none")]
23815    pub accepted_at: Option<stripe_types::Timestamp>,
23816    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
23817    #[serde(skip_serializing_if = "Option::is_none")]
23818    #[serde(with = "stripe_types::with_serde_json_opt")]
23819    pub offline: Option<miniserde::json::Value>,
23820    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
23821    #[serde(skip_serializing_if = "Option::is_none")]
23822    pub online: Option<OnlineParam>,
23823    /// The type of customer acceptance information included with the Mandate.
23824    /// One of `online` or `offline`.
23825    #[serde(rename = "type")]
23826    pub type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType,
23827}
23828impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
23829    pub fn new(type_: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
23830        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
23831    }
23832}
23833/// The type of customer acceptance information included with the Mandate.
23834/// One of `online` or `offline`.
23835#[derive(Copy, Clone, Eq, PartialEq)]
23836pub enum ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23837    Offline,
23838    Online,
23839}
23840impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23841    pub fn as_str(self) -> &'static str {
23842        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
23843        match self {
23844            Offline => "offline",
23845            Online => "online",
23846        }
23847    }
23848}
23849
23850impl std::str::FromStr for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23851    type Err = stripe_types::StripeParseError;
23852    fn from_str(s: &str) -> Result<Self, Self::Err> {
23853        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
23854        match s {
23855            "offline" => Ok(Offline),
23856            "online" => Ok(Online),
23857            _ => Err(stripe_types::StripeParseError),
23858        }
23859    }
23860}
23861impl std::fmt::Display for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23862    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23863        f.write_str(self.as_str())
23864    }
23865}
23866
23867impl std::fmt::Debug for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23868    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23869        f.write_str(self.as_str())
23870    }
23871}
23872impl serde::Serialize for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23873    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23874    where
23875        S: serde::Serializer,
23876    {
23877        serializer.serialize_str(self.as_str())
23878    }
23879}
23880#[cfg(feature = "deserialize")]
23881impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
23882    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23883        use std::str::FromStr;
23884        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23885        Self::from_str(&s).map_err(|_| {
23886            serde::de::Error::custom(
23887                "Unknown value for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType",
23888            )
23889        })
23890    }
23891}
23892#[derive(Clone, Debug, serde::Serialize)]
23893pub struct ConfirmPaymentIntentClientKeyParam {
23894    /// This hash contains details about the customer acceptance of the Mandate.
23895    pub customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance,
23896}
23897impl ConfirmPaymentIntentClientKeyParam {
23898    pub fn new(
23899        customer_acceptance: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptance>,
23900    ) -> Self {
23901        Self { customer_acceptance: customer_acceptance.into() }
23902    }
23903}
23904/// This hash contains details about the customer acceptance of the Mandate.
23905#[derive(Clone, Debug, serde::Serialize)]
23906pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
23907    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
23908    pub online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline,
23909    /// The type of customer acceptance information included with the Mandate.
23910    #[serde(rename = "type")]
23911    pub type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType,
23912}
23913impl ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
23914    pub fn new(
23915        online: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline>,
23916        type_: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType>,
23917    ) -> Self {
23918        Self { online: online.into(), type_: type_.into() }
23919    }
23920}
23921/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
23922#[derive(Clone, Debug, serde::Serialize)]
23923pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
23924    /// The IP address from which the Mandate was accepted by the customer.
23925    #[serde(skip_serializing_if = "Option::is_none")]
23926    pub ip_address: Option<String>,
23927    /// The user agent of the browser from which the Mandate was accepted by the customer.
23928    #[serde(skip_serializing_if = "Option::is_none")]
23929    pub user_agent: Option<String>,
23930}
23931impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
23932    pub fn new() -> Self {
23933        Self { ip_address: None, user_agent: None }
23934    }
23935}
23936impl Default for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
23937    fn default() -> Self {
23938        Self::new()
23939    }
23940}
23941/// The type of customer acceptance information included with the Mandate.
23942#[derive(Copy, Clone, Eq, PartialEq)]
23943pub enum ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23944    Online,
23945}
23946impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23947    pub fn as_str(self) -> &'static str {
23948        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
23949        match self {
23950            Online => "online",
23951        }
23952    }
23953}
23954
23955impl std::str::FromStr for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23956    type Err = stripe_types::StripeParseError;
23957    fn from_str(s: &str) -> Result<Self, Self::Err> {
23958        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
23959        match s {
23960            "online" => Ok(Online),
23961            _ => Err(stripe_types::StripeParseError),
23962        }
23963    }
23964}
23965impl std::fmt::Display for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23966    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23967        f.write_str(self.as_str())
23968    }
23969}
23970
23971impl std::fmt::Debug for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23972    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23973        f.write_str(self.as_str())
23974    }
23975}
23976impl serde::Serialize for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23977    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23978    where
23979        S: serde::Serializer,
23980    {
23981        serializer.serialize_str(self.as_str())
23982    }
23983}
23984#[cfg(feature = "deserialize")]
23985impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
23986    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23987        use std::str::FromStr;
23988        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23989        Self::from_str(&s).map_err(|_| {
23990            serde::de::Error::custom(
23991                "Unknown value for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType",
23992            )
23993        })
23994    }
23995}
23996/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
23997/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
23998#[derive(Copy, Clone, Debug, serde::Serialize)]
23999#[serde(rename_all = "snake_case")]
24000pub enum ConfirmPaymentIntentOffSession {
24001    OneOff,
24002    Recurring,
24003    #[serde(untagged)]
24004    Bool(bool),
24005}
24006/// Provides industry-specific information about the charge.
24007#[derive(Clone, Debug, serde::Serialize)]
24008pub struct ConfirmPaymentIntentPaymentDetails {
24009    /// A unique value to identify the customer. This field is available only for card payments.
24010    ///
24011    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
24012    #[serde(skip_serializing_if = "Option::is_none")]
24013    pub customer_reference: Option<String>,
24014    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
24015    ///
24016    /// 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`.
24017    ///
24018    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
24019    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
24020    #[serde(skip_serializing_if = "Option::is_none")]
24021    pub order_reference: Option<String>,
24022}
24023impl ConfirmPaymentIntentPaymentDetails {
24024    pub fn new() -> Self {
24025        Self { customer_reference: None, order_reference: None }
24026    }
24027}
24028impl Default for ConfirmPaymentIntentPaymentDetails {
24029    fn default() -> Self {
24030        Self::new()
24031    }
24032}
24033/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
24034/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
24035/// property on the PaymentIntent.
24036#[derive(Clone, Debug, serde::Serialize)]
24037pub struct ConfirmPaymentIntentPaymentMethodData {
24038    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
24039    #[serde(skip_serializing_if = "Option::is_none")]
24040    pub acss_debit: Option<PaymentMethodParam>,
24041    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
24042    #[serde(skip_serializing_if = "Option::is_none")]
24043    #[serde(with = "stripe_types::with_serde_json_opt")]
24044    pub affirm: Option<miniserde::json::Value>,
24045    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
24046    #[serde(skip_serializing_if = "Option::is_none")]
24047    #[serde(with = "stripe_types::with_serde_json_opt")]
24048    pub afterpay_clearpay: Option<miniserde::json::Value>,
24049    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
24050    #[serde(skip_serializing_if = "Option::is_none")]
24051    #[serde(with = "stripe_types::with_serde_json_opt")]
24052    pub alipay: Option<miniserde::json::Value>,
24053    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
24054    /// 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.
24055    /// The field defaults to `unspecified`.
24056    #[serde(skip_serializing_if = "Option::is_none")]
24057    pub allow_redisplay: Option<ConfirmPaymentIntentPaymentMethodDataAllowRedisplay>,
24058    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
24059    #[serde(skip_serializing_if = "Option::is_none")]
24060    #[serde(with = "stripe_types::with_serde_json_opt")]
24061    pub alma: Option<miniserde::json::Value>,
24062    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
24063    #[serde(skip_serializing_if = "Option::is_none")]
24064    #[serde(with = "stripe_types::with_serde_json_opt")]
24065    pub amazon_pay: Option<miniserde::json::Value>,
24066    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
24067    #[serde(skip_serializing_if = "Option::is_none")]
24068    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodDataAuBecsDebit>,
24069    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
24070    #[serde(skip_serializing_if = "Option::is_none")]
24071    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodDataBacsDebit>,
24072    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
24073    #[serde(skip_serializing_if = "Option::is_none")]
24074    #[serde(with = "stripe_types::with_serde_json_opt")]
24075    pub bancontact: Option<miniserde::json::Value>,
24076    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
24077    #[serde(skip_serializing_if = "Option::is_none")]
24078    #[serde(with = "stripe_types::with_serde_json_opt")]
24079    pub billie: Option<miniserde::json::Value>,
24080    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
24081    #[serde(skip_serializing_if = "Option::is_none")]
24082    pub billing_details: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetails>,
24083    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
24084    #[serde(skip_serializing_if = "Option::is_none")]
24085    #[serde(with = "stripe_types::with_serde_json_opt")]
24086    pub blik: Option<miniserde::json::Value>,
24087    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
24088    #[serde(skip_serializing_if = "Option::is_none")]
24089    pub boleto: Option<ConfirmPaymentIntentPaymentMethodDataBoleto>,
24090    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
24091    #[serde(skip_serializing_if = "Option::is_none")]
24092    #[serde(with = "stripe_types::with_serde_json_opt")]
24093    pub cashapp: Option<miniserde::json::Value>,
24094    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
24095    #[serde(skip_serializing_if = "Option::is_none")]
24096    #[serde(with = "stripe_types::with_serde_json_opt")]
24097    pub crypto: Option<miniserde::json::Value>,
24098    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
24099    #[serde(skip_serializing_if = "Option::is_none")]
24100    #[serde(with = "stripe_types::with_serde_json_opt")]
24101    pub customer_balance: Option<miniserde::json::Value>,
24102    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
24103    #[serde(skip_serializing_if = "Option::is_none")]
24104    pub eps: Option<ConfirmPaymentIntentPaymentMethodDataEps>,
24105    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
24106    #[serde(skip_serializing_if = "Option::is_none")]
24107    pub fpx: Option<ConfirmPaymentIntentPaymentMethodDataFpx>,
24108    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
24109    #[serde(skip_serializing_if = "Option::is_none")]
24110    #[serde(with = "stripe_types::with_serde_json_opt")]
24111    pub giropay: Option<miniserde::json::Value>,
24112    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
24113    #[serde(skip_serializing_if = "Option::is_none")]
24114    #[serde(with = "stripe_types::with_serde_json_opt")]
24115    pub grabpay: Option<miniserde::json::Value>,
24116    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
24117    #[serde(skip_serializing_if = "Option::is_none")]
24118    pub ideal: Option<ConfirmPaymentIntentPaymentMethodDataIdeal>,
24119    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
24120    #[serde(skip_serializing_if = "Option::is_none")]
24121    #[serde(with = "stripe_types::with_serde_json_opt")]
24122    pub interac_present: Option<miniserde::json::Value>,
24123    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
24124    #[serde(skip_serializing_if = "Option::is_none")]
24125    #[serde(with = "stripe_types::with_serde_json_opt")]
24126    pub kakao_pay: Option<miniserde::json::Value>,
24127    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
24128    #[serde(skip_serializing_if = "Option::is_none")]
24129    pub klarna: Option<ConfirmPaymentIntentPaymentMethodDataKlarna>,
24130    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
24131    #[serde(skip_serializing_if = "Option::is_none")]
24132    #[serde(with = "stripe_types::with_serde_json_opt")]
24133    pub konbini: Option<miniserde::json::Value>,
24134    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
24135    #[serde(skip_serializing_if = "Option::is_none")]
24136    #[serde(with = "stripe_types::with_serde_json_opt")]
24137    pub kr_card: Option<miniserde::json::Value>,
24138    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
24139    #[serde(skip_serializing_if = "Option::is_none")]
24140    #[serde(with = "stripe_types::with_serde_json_opt")]
24141    pub link: Option<miniserde::json::Value>,
24142    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
24143    #[serde(skip_serializing_if = "Option::is_none")]
24144    #[serde(with = "stripe_types::with_serde_json_opt")]
24145    pub mb_way: Option<miniserde::json::Value>,
24146    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
24147    /// This can be useful for storing additional information about the object in a structured format.
24148    /// Individual keys can be unset by posting an empty value to them.
24149    /// All keys can be unset by posting an empty value to `metadata`.
24150    #[serde(skip_serializing_if = "Option::is_none")]
24151    pub metadata: Option<std::collections::HashMap<String, String>>,
24152    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
24153    #[serde(skip_serializing_if = "Option::is_none")]
24154    #[serde(with = "stripe_types::with_serde_json_opt")]
24155    pub mobilepay: Option<miniserde::json::Value>,
24156    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
24157    #[serde(skip_serializing_if = "Option::is_none")]
24158    #[serde(with = "stripe_types::with_serde_json_opt")]
24159    pub multibanco: Option<miniserde::json::Value>,
24160    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
24161    #[serde(skip_serializing_if = "Option::is_none")]
24162    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodDataNaverPay>,
24163    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
24164    #[serde(skip_serializing_if = "Option::is_none")]
24165    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataNzBankAccount>,
24166    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
24167    #[serde(skip_serializing_if = "Option::is_none")]
24168    #[serde(with = "stripe_types::with_serde_json_opt")]
24169    pub oxxo: Option<miniserde::json::Value>,
24170    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
24171    #[serde(skip_serializing_if = "Option::is_none")]
24172    pub p24: Option<ConfirmPaymentIntentPaymentMethodDataP24>,
24173    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
24174    #[serde(skip_serializing_if = "Option::is_none")]
24175    #[serde(with = "stripe_types::with_serde_json_opt")]
24176    pub pay_by_bank: Option<miniserde::json::Value>,
24177    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
24178    #[serde(skip_serializing_if = "Option::is_none")]
24179    #[serde(with = "stripe_types::with_serde_json_opt")]
24180    pub payco: Option<miniserde::json::Value>,
24181    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
24182    #[serde(skip_serializing_if = "Option::is_none")]
24183    #[serde(with = "stripe_types::with_serde_json_opt")]
24184    pub paynow: Option<miniserde::json::Value>,
24185    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
24186    #[serde(skip_serializing_if = "Option::is_none")]
24187    #[serde(with = "stripe_types::with_serde_json_opt")]
24188    pub paypal: Option<miniserde::json::Value>,
24189    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
24190    #[serde(skip_serializing_if = "Option::is_none")]
24191    #[serde(with = "stripe_types::with_serde_json_opt")]
24192    pub pix: Option<miniserde::json::Value>,
24193    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
24194    #[serde(skip_serializing_if = "Option::is_none")]
24195    #[serde(with = "stripe_types::with_serde_json_opt")]
24196    pub promptpay: Option<miniserde::json::Value>,
24197    /// Options to configure Radar.
24198    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
24199    #[serde(skip_serializing_if = "Option::is_none")]
24200    pub radar_options: Option<ConfirmPaymentIntentPaymentMethodDataRadarOptions>,
24201    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
24202    #[serde(skip_serializing_if = "Option::is_none")]
24203    #[serde(with = "stripe_types::with_serde_json_opt")]
24204    pub revolut_pay: Option<miniserde::json::Value>,
24205    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
24206    #[serde(skip_serializing_if = "Option::is_none")]
24207    #[serde(with = "stripe_types::with_serde_json_opt")]
24208    pub samsung_pay: Option<miniserde::json::Value>,
24209    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
24210    #[serde(skip_serializing_if = "Option::is_none")]
24211    #[serde(with = "stripe_types::with_serde_json_opt")]
24212    pub satispay: Option<miniserde::json::Value>,
24213    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
24214    #[serde(skip_serializing_if = "Option::is_none")]
24215    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodDataSepaDebit>,
24216    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
24217    #[serde(skip_serializing_if = "Option::is_none")]
24218    pub sofort: Option<ConfirmPaymentIntentPaymentMethodDataSofort>,
24219    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
24220    #[serde(skip_serializing_if = "Option::is_none")]
24221    #[serde(with = "stripe_types::with_serde_json_opt")]
24222    pub swish: Option<miniserde::json::Value>,
24223    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
24224    #[serde(skip_serializing_if = "Option::is_none")]
24225    #[serde(with = "stripe_types::with_serde_json_opt")]
24226    pub twint: Option<miniserde::json::Value>,
24227    /// The type of the PaymentMethod.
24228    /// An additional hash is included on the PaymentMethod with a name matching this value.
24229    /// It contains additional information specific to the PaymentMethod type.
24230    #[serde(rename = "type")]
24231    pub type_: ConfirmPaymentIntentPaymentMethodDataType,
24232    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
24233    #[serde(skip_serializing_if = "Option::is_none")]
24234    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccount>,
24235    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
24236    #[serde(skip_serializing_if = "Option::is_none")]
24237    #[serde(with = "stripe_types::with_serde_json_opt")]
24238    pub wechat_pay: Option<miniserde::json::Value>,
24239    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
24240    #[serde(skip_serializing_if = "Option::is_none")]
24241    #[serde(with = "stripe_types::with_serde_json_opt")]
24242    pub zip: Option<miniserde::json::Value>,
24243}
24244impl ConfirmPaymentIntentPaymentMethodData {
24245    pub fn new(type_: impl Into<ConfirmPaymentIntentPaymentMethodDataType>) -> Self {
24246        Self {
24247            acss_debit: None,
24248            affirm: None,
24249            afterpay_clearpay: None,
24250            alipay: None,
24251            allow_redisplay: None,
24252            alma: None,
24253            amazon_pay: None,
24254            au_becs_debit: None,
24255            bacs_debit: None,
24256            bancontact: None,
24257            billie: None,
24258            billing_details: None,
24259            blik: None,
24260            boleto: None,
24261            cashapp: None,
24262            crypto: None,
24263            customer_balance: None,
24264            eps: None,
24265            fpx: None,
24266            giropay: None,
24267            grabpay: None,
24268            ideal: None,
24269            interac_present: None,
24270            kakao_pay: None,
24271            klarna: None,
24272            konbini: None,
24273            kr_card: None,
24274            link: None,
24275            mb_way: None,
24276            metadata: None,
24277            mobilepay: None,
24278            multibanco: None,
24279            naver_pay: None,
24280            nz_bank_account: None,
24281            oxxo: None,
24282            p24: None,
24283            pay_by_bank: None,
24284            payco: None,
24285            paynow: None,
24286            paypal: None,
24287            pix: None,
24288            promptpay: None,
24289            radar_options: None,
24290            revolut_pay: None,
24291            samsung_pay: None,
24292            satispay: None,
24293            sepa_debit: None,
24294            sofort: None,
24295            swish: None,
24296            twint: None,
24297            type_: type_.into(),
24298            us_bank_account: None,
24299            wechat_pay: None,
24300            zip: None,
24301        }
24302    }
24303}
24304/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
24305/// 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.
24306/// The field defaults to `unspecified`.
24307#[derive(Copy, Clone, Eq, PartialEq)]
24308pub enum ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24309    Always,
24310    Limited,
24311    Unspecified,
24312}
24313impl ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24314    pub fn as_str(self) -> &'static str {
24315        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
24316        match self {
24317            Always => "always",
24318            Limited => "limited",
24319            Unspecified => "unspecified",
24320        }
24321    }
24322}
24323
24324impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24325    type Err = stripe_types::StripeParseError;
24326    fn from_str(s: &str) -> Result<Self, Self::Err> {
24327        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
24328        match s {
24329            "always" => Ok(Always),
24330            "limited" => Ok(Limited),
24331            "unspecified" => Ok(Unspecified),
24332            _ => Err(stripe_types::StripeParseError),
24333        }
24334    }
24335}
24336impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24337    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24338        f.write_str(self.as_str())
24339    }
24340}
24341
24342impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24343    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24344        f.write_str(self.as_str())
24345    }
24346}
24347impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24348    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24349    where
24350        S: serde::Serializer,
24351    {
24352        serializer.serialize_str(self.as_str())
24353    }
24354}
24355#[cfg(feature = "deserialize")]
24356impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
24357    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24358        use std::str::FromStr;
24359        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24360        Self::from_str(&s).map_err(|_| {
24361            serde::de::Error::custom(
24362                "Unknown value for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay",
24363            )
24364        })
24365    }
24366}
24367/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
24368#[derive(Clone, Debug, serde::Serialize)]
24369pub struct ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
24370    /// The account number for the bank account.
24371    pub account_number: String,
24372    /// Bank-State-Branch number of the bank account.
24373    pub bsb_number: String,
24374}
24375impl ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
24376    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
24377        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
24378    }
24379}
24380/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
24381#[derive(Clone, Debug, serde::Serialize)]
24382pub struct ConfirmPaymentIntentPaymentMethodDataBacsDebit {
24383    /// Account number of the bank account that the funds will be debited from.
24384    #[serde(skip_serializing_if = "Option::is_none")]
24385    pub account_number: Option<String>,
24386    /// Sort code of the bank account. (e.g., `10-20-30`)
24387    #[serde(skip_serializing_if = "Option::is_none")]
24388    pub sort_code: Option<String>,
24389}
24390impl ConfirmPaymentIntentPaymentMethodDataBacsDebit {
24391    pub fn new() -> Self {
24392        Self { account_number: None, sort_code: None }
24393    }
24394}
24395impl Default for ConfirmPaymentIntentPaymentMethodDataBacsDebit {
24396    fn default() -> Self {
24397        Self::new()
24398    }
24399}
24400/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
24401#[derive(Clone, Debug, serde::Serialize)]
24402pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetails {
24403    /// Billing address.
24404    #[serde(skip_serializing_if = "Option::is_none")]
24405    pub address: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress>,
24406    /// Email address.
24407    #[serde(skip_serializing_if = "Option::is_none")]
24408    pub email: Option<String>,
24409    /// Full name.
24410    #[serde(skip_serializing_if = "Option::is_none")]
24411    pub name: Option<String>,
24412    /// Billing phone number (including extension).
24413    #[serde(skip_serializing_if = "Option::is_none")]
24414    pub phone: Option<String>,
24415    /// Taxpayer identification number.
24416    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
24417    #[serde(skip_serializing_if = "Option::is_none")]
24418    pub tax_id: Option<String>,
24419}
24420impl ConfirmPaymentIntentPaymentMethodDataBillingDetails {
24421    pub fn new() -> Self {
24422        Self { address: None, email: None, name: None, phone: None, tax_id: None }
24423    }
24424}
24425impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetails {
24426    fn default() -> Self {
24427        Self::new()
24428    }
24429}
24430/// Billing address.
24431#[derive(Clone, Debug, serde::Serialize)]
24432pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
24433    /// City, district, suburb, town, or village.
24434    #[serde(skip_serializing_if = "Option::is_none")]
24435    pub city: Option<String>,
24436    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
24437    #[serde(skip_serializing_if = "Option::is_none")]
24438    pub country: Option<String>,
24439    /// Address line 1, such as the street, PO Box, or company name.
24440    #[serde(skip_serializing_if = "Option::is_none")]
24441    pub line1: Option<String>,
24442    /// Address line 2, such as the apartment, suite, unit, or building.
24443    #[serde(skip_serializing_if = "Option::is_none")]
24444    pub line2: Option<String>,
24445    /// ZIP or postal code.
24446    #[serde(skip_serializing_if = "Option::is_none")]
24447    pub postal_code: Option<String>,
24448    /// State, county, province, or region.
24449    #[serde(skip_serializing_if = "Option::is_none")]
24450    pub state: Option<String>,
24451}
24452impl ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
24453    pub fn new() -> Self {
24454        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
24455    }
24456}
24457impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
24458    fn default() -> Self {
24459        Self::new()
24460    }
24461}
24462/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
24463#[derive(Clone, Debug, serde::Serialize)]
24464pub struct ConfirmPaymentIntentPaymentMethodDataBoleto {
24465    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
24466    pub tax_id: String,
24467}
24468impl ConfirmPaymentIntentPaymentMethodDataBoleto {
24469    pub fn new(tax_id: impl Into<String>) -> Self {
24470        Self { tax_id: tax_id.into() }
24471    }
24472}
24473/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
24474#[derive(Clone, Debug, serde::Serialize)]
24475pub struct ConfirmPaymentIntentPaymentMethodDataEps {
24476    /// The customer's bank.
24477    #[serde(skip_serializing_if = "Option::is_none")]
24478    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataEpsBank>,
24479}
24480impl ConfirmPaymentIntentPaymentMethodDataEps {
24481    pub fn new() -> Self {
24482        Self { bank: None }
24483    }
24484}
24485impl Default for ConfirmPaymentIntentPaymentMethodDataEps {
24486    fn default() -> Self {
24487        Self::new()
24488    }
24489}
24490/// The customer's bank.
24491#[derive(Clone, Eq, PartialEq)]
24492#[non_exhaustive]
24493pub enum ConfirmPaymentIntentPaymentMethodDataEpsBank {
24494    ArzteUndApothekerBank,
24495    AustrianAnadiBankAg,
24496    BankAustria,
24497    BankhausCarlSpangler,
24498    BankhausSchelhammerUndSchatteraAg,
24499    BawagPskAg,
24500    BksBankAg,
24501    BrullKallmusBankAg,
24502    BtvVierLanderBank,
24503    CapitalBankGraweGruppeAg,
24504    DeutscheBankAg,
24505    Dolomitenbank,
24506    EasybankAg,
24507    ErsteBankUndSparkassen,
24508    HypoAlpeadriabankInternationalAg,
24509    HypoBankBurgenlandAktiengesellschaft,
24510    HypoNoeLbFurNiederosterreichUWien,
24511    HypoOberosterreichSalzburgSteiermark,
24512    HypoTirolBankAg,
24513    HypoVorarlbergBankAg,
24514    MarchfelderBank,
24515    OberbankAg,
24516    RaiffeisenBankengruppeOsterreich,
24517    SchoellerbankAg,
24518    SpardaBankWien,
24519    VolksbankGruppe,
24520    VolkskreditbankAg,
24521    VrBankBraunau,
24522    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24523    Unknown(String),
24524}
24525impl ConfirmPaymentIntentPaymentMethodDataEpsBank {
24526    pub fn as_str(&self) -> &str {
24527        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
24528        match self {
24529            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
24530            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
24531            BankAustria => "bank_austria",
24532            BankhausCarlSpangler => "bankhaus_carl_spangler",
24533            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
24534            BawagPskAg => "bawag_psk_ag",
24535            BksBankAg => "bks_bank_ag",
24536            BrullKallmusBankAg => "brull_kallmus_bank_ag",
24537            BtvVierLanderBank => "btv_vier_lander_bank",
24538            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
24539            DeutscheBankAg => "deutsche_bank_ag",
24540            Dolomitenbank => "dolomitenbank",
24541            EasybankAg => "easybank_ag",
24542            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
24543            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
24544            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
24545            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
24546            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
24547            HypoTirolBankAg => "hypo_tirol_bank_ag",
24548            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
24549            MarchfelderBank => "marchfelder_bank",
24550            OberbankAg => "oberbank_ag",
24551            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
24552            SchoellerbankAg => "schoellerbank_ag",
24553            SpardaBankWien => "sparda_bank_wien",
24554            VolksbankGruppe => "volksbank_gruppe",
24555            VolkskreditbankAg => "volkskreditbank_ag",
24556            VrBankBraunau => "vr_bank_braunau",
24557            Unknown(v) => v,
24558        }
24559    }
24560}
24561
24562impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24563    type Err = std::convert::Infallible;
24564    fn from_str(s: &str) -> Result<Self, Self::Err> {
24565        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
24566        match s {
24567            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
24568            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
24569            "bank_austria" => Ok(BankAustria),
24570            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
24571            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
24572            "bawag_psk_ag" => Ok(BawagPskAg),
24573            "bks_bank_ag" => Ok(BksBankAg),
24574            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
24575            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
24576            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
24577            "deutsche_bank_ag" => Ok(DeutscheBankAg),
24578            "dolomitenbank" => Ok(Dolomitenbank),
24579            "easybank_ag" => Ok(EasybankAg),
24580            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
24581            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
24582            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
24583            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
24584            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
24585            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
24586            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
24587            "marchfelder_bank" => Ok(MarchfelderBank),
24588            "oberbank_ag" => Ok(OberbankAg),
24589            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
24590            "schoellerbank_ag" => Ok(SchoellerbankAg),
24591            "sparda_bank_wien" => Ok(SpardaBankWien),
24592            "volksbank_gruppe" => Ok(VolksbankGruppe),
24593            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
24594            "vr_bank_braunau" => Ok(VrBankBraunau),
24595            v => Ok(Unknown(v.to_owned())),
24596        }
24597    }
24598}
24599impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24600    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24601        f.write_str(self.as_str())
24602    }
24603}
24604
24605impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24606    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24607        f.write_str(self.as_str())
24608    }
24609}
24610impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24611    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24612    where
24613        S: serde::Serializer,
24614    {
24615        serializer.serialize_str(self.as_str())
24616    }
24617}
24618#[cfg(feature = "deserialize")]
24619impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataEpsBank {
24620    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24621        use std::str::FromStr;
24622        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24623        Ok(Self::from_str(&s).unwrap())
24624    }
24625}
24626/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
24627#[derive(Clone, Debug, serde::Serialize)]
24628pub struct ConfirmPaymentIntentPaymentMethodDataFpx {
24629    /// Account holder type for FPX transaction
24630    #[serde(skip_serializing_if = "Option::is_none")]
24631    pub account_holder_type: Option<ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType>,
24632    /// The customer's bank.
24633    pub bank: ConfirmPaymentIntentPaymentMethodDataFpxBank,
24634}
24635impl ConfirmPaymentIntentPaymentMethodDataFpx {
24636    pub fn new(bank: impl Into<ConfirmPaymentIntentPaymentMethodDataFpxBank>) -> Self {
24637        Self { account_holder_type: None, bank: bank.into() }
24638    }
24639}
24640/// Account holder type for FPX transaction
24641#[derive(Copy, Clone, Eq, PartialEq)]
24642pub enum ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24643    Company,
24644    Individual,
24645}
24646impl ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24647    pub fn as_str(self) -> &'static str {
24648        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
24649        match self {
24650            Company => "company",
24651            Individual => "individual",
24652        }
24653    }
24654}
24655
24656impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24657    type Err = stripe_types::StripeParseError;
24658    fn from_str(s: &str) -> Result<Self, Self::Err> {
24659        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
24660        match s {
24661            "company" => Ok(Company),
24662            "individual" => Ok(Individual),
24663            _ => Err(stripe_types::StripeParseError),
24664        }
24665    }
24666}
24667impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24668    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24669        f.write_str(self.as_str())
24670    }
24671}
24672
24673impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24674    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24675        f.write_str(self.as_str())
24676    }
24677}
24678impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24679    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24680    where
24681        S: serde::Serializer,
24682    {
24683        serializer.serialize_str(self.as_str())
24684    }
24685}
24686#[cfg(feature = "deserialize")]
24687impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
24688    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24689        use std::str::FromStr;
24690        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24691        Self::from_str(&s).map_err(|_| {
24692            serde::de::Error::custom(
24693                "Unknown value for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType",
24694            )
24695        })
24696    }
24697}
24698/// The customer's bank.
24699#[derive(Clone, Eq, PartialEq)]
24700#[non_exhaustive]
24701pub enum ConfirmPaymentIntentPaymentMethodDataFpxBank {
24702    AffinBank,
24703    Agrobank,
24704    AllianceBank,
24705    Ambank,
24706    BankIslam,
24707    BankMuamalat,
24708    BankOfChina,
24709    BankRakyat,
24710    Bsn,
24711    Cimb,
24712    DeutscheBank,
24713    HongLeongBank,
24714    Hsbc,
24715    Kfh,
24716    Maybank2e,
24717    Maybank2u,
24718    Ocbc,
24719    PbEnterprise,
24720    PublicBank,
24721    Rhb,
24722    StandardChartered,
24723    Uob,
24724    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24725    Unknown(String),
24726}
24727impl ConfirmPaymentIntentPaymentMethodDataFpxBank {
24728    pub fn as_str(&self) -> &str {
24729        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
24730        match self {
24731            AffinBank => "affin_bank",
24732            Agrobank => "agrobank",
24733            AllianceBank => "alliance_bank",
24734            Ambank => "ambank",
24735            BankIslam => "bank_islam",
24736            BankMuamalat => "bank_muamalat",
24737            BankOfChina => "bank_of_china",
24738            BankRakyat => "bank_rakyat",
24739            Bsn => "bsn",
24740            Cimb => "cimb",
24741            DeutscheBank => "deutsche_bank",
24742            HongLeongBank => "hong_leong_bank",
24743            Hsbc => "hsbc",
24744            Kfh => "kfh",
24745            Maybank2e => "maybank2e",
24746            Maybank2u => "maybank2u",
24747            Ocbc => "ocbc",
24748            PbEnterprise => "pb_enterprise",
24749            PublicBank => "public_bank",
24750            Rhb => "rhb",
24751            StandardChartered => "standard_chartered",
24752            Uob => "uob",
24753            Unknown(v) => v,
24754        }
24755    }
24756}
24757
24758impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24759    type Err = std::convert::Infallible;
24760    fn from_str(s: &str) -> Result<Self, Self::Err> {
24761        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
24762        match s {
24763            "affin_bank" => Ok(AffinBank),
24764            "agrobank" => Ok(Agrobank),
24765            "alliance_bank" => Ok(AllianceBank),
24766            "ambank" => Ok(Ambank),
24767            "bank_islam" => Ok(BankIslam),
24768            "bank_muamalat" => Ok(BankMuamalat),
24769            "bank_of_china" => Ok(BankOfChina),
24770            "bank_rakyat" => Ok(BankRakyat),
24771            "bsn" => Ok(Bsn),
24772            "cimb" => Ok(Cimb),
24773            "deutsche_bank" => Ok(DeutscheBank),
24774            "hong_leong_bank" => Ok(HongLeongBank),
24775            "hsbc" => Ok(Hsbc),
24776            "kfh" => Ok(Kfh),
24777            "maybank2e" => Ok(Maybank2e),
24778            "maybank2u" => Ok(Maybank2u),
24779            "ocbc" => Ok(Ocbc),
24780            "pb_enterprise" => Ok(PbEnterprise),
24781            "public_bank" => Ok(PublicBank),
24782            "rhb" => Ok(Rhb),
24783            "standard_chartered" => Ok(StandardChartered),
24784            "uob" => Ok(Uob),
24785            v => Ok(Unknown(v.to_owned())),
24786        }
24787    }
24788}
24789impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24790    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24791        f.write_str(self.as_str())
24792    }
24793}
24794
24795impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24796    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24797        f.write_str(self.as_str())
24798    }
24799}
24800impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24801    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24802    where
24803        S: serde::Serializer,
24804    {
24805        serializer.serialize_str(self.as_str())
24806    }
24807}
24808#[cfg(feature = "deserialize")]
24809impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxBank {
24810    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24811        use std::str::FromStr;
24812        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24813        Ok(Self::from_str(&s).unwrap())
24814    }
24815}
24816/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
24817#[derive(Clone, Debug, serde::Serialize)]
24818pub struct ConfirmPaymentIntentPaymentMethodDataIdeal {
24819    /// The customer's bank.
24820    /// Only use this parameter for existing customers.
24821    /// Don't use it for new customers.
24822    #[serde(skip_serializing_if = "Option::is_none")]
24823    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataIdealBank>,
24824}
24825impl ConfirmPaymentIntentPaymentMethodDataIdeal {
24826    pub fn new() -> Self {
24827        Self { bank: None }
24828    }
24829}
24830impl Default for ConfirmPaymentIntentPaymentMethodDataIdeal {
24831    fn default() -> Self {
24832        Self::new()
24833    }
24834}
24835/// The customer's bank.
24836/// Only use this parameter for existing customers.
24837/// Don't use it for new customers.
24838#[derive(Clone, Eq, PartialEq)]
24839#[non_exhaustive]
24840pub enum ConfirmPaymentIntentPaymentMethodDataIdealBank {
24841    AbnAmro,
24842    AsnBank,
24843    Bunq,
24844    Buut,
24845    Handelsbanken,
24846    Ing,
24847    Knab,
24848    Moneyou,
24849    N26,
24850    Nn,
24851    Rabobank,
24852    Regiobank,
24853    Revolut,
24854    SnsBank,
24855    TriodosBank,
24856    VanLanschot,
24857    Yoursafe,
24858    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24859    Unknown(String),
24860}
24861impl ConfirmPaymentIntentPaymentMethodDataIdealBank {
24862    pub fn as_str(&self) -> &str {
24863        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
24864        match self {
24865            AbnAmro => "abn_amro",
24866            AsnBank => "asn_bank",
24867            Bunq => "bunq",
24868            Buut => "buut",
24869            Handelsbanken => "handelsbanken",
24870            Ing => "ing",
24871            Knab => "knab",
24872            Moneyou => "moneyou",
24873            N26 => "n26",
24874            Nn => "nn",
24875            Rabobank => "rabobank",
24876            Regiobank => "regiobank",
24877            Revolut => "revolut",
24878            SnsBank => "sns_bank",
24879            TriodosBank => "triodos_bank",
24880            VanLanschot => "van_lanschot",
24881            Yoursafe => "yoursafe",
24882            Unknown(v) => v,
24883        }
24884    }
24885}
24886
24887impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataIdealBank {
24888    type Err = std::convert::Infallible;
24889    fn from_str(s: &str) -> Result<Self, Self::Err> {
24890        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
24891        match s {
24892            "abn_amro" => Ok(AbnAmro),
24893            "asn_bank" => Ok(AsnBank),
24894            "bunq" => Ok(Bunq),
24895            "buut" => Ok(Buut),
24896            "handelsbanken" => Ok(Handelsbanken),
24897            "ing" => Ok(Ing),
24898            "knab" => Ok(Knab),
24899            "moneyou" => Ok(Moneyou),
24900            "n26" => Ok(N26),
24901            "nn" => Ok(Nn),
24902            "rabobank" => Ok(Rabobank),
24903            "regiobank" => Ok(Regiobank),
24904            "revolut" => Ok(Revolut),
24905            "sns_bank" => Ok(SnsBank),
24906            "triodos_bank" => Ok(TriodosBank),
24907            "van_lanschot" => Ok(VanLanschot),
24908            "yoursafe" => Ok(Yoursafe),
24909            v => Ok(Unknown(v.to_owned())),
24910        }
24911    }
24912}
24913impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataIdealBank {
24914    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24915        f.write_str(self.as_str())
24916    }
24917}
24918
24919impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataIdealBank {
24920    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24921        f.write_str(self.as_str())
24922    }
24923}
24924impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataIdealBank {
24925    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24926    where
24927        S: serde::Serializer,
24928    {
24929        serializer.serialize_str(self.as_str())
24930    }
24931}
24932#[cfg(feature = "deserialize")]
24933impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataIdealBank {
24934    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24935        use std::str::FromStr;
24936        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24937        Ok(Self::from_str(&s).unwrap())
24938    }
24939}
24940/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
24941#[derive(Copy, Clone, Debug, serde::Serialize)]
24942pub struct ConfirmPaymentIntentPaymentMethodDataKlarna {
24943    /// Customer's date of birth
24944    #[serde(skip_serializing_if = "Option::is_none")]
24945    pub dob: Option<DateOfBirth>,
24946}
24947impl ConfirmPaymentIntentPaymentMethodDataKlarna {
24948    pub fn new() -> Self {
24949        Self { dob: None }
24950    }
24951}
24952impl Default for ConfirmPaymentIntentPaymentMethodDataKlarna {
24953    fn default() -> Self {
24954        Self::new()
24955    }
24956}
24957/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
24958#[derive(Copy, Clone, Debug, serde::Serialize)]
24959pub struct ConfirmPaymentIntentPaymentMethodDataNaverPay {
24960    /// Whether to use Naver Pay points or a card to fund this transaction.
24961    /// If not provided, this defaults to `card`.
24962    #[serde(skip_serializing_if = "Option::is_none")]
24963    pub funding: Option<ConfirmPaymentIntentPaymentMethodDataNaverPayFunding>,
24964}
24965impl ConfirmPaymentIntentPaymentMethodDataNaverPay {
24966    pub fn new() -> Self {
24967        Self { funding: None }
24968    }
24969}
24970impl Default for ConfirmPaymentIntentPaymentMethodDataNaverPay {
24971    fn default() -> Self {
24972        Self::new()
24973    }
24974}
24975/// Whether to use Naver Pay points or a card to fund this transaction.
24976/// If not provided, this defaults to `card`.
24977#[derive(Copy, Clone, Eq, PartialEq)]
24978pub enum ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
24979    Card,
24980    Points,
24981}
24982impl ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
24983    pub fn as_str(self) -> &'static str {
24984        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
24985        match self {
24986            Card => "card",
24987            Points => "points",
24988        }
24989    }
24990}
24991
24992impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
24993    type Err = stripe_types::StripeParseError;
24994    fn from_str(s: &str) -> Result<Self, Self::Err> {
24995        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
24996        match s {
24997            "card" => Ok(Card),
24998            "points" => Ok(Points),
24999            _ => Err(stripe_types::StripeParseError),
25000        }
25001    }
25002}
25003impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25005        f.write_str(self.as_str())
25006    }
25007}
25008
25009impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25010    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25011        f.write_str(self.as_str())
25012    }
25013}
25014impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25015    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25016    where
25017        S: serde::Serializer,
25018    {
25019        serializer.serialize_str(self.as_str())
25020    }
25021}
25022#[cfg(feature = "deserialize")]
25023impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
25024    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25025        use std::str::FromStr;
25026        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25027        Self::from_str(&s).map_err(|_| {
25028            serde::de::Error::custom(
25029                "Unknown value for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding",
25030            )
25031        })
25032    }
25033}
25034/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
25035#[derive(Clone, Debug, serde::Serialize)]
25036pub struct ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
25037    /// The name on the bank account.
25038    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
25039    #[serde(skip_serializing_if = "Option::is_none")]
25040    pub account_holder_name: Option<String>,
25041    /// The account number for the bank account.
25042    pub account_number: String,
25043    /// The numeric code for the bank account's bank.
25044    pub bank_code: String,
25045    /// The numeric code for the bank account's bank branch.
25046    pub branch_code: String,
25047    #[serde(skip_serializing_if = "Option::is_none")]
25048    pub reference: Option<String>,
25049    /// The suffix of the bank account number.
25050    pub suffix: String,
25051}
25052impl ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
25053    pub fn new(
25054        account_number: impl Into<String>,
25055        bank_code: impl Into<String>,
25056        branch_code: impl Into<String>,
25057        suffix: impl Into<String>,
25058    ) -> Self {
25059        Self {
25060            account_holder_name: None,
25061            account_number: account_number.into(),
25062            bank_code: bank_code.into(),
25063            branch_code: branch_code.into(),
25064            reference: None,
25065            suffix: suffix.into(),
25066        }
25067    }
25068}
25069/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
25070#[derive(Clone, Debug, serde::Serialize)]
25071pub struct ConfirmPaymentIntentPaymentMethodDataP24 {
25072    /// The customer's bank.
25073    #[serde(skip_serializing_if = "Option::is_none")]
25074    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataP24Bank>,
25075}
25076impl ConfirmPaymentIntentPaymentMethodDataP24 {
25077    pub fn new() -> Self {
25078        Self { bank: None }
25079    }
25080}
25081impl Default for ConfirmPaymentIntentPaymentMethodDataP24 {
25082    fn default() -> Self {
25083        Self::new()
25084    }
25085}
25086/// The customer's bank.
25087#[derive(Clone, Eq, PartialEq)]
25088#[non_exhaustive]
25089pub enum ConfirmPaymentIntentPaymentMethodDataP24Bank {
25090    AliorBank,
25091    BankMillennium,
25092    BankNowyBfgSa,
25093    BankPekaoSa,
25094    BankiSpbdzielcze,
25095    Blik,
25096    BnpParibas,
25097    Boz,
25098    CitiHandlowy,
25099    CreditAgricole,
25100    Envelobank,
25101    EtransferPocztowy24,
25102    GetinBank,
25103    Ideabank,
25104    Ing,
25105    Inteligo,
25106    MbankMtransfer,
25107    NestPrzelew,
25108    NoblePay,
25109    PbacZIpko,
25110    PlusBank,
25111    SantanderPrzelew24,
25112    TmobileUsbugiBankowe,
25113    ToyotaBank,
25114    Velobank,
25115    VolkswagenBank,
25116    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25117    Unknown(String),
25118}
25119impl ConfirmPaymentIntentPaymentMethodDataP24Bank {
25120    pub fn as_str(&self) -> &str {
25121        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
25122        match self {
25123            AliorBank => "alior_bank",
25124            BankMillennium => "bank_millennium",
25125            BankNowyBfgSa => "bank_nowy_bfg_sa",
25126            BankPekaoSa => "bank_pekao_sa",
25127            BankiSpbdzielcze => "banki_spbdzielcze",
25128            Blik => "blik",
25129            BnpParibas => "bnp_paribas",
25130            Boz => "boz",
25131            CitiHandlowy => "citi_handlowy",
25132            CreditAgricole => "credit_agricole",
25133            Envelobank => "envelobank",
25134            EtransferPocztowy24 => "etransfer_pocztowy24",
25135            GetinBank => "getin_bank",
25136            Ideabank => "ideabank",
25137            Ing => "ing",
25138            Inteligo => "inteligo",
25139            MbankMtransfer => "mbank_mtransfer",
25140            NestPrzelew => "nest_przelew",
25141            NoblePay => "noble_pay",
25142            PbacZIpko => "pbac_z_ipko",
25143            PlusBank => "plus_bank",
25144            SantanderPrzelew24 => "santander_przelew24",
25145            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
25146            ToyotaBank => "toyota_bank",
25147            Velobank => "velobank",
25148            VolkswagenBank => "volkswagen_bank",
25149            Unknown(v) => v,
25150        }
25151    }
25152}
25153
25154impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25155    type Err = std::convert::Infallible;
25156    fn from_str(s: &str) -> Result<Self, Self::Err> {
25157        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
25158        match s {
25159            "alior_bank" => Ok(AliorBank),
25160            "bank_millennium" => Ok(BankMillennium),
25161            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
25162            "bank_pekao_sa" => Ok(BankPekaoSa),
25163            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
25164            "blik" => Ok(Blik),
25165            "bnp_paribas" => Ok(BnpParibas),
25166            "boz" => Ok(Boz),
25167            "citi_handlowy" => Ok(CitiHandlowy),
25168            "credit_agricole" => Ok(CreditAgricole),
25169            "envelobank" => Ok(Envelobank),
25170            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
25171            "getin_bank" => Ok(GetinBank),
25172            "ideabank" => Ok(Ideabank),
25173            "ing" => Ok(Ing),
25174            "inteligo" => Ok(Inteligo),
25175            "mbank_mtransfer" => Ok(MbankMtransfer),
25176            "nest_przelew" => Ok(NestPrzelew),
25177            "noble_pay" => Ok(NoblePay),
25178            "pbac_z_ipko" => Ok(PbacZIpko),
25179            "plus_bank" => Ok(PlusBank),
25180            "santander_przelew24" => Ok(SantanderPrzelew24),
25181            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
25182            "toyota_bank" => Ok(ToyotaBank),
25183            "velobank" => Ok(Velobank),
25184            "volkswagen_bank" => Ok(VolkswagenBank),
25185            v => Ok(Unknown(v.to_owned())),
25186        }
25187    }
25188}
25189impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25190    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25191        f.write_str(self.as_str())
25192    }
25193}
25194
25195impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25196    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25197        f.write_str(self.as_str())
25198    }
25199}
25200impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25201    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25202    where
25203        S: serde::Serializer,
25204    {
25205        serializer.serialize_str(self.as_str())
25206    }
25207}
25208#[cfg(feature = "deserialize")]
25209impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataP24Bank {
25210    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25211        use std::str::FromStr;
25212        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25213        Ok(Self::from_str(&s).unwrap())
25214    }
25215}
25216/// Options to configure Radar.
25217/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
25218#[derive(Clone, Debug, serde::Serialize)]
25219pub struct ConfirmPaymentIntentPaymentMethodDataRadarOptions {
25220    /// 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.
25221    #[serde(skip_serializing_if = "Option::is_none")]
25222    pub session: Option<String>,
25223}
25224impl ConfirmPaymentIntentPaymentMethodDataRadarOptions {
25225    pub fn new() -> Self {
25226        Self { session: None }
25227    }
25228}
25229impl Default for ConfirmPaymentIntentPaymentMethodDataRadarOptions {
25230    fn default() -> Self {
25231        Self::new()
25232    }
25233}
25234/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
25235#[derive(Clone, Debug, serde::Serialize)]
25236pub struct ConfirmPaymentIntentPaymentMethodDataSepaDebit {
25237    /// IBAN of the bank account.
25238    pub iban: String,
25239}
25240impl ConfirmPaymentIntentPaymentMethodDataSepaDebit {
25241    pub fn new(iban: impl Into<String>) -> Self {
25242        Self { iban: iban.into() }
25243    }
25244}
25245/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
25246#[derive(Copy, Clone, Debug, serde::Serialize)]
25247pub struct ConfirmPaymentIntentPaymentMethodDataSofort {
25248    /// Two-letter ISO code representing the country the bank account is located in.
25249    pub country: ConfirmPaymentIntentPaymentMethodDataSofortCountry,
25250}
25251impl ConfirmPaymentIntentPaymentMethodDataSofort {
25252    pub fn new(country: impl Into<ConfirmPaymentIntentPaymentMethodDataSofortCountry>) -> Self {
25253        Self { country: country.into() }
25254    }
25255}
25256/// Two-letter ISO code representing the country the bank account is located in.
25257#[derive(Copy, Clone, Eq, PartialEq)]
25258pub enum ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25259    At,
25260    Be,
25261    De,
25262    Es,
25263    It,
25264    Nl,
25265}
25266impl ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25267    pub fn as_str(self) -> &'static str {
25268        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
25269        match self {
25270            At => "AT",
25271            Be => "BE",
25272            De => "DE",
25273            Es => "ES",
25274            It => "IT",
25275            Nl => "NL",
25276        }
25277    }
25278}
25279
25280impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25281    type Err = stripe_types::StripeParseError;
25282    fn from_str(s: &str) -> Result<Self, Self::Err> {
25283        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
25284        match s {
25285            "AT" => Ok(At),
25286            "BE" => Ok(Be),
25287            "DE" => Ok(De),
25288            "ES" => Ok(Es),
25289            "IT" => Ok(It),
25290            "NL" => Ok(Nl),
25291            _ => Err(stripe_types::StripeParseError),
25292        }
25293    }
25294}
25295impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25297        f.write_str(self.as_str())
25298    }
25299}
25300
25301impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25302    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25303        f.write_str(self.as_str())
25304    }
25305}
25306impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25307    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25308    where
25309        S: serde::Serializer,
25310    {
25311        serializer.serialize_str(self.as_str())
25312    }
25313}
25314#[cfg(feature = "deserialize")]
25315impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
25316    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25317        use std::str::FromStr;
25318        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25319        Self::from_str(&s).map_err(|_| {
25320            serde::de::Error::custom(
25321                "Unknown value for ConfirmPaymentIntentPaymentMethodDataSofortCountry",
25322            )
25323        })
25324    }
25325}
25326/// The type of the PaymentMethod.
25327/// An additional hash is included on the PaymentMethod with a name matching this value.
25328/// It contains additional information specific to the PaymentMethod type.
25329#[derive(Clone, Eq, PartialEq)]
25330#[non_exhaustive]
25331pub enum ConfirmPaymentIntentPaymentMethodDataType {
25332    AcssDebit,
25333    Affirm,
25334    AfterpayClearpay,
25335    Alipay,
25336    Alma,
25337    AmazonPay,
25338    AuBecsDebit,
25339    BacsDebit,
25340    Bancontact,
25341    Billie,
25342    Blik,
25343    Boleto,
25344    Cashapp,
25345    Crypto,
25346    CustomerBalance,
25347    Eps,
25348    Fpx,
25349    Giropay,
25350    Grabpay,
25351    Ideal,
25352    KakaoPay,
25353    Klarna,
25354    Konbini,
25355    KrCard,
25356    Link,
25357    MbWay,
25358    Mobilepay,
25359    Multibanco,
25360    NaverPay,
25361    NzBankAccount,
25362    Oxxo,
25363    P24,
25364    PayByBank,
25365    Payco,
25366    Paynow,
25367    Paypal,
25368    Pix,
25369    Promptpay,
25370    RevolutPay,
25371    SamsungPay,
25372    Satispay,
25373    SepaDebit,
25374    Sofort,
25375    Swish,
25376    Twint,
25377    UsBankAccount,
25378    WechatPay,
25379    Zip,
25380    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25381    Unknown(String),
25382}
25383impl ConfirmPaymentIntentPaymentMethodDataType {
25384    pub fn as_str(&self) -> &str {
25385        use ConfirmPaymentIntentPaymentMethodDataType::*;
25386        match self {
25387            AcssDebit => "acss_debit",
25388            Affirm => "affirm",
25389            AfterpayClearpay => "afterpay_clearpay",
25390            Alipay => "alipay",
25391            Alma => "alma",
25392            AmazonPay => "amazon_pay",
25393            AuBecsDebit => "au_becs_debit",
25394            BacsDebit => "bacs_debit",
25395            Bancontact => "bancontact",
25396            Billie => "billie",
25397            Blik => "blik",
25398            Boleto => "boleto",
25399            Cashapp => "cashapp",
25400            Crypto => "crypto",
25401            CustomerBalance => "customer_balance",
25402            Eps => "eps",
25403            Fpx => "fpx",
25404            Giropay => "giropay",
25405            Grabpay => "grabpay",
25406            Ideal => "ideal",
25407            KakaoPay => "kakao_pay",
25408            Klarna => "klarna",
25409            Konbini => "konbini",
25410            KrCard => "kr_card",
25411            Link => "link",
25412            MbWay => "mb_way",
25413            Mobilepay => "mobilepay",
25414            Multibanco => "multibanco",
25415            NaverPay => "naver_pay",
25416            NzBankAccount => "nz_bank_account",
25417            Oxxo => "oxxo",
25418            P24 => "p24",
25419            PayByBank => "pay_by_bank",
25420            Payco => "payco",
25421            Paynow => "paynow",
25422            Paypal => "paypal",
25423            Pix => "pix",
25424            Promptpay => "promptpay",
25425            RevolutPay => "revolut_pay",
25426            SamsungPay => "samsung_pay",
25427            Satispay => "satispay",
25428            SepaDebit => "sepa_debit",
25429            Sofort => "sofort",
25430            Swish => "swish",
25431            Twint => "twint",
25432            UsBankAccount => "us_bank_account",
25433            WechatPay => "wechat_pay",
25434            Zip => "zip",
25435            Unknown(v) => v,
25436        }
25437    }
25438}
25439
25440impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataType {
25441    type Err = std::convert::Infallible;
25442    fn from_str(s: &str) -> Result<Self, Self::Err> {
25443        use ConfirmPaymentIntentPaymentMethodDataType::*;
25444        match s {
25445            "acss_debit" => Ok(AcssDebit),
25446            "affirm" => Ok(Affirm),
25447            "afterpay_clearpay" => Ok(AfterpayClearpay),
25448            "alipay" => Ok(Alipay),
25449            "alma" => Ok(Alma),
25450            "amazon_pay" => Ok(AmazonPay),
25451            "au_becs_debit" => Ok(AuBecsDebit),
25452            "bacs_debit" => Ok(BacsDebit),
25453            "bancontact" => Ok(Bancontact),
25454            "billie" => Ok(Billie),
25455            "blik" => Ok(Blik),
25456            "boleto" => Ok(Boleto),
25457            "cashapp" => Ok(Cashapp),
25458            "crypto" => Ok(Crypto),
25459            "customer_balance" => Ok(CustomerBalance),
25460            "eps" => Ok(Eps),
25461            "fpx" => Ok(Fpx),
25462            "giropay" => Ok(Giropay),
25463            "grabpay" => Ok(Grabpay),
25464            "ideal" => Ok(Ideal),
25465            "kakao_pay" => Ok(KakaoPay),
25466            "klarna" => Ok(Klarna),
25467            "konbini" => Ok(Konbini),
25468            "kr_card" => Ok(KrCard),
25469            "link" => Ok(Link),
25470            "mb_way" => Ok(MbWay),
25471            "mobilepay" => Ok(Mobilepay),
25472            "multibanco" => Ok(Multibanco),
25473            "naver_pay" => Ok(NaverPay),
25474            "nz_bank_account" => Ok(NzBankAccount),
25475            "oxxo" => Ok(Oxxo),
25476            "p24" => Ok(P24),
25477            "pay_by_bank" => Ok(PayByBank),
25478            "payco" => Ok(Payco),
25479            "paynow" => Ok(Paynow),
25480            "paypal" => Ok(Paypal),
25481            "pix" => Ok(Pix),
25482            "promptpay" => Ok(Promptpay),
25483            "revolut_pay" => Ok(RevolutPay),
25484            "samsung_pay" => Ok(SamsungPay),
25485            "satispay" => Ok(Satispay),
25486            "sepa_debit" => Ok(SepaDebit),
25487            "sofort" => Ok(Sofort),
25488            "swish" => Ok(Swish),
25489            "twint" => Ok(Twint),
25490            "us_bank_account" => Ok(UsBankAccount),
25491            "wechat_pay" => Ok(WechatPay),
25492            "zip" => Ok(Zip),
25493            v => Ok(Unknown(v.to_owned())),
25494        }
25495    }
25496}
25497impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataType {
25498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25499        f.write_str(self.as_str())
25500    }
25501}
25502
25503impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataType {
25504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25505        f.write_str(self.as_str())
25506    }
25507}
25508impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataType {
25509    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25510    where
25511        S: serde::Serializer,
25512    {
25513        serializer.serialize_str(self.as_str())
25514    }
25515}
25516#[cfg(feature = "deserialize")]
25517impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataType {
25518    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25519        use std::str::FromStr;
25520        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25521        Ok(Self::from_str(&s).unwrap())
25522    }
25523}
25524/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
25525#[derive(Clone, Debug, serde::Serialize)]
25526pub struct ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
25527    /// Account holder type: individual or company.
25528    #[serde(skip_serializing_if = "Option::is_none")]
25529    pub account_holder_type:
25530        Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
25531    /// Account number of the bank account.
25532    #[serde(skip_serializing_if = "Option::is_none")]
25533    pub account_number: Option<String>,
25534    /// Account type: checkings or savings. Defaults to checking if omitted.
25535    #[serde(skip_serializing_if = "Option::is_none")]
25536    pub account_type: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType>,
25537    /// The ID of a Financial Connections Account to use as a payment method.
25538    #[serde(skip_serializing_if = "Option::is_none")]
25539    pub financial_connections_account: Option<String>,
25540    /// Routing number of the bank account.
25541    #[serde(skip_serializing_if = "Option::is_none")]
25542    pub routing_number: Option<String>,
25543}
25544impl ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
25545    pub fn new() -> Self {
25546        Self {
25547            account_holder_type: None,
25548            account_number: None,
25549            account_type: None,
25550            financial_connections_account: None,
25551            routing_number: None,
25552        }
25553    }
25554}
25555impl Default for ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
25556    fn default() -> Self {
25557        Self::new()
25558    }
25559}
25560/// Account holder type: individual or company.
25561#[derive(Copy, Clone, Eq, PartialEq)]
25562pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25563    Company,
25564    Individual,
25565}
25566impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25567    pub fn as_str(self) -> &'static str {
25568        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
25569        match self {
25570            Company => "company",
25571            Individual => "individual",
25572        }
25573    }
25574}
25575
25576impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25577    type Err = stripe_types::StripeParseError;
25578    fn from_str(s: &str) -> Result<Self, Self::Err> {
25579        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
25580        match s {
25581            "company" => Ok(Company),
25582            "individual" => Ok(Individual),
25583            _ => Err(stripe_types::StripeParseError),
25584        }
25585    }
25586}
25587impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25589        f.write_str(self.as_str())
25590    }
25591}
25592
25593impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25594    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25595        f.write_str(self.as_str())
25596    }
25597}
25598impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
25599    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25600    where
25601        S: serde::Serializer,
25602    {
25603        serializer.serialize_str(self.as_str())
25604    }
25605}
25606#[cfg(feature = "deserialize")]
25607impl<'de> serde::Deserialize<'de>
25608    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
25609{
25610    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25611        use std::str::FromStr;
25612        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25613        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"))
25614    }
25615}
25616/// Account type: checkings or savings. Defaults to checking if omitted.
25617#[derive(Copy, Clone, Eq, PartialEq)]
25618pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25619    Checking,
25620    Savings,
25621}
25622impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25623    pub fn as_str(self) -> &'static str {
25624        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
25625        match self {
25626            Checking => "checking",
25627            Savings => "savings",
25628        }
25629    }
25630}
25631
25632impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25633    type Err = stripe_types::StripeParseError;
25634    fn from_str(s: &str) -> Result<Self, Self::Err> {
25635        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
25636        match s {
25637            "checking" => Ok(Checking),
25638            "savings" => Ok(Savings),
25639            _ => Err(stripe_types::StripeParseError),
25640        }
25641    }
25642}
25643impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25644    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25645        f.write_str(self.as_str())
25646    }
25647}
25648
25649impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25650    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25651        f.write_str(self.as_str())
25652    }
25653}
25654impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
25655    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25656    where
25657        S: serde::Serializer,
25658    {
25659        serializer.serialize_str(self.as_str())
25660    }
25661}
25662#[cfg(feature = "deserialize")]
25663impl<'de> serde::Deserialize<'de>
25664    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType
25665{
25666    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25667        use std::str::FromStr;
25668        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25669        Self::from_str(&s).map_err(|_| {
25670            serde::de::Error::custom(
25671                "Unknown value for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType",
25672            )
25673        })
25674    }
25675}
25676/// Payment method-specific configuration for this PaymentIntent.
25677#[derive(Clone, Debug, serde::Serialize)]
25678pub struct ConfirmPaymentIntentPaymentMethodOptions {
25679    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
25680    #[serde(skip_serializing_if = "Option::is_none")]
25681    pub acss_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebit>,
25682    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
25683    #[serde(skip_serializing_if = "Option::is_none")]
25684    pub affirm: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirm>,
25685    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
25686    #[serde(skip_serializing_if = "Option::is_none")]
25687    pub afterpay_clearpay: Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay>,
25688    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
25689    #[serde(skip_serializing_if = "Option::is_none")]
25690    pub alipay: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipay>,
25691    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
25692    #[serde(skip_serializing_if = "Option::is_none")]
25693    pub alma: Option<ConfirmPaymentIntentPaymentMethodOptionsAlma>,
25694    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
25695    #[serde(skip_serializing_if = "Option::is_none")]
25696    pub amazon_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPay>,
25697    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
25698    #[serde(skip_serializing_if = "Option::is_none")]
25699    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit>,
25700    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
25701    #[serde(skip_serializing_if = "Option::is_none")]
25702    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebit>,
25703    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
25704    #[serde(skip_serializing_if = "Option::is_none")]
25705    pub bancontact: Option<ConfirmPaymentIntentPaymentMethodOptionsBancontact>,
25706    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
25707    #[serde(skip_serializing_if = "Option::is_none")]
25708    pub billie: Option<ConfirmPaymentIntentPaymentMethodOptionsBillie>,
25709    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
25710    #[serde(skip_serializing_if = "Option::is_none")]
25711    pub blik: Option<ConfirmPaymentIntentPaymentMethodOptionsBlik>,
25712    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
25713    #[serde(skip_serializing_if = "Option::is_none")]
25714    pub boleto: Option<ConfirmPaymentIntentPaymentMethodOptionsBoleto>,
25715    /// Configuration for any card payments attempted on this PaymentIntent.
25716    #[serde(skip_serializing_if = "Option::is_none")]
25717    pub card: Option<ConfirmPaymentIntentPaymentMethodOptionsCard>,
25718    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
25719    #[serde(skip_serializing_if = "Option::is_none")]
25720    pub card_present: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresent>,
25721    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
25722    #[serde(skip_serializing_if = "Option::is_none")]
25723    pub cashapp: Option<ConfirmPaymentIntentPaymentMethodOptionsCashapp>,
25724    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
25725    #[serde(skip_serializing_if = "Option::is_none")]
25726    pub crypto: Option<ConfirmPaymentIntentPaymentMethodOptionsCrypto>,
25727    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
25728    #[serde(skip_serializing_if = "Option::is_none")]
25729    pub customer_balance: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance>,
25730    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
25731    #[serde(skip_serializing_if = "Option::is_none")]
25732    pub eps: Option<ConfirmPaymentIntentPaymentMethodOptionsEps>,
25733    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
25734    #[serde(skip_serializing_if = "Option::is_none")]
25735    pub fpx: Option<ConfirmPaymentIntentPaymentMethodOptionsFpx>,
25736    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
25737    #[serde(skip_serializing_if = "Option::is_none")]
25738    pub giropay: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropay>,
25739    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
25740    #[serde(skip_serializing_if = "Option::is_none")]
25741    pub grabpay: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpay>,
25742    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
25743    #[serde(skip_serializing_if = "Option::is_none")]
25744    pub ideal: Option<ConfirmPaymentIntentPaymentMethodOptionsIdeal>,
25745    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
25746    #[serde(skip_serializing_if = "Option::is_none")]
25747    #[serde(with = "stripe_types::with_serde_json_opt")]
25748    pub interac_present: Option<miniserde::json::Value>,
25749    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
25750    #[serde(skip_serializing_if = "Option::is_none")]
25751    pub kakao_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPay>,
25752    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
25753    #[serde(skip_serializing_if = "Option::is_none")]
25754    pub klarna: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarna>,
25755    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
25756    #[serde(skip_serializing_if = "Option::is_none")]
25757    pub konbini: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbini>,
25758    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
25759    #[serde(skip_serializing_if = "Option::is_none")]
25760    pub kr_card: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCard>,
25761    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
25762    #[serde(skip_serializing_if = "Option::is_none")]
25763    pub link: Option<ConfirmPaymentIntentPaymentMethodOptionsLink>,
25764    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
25765    #[serde(skip_serializing_if = "Option::is_none")]
25766    pub mb_way: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWay>,
25767    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
25768    #[serde(skip_serializing_if = "Option::is_none")]
25769    pub mobilepay: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepay>,
25770    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
25771    #[serde(skip_serializing_if = "Option::is_none")]
25772    pub multibanco: Option<ConfirmPaymentIntentPaymentMethodOptionsMultibanco>,
25773    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
25774    #[serde(skip_serializing_if = "Option::is_none")]
25775    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPay>,
25776    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
25777    #[serde(skip_serializing_if = "Option::is_none")]
25778    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount>,
25779    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
25780    #[serde(skip_serializing_if = "Option::is_none")]
25781    pub oxxo: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxo>,
25782    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
25783    #[serde(skip_serializing_if = "Option::is_none")]
25784    pub p24: Option<ConfirmPaymentIntentPaymentMethodOptionsP24>,
25785    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
25786    #[serde(skip_serializing_if = "Option::is_none")]
25787    #[serde(with = "stripe_types::with_serde_json_opt")]
25788    pub pay_by_bank: Option<miniserde::json::Value>,
25789    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
25790    #[serde(skip_serializing_if = "Option::is_none")]
25791    pub payco: Option<ConfirmPaymentIntentPaymentMethodOptionsPayco>,
25792    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
25793    #[serde(skip_serializing_if = "Option::is_none")]
25794    pub paynow: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynow>,
25795    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
25796    #[serde(skip_serializing_if = "Option::is_none")]
25797    pub paypal: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypal>,
25798    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
25799    #[serde(skip_serializing_if = "Option::is_none")]
25800    pub pix: Option<ConfirmPaymentIntentPaymentMethodOptionsPix>,
25801    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
25802    #[serde(skip_serializing_if = "Option::is_none")]
25803    pub promptpay: Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpay>,
25804    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
25805    #[serde(skip_serializing_if = "Option::is_none")]
25806    pub revolut_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPay>,
25807    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
25808    #[serde(skip_serializing_if = "Option::is_none")]
25809    pub samsung_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPay>,
25810    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
25811    #[serde(skip_serializing_if = "Option::is_none")]
25812    pub satispay: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispay>,
25813    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
25814    #[serde(skip_serializing_if = "Option::is_none")]
25815    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebit>,
25816    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
25817    #[serde(skip_serializing_if = "Option::is_none")]
25818    pub sofort: Option<ConfirmPaymentIntentPaymentMethodOptionsSofort>,
25819    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
25820    #[serde(skip_serializing_if = "Option::is_none")]
25821    pub swish: Option<ConfirmPaymentIntentPaymentMethodOptionsSwish>,
25822    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
25823    #[serde(skip_serializing_if = "Option::is_none")]
25824    pub twint: Option<ConfirmPaymentIntentPaymentMethodOptionsTwint>,
25825    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
25826    #[serde(skip_serializing_if = "Option::is_none")]
25827    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount>,
25828    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
25829    #[serde(skip_serializing_if = "Option::is_none")]
25830    pub wechat_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPay>,
25831    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
25832    #[serde(skip_serializing_if = "Option::is_none")]
25833    pub zip: Option<ConfirmPaymentIntentPaymentMethodOptionsZip>,
25834}
25835impl ConfirmPaymentIntentPaymentMethodOptions {
25836    pub fn new() -> Self {
25837        Self {
25838            acss_debit: None,
25839            affirm: None,
25840            afterpay_clearpay: None,
25841            alipay: None,
25842            alma: None,
25843            amazon_pay: None,
25844            au_becs_debit: None,
25845            bacs_debit: None,
25846            bancontact: None,
25847            billie: None,
25848            blik: None,
25849            boleto: None,
25850            card: None,
25851            card_present: None,
25852            cashapp: None,
25853            crypto: None,
25854            customer_balance: None,
25855            eps: None,
25856            fpx: None,
25857            giropay: None,
25858            grabpay: None,
25859            ideal: None,
25860            interac_present: None,
25861            kakao_pay: None,
25862            klarna: None,
25863            konbini: None,
25864            kr_card: None,
25865            link: None,
25866            mb_way: None,
25867            mobilepay: None,
25868            multibanco: None,
25869            naver_pay: None,
25870            nz_bank_account: None,
25871            oxxo: None,
25872            p24: None,
25873            pay_by_bank: None,
25874            payco: None,
25875            paynow: None,
25876            paypal: None,
25877            pix: None,
25878            promptpay: None,
25879            revolut_pay: None,
25880            samsung_pay: None,
25881            satispay: None,
25882            sepa_debit: None,
25883            sofort: None,
25884            swish: None,
25885            twint: None,
25886            us_bank_account: None,
25887            wechat_pay: None,
25888            zip: None,
25889        }
25890    }
25891}
25892impl Default for ConfirmPaymentIntentPaymentMethodOptions {
25893    fn default() -> Self {
25894        Self::new()
25895    }
25896}
25897/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
25898#[derive(Clone, Debug, serde::Serialize)]
25899pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
25900    /// Additional fields for Mandate creation
25901    #[serde(skip_serializing_if = "Option::is_none")]
25902    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
25903    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
25904    ///
25905    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
25906    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
25907    ///
25908    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
25909    ///
25910    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
25911    ///
25912    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
25913    #[serde(skip_serializing_if = "Option::is_none")]
25914    pub setup_future_usage:
25915        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
25916    /// Controls when Stripe will attempt to debit the funds from the customer's account.
25917    /// The date must be a string in YYYY-MM-DD format.
25918    /// The date must be in the future and between 3 and 15 calendar days from now.
25919    #[serde(skip_serializing_if = "Option::is_none")]
25920    pub target_date: Option<String>,
25921    /// Bank account verification method.
25922    #[serde(skip_serializing_if = "Option::is_none")]
25923    pub verification_method:
25924        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
25925}
25926impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
25927    pub fn new() -> Self {
25928        Self {
25929            mandate_options: None,
25930            setup_future_usage: None,
25931            target_date: None,
25932            verification_method: None,
25933        }
25934    }
25935}
25936impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
25937    fn default() -> Self {
25938        Self::new()
25939    }
25940}
25941/// Additional fields for Mandate creation
25942#[derive(Clone, Debug, serde::Serialize)]
25943pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
25944    /// A URL for custom mandate text to render during confirmation step.
25945    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
25946    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
25947    #[serde(skip_serializing_if = "Option::is_none")]
25948    pub custom_mandate_url: Option<String>,
25949    /// Description of the mandate interval.
25950    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
25951    #[serde(skip_serializing_if = "Option::is_none")]
25952    pub interval_description: Option<String>,
25953    /// Payment schedule for the mandate.
25954    #[serde(skip_serializing_if = "Option::is_none")]
25955    pub payment_schedule:
25956        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
25957    /// Transaction type of the mandate.
25958    #[serde(skip_serializing_if = "Option::is_none")]
25959    pub transaction_type:
25960        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
25961}
25962impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
25963    pub fn new() -> Self {
25964        Self {
25965            custom_mandate_url: None,
25966            interval_description: None,
25967            payment_schedule: None,
25968            transaction_type: None,
25969        }
25970    }
25971}
25972impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
25973    fn default() -> Self {
25974        Self::new()
25975    }
25976}
25977/// Payment schedule for the mandate.
25978#[derive(Copy, Clone, Eq, PartialEq)]
25979pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
25980    Combined,
25981    Interval,
25982    Sporadic,
25983}
25984impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
25985    pub fn as_str(self) -> &'static str {
25986        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
25987        match self {
25988            Combined => "combined",
25989            Interval => "interval",
25990            Sporadic => "sporadic",
25991        }
25992    }
25993}
25994
25995impl std::str::FromStr
25996    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
25997{
25998    type Err = stripe_types::StripeParseError;
25999    fn from_str(s: &str) -> Result<Self, Self::Err> {
26000        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
26001        match s {
26002            "combined" => Ok(Combined),
26003            "interval" => Ok(Interval),
26004            "sporadic" => Ok(Sporadic),
26005            _ => Err(stripe_types::StripeParseError),
26006        }
26007    }
26008}
26009impl std::fmt::Display
26010    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26011{
26012    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26013        f.write_str(self.as_str())
26014    }
26015}
26016
26017impl std::fmt::Debug
26018    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26019{
26020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26021        f.write_str(self.as_str())
26022    }
26023}
26024impl serde::Serialize
26025    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26026{
26027    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26028    where
26029        S: serde::Serializer,
26030    {
26031        serializer.serialize_str(self.as_str())
26032    }
26033}
26034#[cfg(feature = "deserialize")]
26035impl<'de> serde::Deserialize<'de>
26036    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
26037{
26038    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26039        use std::str::FromStr;
26040        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26041        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"))
26042    }
26043}
26044/// Transaction type of the mandate.
26045#[derive(Copy, Clone, Eq, PartialEq)]
26046pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
26047    Business,
26048    Personal,
26049}
26050impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
26051    pub fn as_str(self) -> &'static str {
26052        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
26053        match self {
26054            Business => "business",
26055            Personal => "personal",
26056        }
26057    }
26058}
26059
26060impl std::str::FromStr
26061    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26062{
26063    type Err = stripe_types::StripeParseError;
26064    fn from_str(s: &str) -> Result<Self, Self::Err> {
26065        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
26066        match s {
26067            "business" => Ok(Business),
26068            "personal" => Ok(Personal),
26069            _ => Err(stripe_types::StripeParseError),
26070        }
26071    }
26072}
26073impl std::fmt::Display
26074    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26075{
26076    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26077        f.write_str(self.as_str())
26078    }
26079}
26080
26081impl std::fmt::Debug
26082    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26083{
26084    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26085        f.write_str(self.as_str())
26086    }
26087}
26088impl serde::Serialize
26089    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26090{
26091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26092    where
26093        S: serde::Serializer,
26094    {
26095        serializer.serialize_str(self.as_str())
26096    }
26097}
26098#[cfg(feature = "deserialize")]
26099impl<'de> serde::Deserialize<'de>
26100    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
26101{
26102    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26103        use std::str::FromStr;
26104        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26105        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"))
26106    }
26107}
26108/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26109///
26110/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26111/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26112///
26113/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26114///
26115/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26116///
26117/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26118#[derive(Copy, Clone, Eq, PartialEq)]
26119pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26120    None,
26121    OffSession,
26122    OnSession,
26123}
26124impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26125    pub fn as_str(self) -> &'static str {
26126        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
26127        match self {
26128            None => "none",
26129            OffSession => "off_session",
26130            OnSession => "on_session",
26131        }
26132    }
26133}
26134
26135impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26136    type Err = stripe_types::StripeParseError;
26137    fn from_str(s: &str) -> Result<Self, Self::Err> {
26138        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
26139        match s {
26140            "none" => Ok(None),
26141            "off_session" => Ok(OffSession),
26142            "on_session" => Ok(OnSession),
26143            _ => Err(stripe_types::StripeParseError),
26144        }
26145    }
26146}
26147impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26149        f.write_str(self.as_str())
26150    }
26151}
26152
26153impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26155        f.write_str(self.as_str())
26156    }
26157}
26158impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
26159    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26160    where
26161        S: serde::Serializer,
26162    {
26163        serializer.serialize_str(self.as_str())
26164    }
26165}
26166#[cfg(feature = "deserialize")]
26167impl<'de> serde::Deserialize<'de>
26168    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
26169{
26170    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26171        use std::str::FromStr;
26172        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26173        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"))
26174    }
26175}
26176/// Bank account verification method.
26177#[derive(Copy, Clone, Eq, PartialEq)]
26178pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26179    Automatic,
26180    Instant,
26181    Microdeposits,
26182}
26183impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26184    pub fn as_str(self) -> &'static str {
26185        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
26186        match self {
26187            Automatic => "automatic",
26188            Instant => "instant",
26189            Microdeposits => "microdeposits",
26190        }
26191    }
26192}
26193
26194impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26195    type Err = stripe_types::StripeParseError;
26196    fn from_str(s: &str) -> Result<Self, Self::Err> {
26197        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
26198        match s {
26199            "automatic" => Ok(Automatic),
26200            "instant" => Ok(Instant),
26201            "microdeposits" => Ok(Microdeposits),
26202            _ => Err(stripe_types::StripeParseError),
26203        }
26204    }
26205}
26206impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26207    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26208        f.write_str(self.as_str())
26209    }
26210}
26211
26212impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26213    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26214        f.write_str(self.as_str())
26215    }
26216}
26217impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
26218    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26219    where
26220        S: serde::Serializer,
26221    {
26222        serializer.serialize_str(self.as_str())
26223    }
26224}
26225#[cfg(feature = "deserialize")]
26226impl<'de> serde::Deserialize<'de>
26227    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
26228{
26229    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26230        use std::str::FromStr;
26231        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26232        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"))
26233    }
26234}
26235/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
26236#[derive(Clone, Debug, serde::Serialize)]
26237pub struct ConfirmPaymentIntentPaymentMethodOptionsAffirm {
26238    /// Controls when the funds are captured from the customer's account.
26239    ///
26240    /// 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.
26241    ///
26242    /// 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.
26243    #[serde(skip_serializing_if = "Option::is_none")]
26244    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
26245    /// Preferred language of the Affirm authorization page that the customer is redirected to.
26246    #[serde(skip_serializing_if = "Option::is_none")]
26247    pub preferred_locale: Option<String>,
26248    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26249    ///
26250    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26251    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26252    ///
26253    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26254    ///
26255    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26256    ///
26257    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26258    #[serde(skip_serializing_if = "Option::is_none")]
26259    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
26260}
26261impl ConfirmPaymentIntentPaymentMethodOptionsAffirm {
26262    pub fn new() -> Self {
26263        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
26264    }
26265}
26266impl Default for ConfirmPaymentIntentPaymentMethodOptionsAffirm {
26267    fn default() -> Self {
26268        Self::new()
26269    }
26270}
26271/// Controls when the funds are captured from the customer's account.
26272///
26273/// 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.
26274///
26275/// 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.
26276#[derive(Copy, Clone, Eq, PartialEq)]
26277pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26278    Manual,
26279}
26280impl ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26281    pub fn as_str(self) -> &'static str {
26282        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
26283        match self {
26284            Manual => "manual",
26285        }
26286    }
26287}
26288
26289impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26290    type Err = stripe_types::StripeParseError;
26291    fn from_str(s: &str) -> Result<Self, Self::Err> {
26292        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
26293        match s {
26294            "manual" => Ok(Manual),
26295            _ => Err(stripe_types::StripeParseError),
26296        }
26297    }
26298}
26299impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26300    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26301        f.write_str(self.as_str())
26302    }
26303}
26304
26305impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26306    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26307        f.write_str(self.as_str())
26308    }
26309}
26310impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26311    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26312    where
26313        S: serde::Serializer,
26314    {
26315        serializer.serialize_str(self.as_str())
26316    }
26317}
26318#[cfg(feature = "deserialize")]
26319impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
26320    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26321        use std::str::FromStr;
26322        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26323        Self::from_str(&s).map_err(|_| {
26324            serde::de::Error::custom(
26325                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod",
26326            )
26327        })
26328    }
26329}
26330/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26331///
26332/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26333/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26334///
26335/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26336///
26337/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26338///
26339/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26340#[derive(Copy, Clone, Eq, PartialEq)]
26341pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26342    None,
26343}
26344impl ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26345    pub fn as_str(self) -> &'static str {
26346        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
26347        match self {
26348            None => "none",
26349        }
26350    }
26351}
26352
26353impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26354    type Err = stripe_types::StripeParseError;
26355    fn from_str(s: &str) -> Result<Self, Self::Err> {
26356        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
26357        match s {
26358            "none" => Ok(None),
26359            _ => Err(stripe_types::StripeParseError),
26360        }
26361    }
26362}
26363impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26364    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26365        f.write_str(self.as_str())
26366    }
26367}
26368
26369impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26370    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26371        f.write_str(self.as_str())
26372    }
26373}
26374impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
26375    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26376    where
26377        S: serde::Serializer,
26378    {
26379        serializer.serialize_str(self.as_str())
26380    }
26381}
26382#[cfg(feature = "deserialize")]
26383impl<'de> serde::Deserialize<'de>
26384    for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
26385{
26386    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26387        use std::str::FromStr;
26388        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26389        Self::from_str(&s).map_err(|_| {
26390            serde::de::Error::custom(
26391                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage",
26392            )
26393        })
26394    }
26395}
26396/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
26397#[derive(Clone, Debug, serde::Serialize)]
26398pub struct ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
26399    /// Controls when the funds are captured from the customer's account.
26400    ///
26401    /// 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.
26402    ///
26403    /// 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.
26404    #[serde(skip_serializing_if = "Option::is_none")]
26405    pub capture_method:
26406        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
26407    /// An internal identifier or reference that this payment corresponds to.
26408    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
26409    /// This field differs from the statement descriptor and item name.
26410    #[serde(skip_serializing_if = "Option::is_none")]
26411    pub reference: Option<String>,
26412    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26413    ///
26414    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26415    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26416    ///
26417    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26418    ///
26419    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26420    ///
26421    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26422    #[serde(skip_serializing_if = "Option::is_none")]
26423    pub setup_future_usage:
26424        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
26425}
26426impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
26427    pub fn new() -> Self {
26428        Self { capture_method: None, reference: None, setup_future_usage: None }
26429    }
26430}
26431impl Default for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
26432    fn default() -> Self {
26433        Self::new()
26434    }
26435}
26436/// Controls when the funds are captured from the customer's account.
26437///
26438/// 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.
26439///
26440/// 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.
26441#[derive(Copy, Clone, Eq, PartialEq)]
26442pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26443    Manual,
26444}
26445impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26446    pub fn as_str(self) -> &'static str {
26447        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
26448        match self {
26449            Manual => "manual",
26450        }
26451    }
26452}
26453
26454impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26455    type Err = stripe_types::StripeParseError;
26456    fn from_str(s: &str) -> Result<Self, Self::Err> {
26457        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
26458        match s {
26459            "manual" => Ok(Manual),
26460            _ => Err(stripe_types::StripeParseError),
26461        }
26462    }
26463}
26464impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26465    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26466        f.write_str(self.as_str())
26467    }
26468}
26469
26470impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26471    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26472        f.write_str(self.as_str())
26473    }
26474}
26475impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
26476    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26477    where
26478        S: serde::Serializer,
26479    {
26480        serializer.serialize_str(self.as_str())
26481    }
26482}
26483#[cfg(feature = "deserialize")]
26484impl<'de> serde::Deserialize<'de>
26485    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
26486{
26487    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26488        use std::str::FromStr;
26489        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26490        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"))
26491    }
26492}
26493/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26494///
26495/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26496/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26497///
26498/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26499///
26500/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26501///
26502/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26503#[derive(Copy, Clone, Eq, PartialEq)]
26504pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26505    None,
26506}
26507impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26508    pub fn as_str(self) -> &'static str {
26509        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
26510        match self {
26511            None => "none",
26512        }
26513    }
26514}
26515
26516impl std::str::FromStr
26517    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
26518{
26519    type Err = stripe_types::StripeParseError;
26520    fn from_str(s: &str) -> Result<Self, Self::Err> {
26521        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
26522        match s {
26523            "none" => Ok(None),
26524            _ => Err(stripe_types::StripeParseError),
26525        }
26526    }
26527}
26528impl std::fmt::Display
26529    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
26530{
26531    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26532        f.write_str(self.as_str())
26533    }
26534}
26535
26536impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26537    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26538        f.write_str(self.as_str())
26539    }
26540}
26541impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
26542    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26543    where
26544        S: serde::Serializer,
26545    {
26546        serializer.serialize_str(self.as_str())
26547    }
26548}
26549#[cfg(feature = "deserialize")]
26550impl<'de> serde::Deserialize<'de>
26551    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
26552{
26553    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26554        use std::str::FromStr;
26555        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26556        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"))
26557    }
26558}
26559/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
26560#[derive(Copy, Clone, Debug, serde::Serialize)]
26561pub struct ConfirmPaymentIntentPaymentMethodOptionsAlipay {
26562    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26563    ///
26564    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26565    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26566    ///
26567    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26568    ///
26569    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26570    ///
26571    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26572    #[serde(skip_serializing_if = "Option::is_none")]
26573    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
26574}
26575impl ConfirmPaymentIntentPaymentMethodOptionsAlipay {
26576    pub fn new() -> Self {
26577        Self { setup_future_usage: None }
26578    }
26579}
26580impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlipay {
26581    fn default() -> Self {
26582        Self::new()
26583    }
26584}
26585/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26586///
26587/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26588/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26589///
26590/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26591///
26592/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26593///
26594/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26595#[derive(Copy, Clone, Eq, PartialEq)]
26596pub enum ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26597    None,
26598    OffSession,
26599}
26600impl ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26601    pub fn as_str(self) -> &'static str {
26602        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
26603        match self {
26604            None => "none",
26605            OffSession => "off_session",
26606        }
26607    }
26608}
26609
26610impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26611    type Err = stripe_types::StripeParseError;
26612    fn from_str(s: &str) -> Result<Self, Self::Err> {
26613        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
26614        match s {
26615            "none" => Ok(None),
26616            "off_session" => Ok(OffSession),
26617            _ => Err(stripe_types::StripeParseError),
26618        }
26619    }
26620}
26621impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26622    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26623        f.write_str(self.as_str())
26624    }
26625}
26626
26627impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26628    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26629        f.write_str(self.as_str())
26630    }
26631}
26632impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
26633    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26634    where
26635        S: serde::Serializer,
26636    {
26637        serializer.serialize_str(self.as_str())
26638    }
26639}
26640#[cfg(feature = "deserialize")]
26641impl<'de> serde::Deserialize<'de>
26642    for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
26643{
26644    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26645        use std::str::FromStr;
26646        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26647        Self::from_str(&s).map_err(|_| {
26648            serde::de::Error::custom(
26649                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage",
26650            )
26651        })
26652    }
26653}
26654/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
26655#[derive(Copy, Clone, Debug, serde::Serialize)]
26656pub struct ConfirmPaymentIntentPaymentMethodOptionsAlma {
26657    /// Controls when the funds are captured from the customer's account.
26658    ///
26659    /// 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.
26660    ///
26661    /// 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.
26662    #[serde(skip_serializing_if = "Option::is_none")]
26663    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
26664}
26665impl ConfirmPaymentIntentPaymentMethodOptionsAlma {
26666    pub fn new() -> Self {
26667        Self { capture_method: None }
26668    }
26669}
26670impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlma {
26671    fn default() -> Self {
26672        Self::new()
26673    }
26674}
26675/// Controls when the funds are captured from the customer's account.
26676///
26677/// 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.
26678///
26679/// 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.
26680#[derive(Copy, Clone, Eq, PartialEq)]
26681pub enum ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26682    Manual,
26683}
26684impl ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26685    pub fn as_str(self) -> &'static str {
26686        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
26687        match self {
26688            Manual => "manual",
26689        }
26690    }
26691}
26692
26693impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26694    type Err = stripe_types::StripeParseError;
26695    fn from_str(s: &str) -> Result<Self, Self::Err> {
26696        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
26697        match s {
26698            "manual" => Ok(Manual),
26699            _ => Err(stripe_types::StripeParseError),
26700        }
26701    }
26702}
26703impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26704    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26705        f.write_str(self.as_str())
26706    }
26707}
26708
26709impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26710    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26711        f.write_str(self.as_str())
26712    }
26713}
26714impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26715    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26716    where
26717        S: serde::Serializer,
26718    {
26719        serializer.serialize_str(self.as_str())
26720    }
26721}
26722#[cfg(feature = "deserialize")]
26723impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
26724    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26725        use std::str::FromStr;
26726        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26727        Self::from_str(&s).map_err(|_| {
26728            serde::de::Error::custom(
26729                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod",
26730            )
26731        })
26732    }
26733}
26734/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
26735#[derive(Copy, Clone, Debug, serde::Serialize)]
26736pub struct ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
26737    /// Controls when the funds are captured from the customer's account.
26738    ///
26739    /// 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.
26740    ///
26741    /// 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.
26742    #[serde(skip_serializing_if = "Option::is_none")]
26743    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
26744    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26745    ///
26746    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26747    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26748    ///
26749    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26750    ///
26751    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26752    #[serde(skip_serializing_if = "Option::is_none")]
26753    pub setup_future_usage:
26754        Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
26755}
26756impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
26757    pub fn new() -> Self {
26758        Self { capture_method: None, setup_future_usage: None }
26759    }
26760}
26761impl Default for ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
26762    fn default() -> Self {
26763        Self::new()
26764    }
26765}
26766/// Controls when the funds are captured from the customer's account.
26767///
26768/// 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.
26769///
26770/// 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.
26771#[derive(Copy, Clone, Eq, PartialEq)]
26772pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26773    Manual,
26774}
26775impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26776    pub fn as_str(self) -> &'static str {
26777        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
26778        match self {
26779            Manual => "manual",
26780        }
26781    }
26782}
26783
26784impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26785    type Err = stripe_types::StripeParseError;
26786    fn from_str(s: &str) -> Result<Self, Self::Err> {
26787        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
26788        match s {
26789            "manual" => Ok(Manual),
26790            _ => Err(stripe_types::StripeParseError),
26791        }
26792    }
26793}
26794impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26795    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26796        f.write_str(self.as_str())
26797    }
26798}
26799
26800impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26801    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26802        f.write_str(self.as_str())
26803    }
26804}
26805impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
26806    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26807    where
26808        S: serde::Serializer,
26809    {
26810        serializer.serialize_str(self.as_str())
26811    }
26812}
26813#[cfg(feature = "deserialize")]
26814impl<'de> serde::Deserialize<'de>
26815    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
26816{
26817    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26818        use std::str::FromStr;
26819        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26820        Self::from_str(&s).map_err(|_| {
26821            serde::de::Error::custom(
26822                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod",
26823            )
26824        })
26825    }
26826}
26827/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26828///
26829/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26830/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26831///
26832/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26833///
26834/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26835#[derive(Copy, Clone, Eq, PartialEq)]
26836pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
26837    None,
26838    OffSession,
26839}
26840impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
26841    pub fn as_str(self) -> &'static str {
26842        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
26843        match self {
26844            None => "none",
26845            OffSession => "off_session",
26846        }
26847    }
26848}
26849
26850impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
26851    type Err = stripe_types::StripeParseError;
26852    fn from_str(s: &str) -> Result<Self, Self::Err> {
26853        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
26854        match s {
26855            "none" => Ok(None),
26856            "off_session" => Ok(OffSession),
26857            _ => Err(stripe_types::StripeParseError),
26858        }
26859    }
26860}
26861impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
26862    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26863        f.write_str(self.as_str())
26864    }
26865}
26866
26867impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
26868    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26869        f.write_str(self.as_str())
26870    }
26871}
26872impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
26873    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26874    where
26875        S: serde::Serializer,
26876    {
26877        serializer.serialize_str(self.as_str())
26878    }
26879}
26880#[cfg(feature = "deserialize")]
26881impl<'de> serde::Deserialize<'de>
26882    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
26883{
26884    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26885        use std::str::FromStr;
26886        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26887        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"))
26888    }
26889}
26890/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
26891#[derive(Clone, Debug, serde::Serialize)]
26892pub struct ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
26893    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26894    ///
26895    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26896    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26897    ///
26898    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26899    ///
26900    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26901    ///
26902    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26903    #[serde(skip_serializing_if = "Option::is_none")]
26904    pub setup_future_usage:
26905        Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
26906    /// Controls when Stripe will attempt to debit the funds from the customer's account.
26907    /// The date must be a string in YYYY-MM-DD format.
26908    /// The date must be in the future and between 3 and 15 calendar days from now.
26909    #[serde(skip_serializing_if = "Option::is_none")]
26910    pub target_date: Option<String>,
26911}
26912impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
26913    pub fn new() -> Self {
26914        Self { setup_future_usage: None, target_date: None }
26915    }
26916}
26917impl Default for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
26918    fn default() -> Self {
26919        Self::new()
26920    }
26921}
26922/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26923///
26924/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26925/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
26926///
26927/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
26928///
26929/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
26930///
26931/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
26932#[derive(Copy, Clone, Eq, PartialEq)]
26933pub enum ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
26934    None,
26935    OffSession,
26936    OnSession,
26937}
26938impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
26939    pub fn as_str(self) -> &'static str {
26940        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
26941        match self {
26942            None => "none",
26943            OffSession => "off_session",
26944            OnSession => "on_session",
26945        }
26946    }
26947}
26948
26949impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
26950    type Err = stripe_types::StripeParseError;
26951    fn from_str(s: &str) -> Result<Self, Self::Err> {
26952        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
26953        match s {
26954            "none" => Ok(None),
26955            "off_session" => Ok(OffSession),
26956            "on_session" => Ok(OnSession),
26957            _ => Err(stripe_types::StripeParseError),
26958        }
26959    }
26960}
26961impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
26962    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26963        f.write_str(self.as_str())
26964    }
26965}
26966
26967impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
26968    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26969        f.write_str(self.as_str())
26970    }
26971}
26972impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
26973    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26974    where
26975        S: serde::Serializer,
26976    {
26977        serializer.serialize_str(self.as_str())
26978    }
26979}
26980#[cfg(feature = "deserialize")]
26981impl<'de> serde::Deserialize<'de>
26982    for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
26983{
26984    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26985        use std::str::FromStr;
26986        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26987        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"))
26988    }
26989}
26990/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
26991#[derive(Clone, Debug, serde::Serialize)]
26992pub struct ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
26993    /// Additional fields for Mandate creation
26994    #[serde(skip_serializing_if = "Option::is_none")]
26995    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
26996    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
26997    ///
26998    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
26999    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27000    ///
27001    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27002    ///
27003    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27004    ///
27005    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27006    #[serde(skip_serializing_if = "Option::is_none")]
27007    pub setup_future_usage:
27008        Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
27009    /// Controls when Stripe will attempt to debit the funds from the customer's account.
27010    /// The date must be a string in YYYY-MM-DD format.
27011    /// The date must be in the future and between 3 and 15 calendar days from now.
27012    #[serde(skip_serializing_if = "Option::is_none")]
27013    pub target_date: Option<String>,
27014}
27015impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
27016    pub fn new() -> Self {
27017        Self { mandate_options: None, setup_future_usage: None, target_date: None }
27018    }
27019}
27020impl Default for ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
27021    fn default() -> Self {
27022        Self::new()
27023    }
27024}
27025/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27026///
27027/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27028/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27029///
27030/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27031///
27032/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27033///
27034/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27035#[derive(Copy, Clone, Eq, PartialEq)]
27036pub enum ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27037    None,
27038    OffSession,
27039    OnSession,
27040}
27041impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27042    pub fn as_str(self) -> &'static str {
27043        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
27044        match self {
27045            None => "none",
27046            OffSession => "off_session",
27047            OnSession => "on_session",
27048        }
27049    }
27050}
27051
27052impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27053    type Err = stripe_types::StripeParseError;
27054    fn from_str(s: &str) -> Result<Self, Self::Err> {
27055        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
27056        match s {
27057            "none" => Ok(None),
27058            "off_session" => Ok(OffSession),
27059            "on_session" => Ok(OnSession),
27060            _ => Err(stripe_types::StripeParseError),
27061        }
27062    }
27063}
27064impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27066        f.write_str(self.as_str())
27067    }
27068}
27069
27070impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27071    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27072        f.write_str(self.as_str())
27073    }
27074}
27075impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
27076    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27077    where
27078        S: serde::Serializer,
27079    {
27080        serializer.serialize_str(self.as_str())
27081    }
27082}
27083#[cfg(feature = "deserialize")]
27084impl<'de> serde::Deserialize<'de>
27085    for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
27086{
27087    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27088        use std::str::FromStr;
27089        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27090        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"))
27091    }
27092}
27093/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
27094#[derive(Copy, Clone, Debug, serde::Serialize)]
27095pub struct ConfirmPaymentIntentPaymentMethodOptionsBancontact {
27096    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
27097    #[serde(skip_serializing_if = "Option::is_none")]
27098    pub preferred_language:
27099        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
27100    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27101    ///
27102    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27103    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27104    ///
27105    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27106    ///
27107    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27108    ///
27109    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27110    #[serde(skip_serializing_if = "Option::is_none")]
27111    pub setup_future_usage:
27112        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
27113}
27114impl ConfirmPaymentIntentPaymentMethodOptionsBancontact {
27115    pub fn new() -> Self {
27116        Self { preferred_language: None, setup_future_usage: None }
27117    }
27118}
27119impl Default for ConfirmPaymentIntentPaymentMethodOptionsBancontact {
27120    fn default() -> Self {
27121        Self::new()
27122    }
27123}
27124/// Preferred language of the Bancontact authorization page that the customer is redirected to.
27125#[derive(Copy, Clone, Eq, PartialEq)]
27126pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27127    De,
27128    En,
27129    Fr,
27130    Nl,
27131}
27132impl ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27133    pub fn as_str(self) -> &'static str {
27134        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
27135        match self {
27136            De => "de",
27137            En => "en",
27138            Fr => "fr",
27139            Nl => "nl",
27140        }
27141    }
27142}
27143
27144impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27145    type Err = stripe_types::StripeParseError;
27146    fn from_str(s: &str) -> Result<Self, Self::Err> {
27147        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
27148        match s {
27149            "de" => Ok(De),
27150            "en" => Ok(En),
27151            "fr" => Ok(Fr),
27152            "nl" => Ok(Nl),
27153            _ => Err(stripe_types::StripeParseError),
27154        }
27155    }
27156}
27157impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27158    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27159        f.write_str(self.as_str())
27160    }
27161}
27162
27163impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27165        f.write_str(self.as_str())
27166    }
27167}
27168impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
27169    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27170    where
27171        S: serde::Serializer,
27172    {
27173        serializer.serialize_str(self.as_str())
27174    }
27175}
27176#[cfg(feature = "deserialize")]
27177impl<'de> serde::Deserialize<'de>
27178    for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
27179{
27180    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27181        use std::str::FromStr;
27182        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27183        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"))
27184    }
27185}
27186/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27187///
27188/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27189/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27190///
27191/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27192///
27193/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27194///
27195/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27196#[derive(Copy, Clone, Eq, PartialEq)]
27197pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27198    None,
27199    OffSession,
27200}
27201impl ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27202    pub fn as_str(self) -> &'static str {
27203        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
27204        match self {
27205            None => "none",
27206            OffSession => "off_session",
27207        }
27208    }
27209}
27210
27211impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27212    type Err = stripe_types::StripeParseError;
27213    fn from_str(s: &str) -> Result<Self, Self::Err> {
27214        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
27215        match s {
27216            "none" => Ok(None),
27217            "off_session" => Ok(OffSession),
27218            _ => Err(stripe_types::StripeParseError),
27219        }
27220    }
27221}
27222impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27223    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27224        f.write_str(self.as_str())
27225    }
27226}
27227
27228impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27229    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27230        f.write_str(self.as_str())
27231    }
27232}
27233impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
27234    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27235    where
27236        S: serde::Serializer,
27237    {
27238        serializer.serialize_str(self.as_str())
27239    }
27240}
27241#[cfg(feature = "deserialize")]
27242impl<'de> serde::Deserialize<'de>
27243    for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
27244{
27245    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27246        use std::str::FromStr;
27247        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27248        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"))
27249    }
27250}
27251/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
27252#[derive(Copy, Clone, Debug, serde::Serialize)]
27253pub struct ConfirmPaymentIntentPaymentMethodOptionsBillie {
27254    /// Controls when the funds are captured from the customer's account.
27255    ///
27256    /// 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.
27257    ///
27258    /// 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.
27259    #[serde(skip_serializing_if = "Option::is_none")]
27260    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
27261}
27262impl ConfirmPaymentIntentPaymentMethodOptionsBillie {
27263    pub fn new() -> Self {
27264        Self { capture_method: None }
27265    }
27266}
27267impl Default for ConfirmPaymentIntentPaymentMethodOptionsBillie {
27268    fn default() -> Self {
27269        Self::new()
27270    }
27271}
27272/// Controls when the funds are captured from the customer's account.
27273///
27274/// 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.
27275///
27276/// 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.
27277#[derive(Copy, Clone, Eq, PartialEq)]
27278pub enum ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27279    Manual,
27280}
27281impl ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27282    pub fn as_str(self) -> &'static str {
27283        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
27284        match self {
27285            Manual => "manual",
27286        }
27287    }
27288}
27289
27290impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27291    type Err = stripe_types::StripeParseError;
27292    fn from_str(s: &str) -> Result<Self, Self::Err> {
27293        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
27294        match s {
27295            "manual" => Ok(Manual),
27296            _ => Err(stripe_types::StripeParseError),
27297        }
27298    }
27299}
27300impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27301    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27302        f.write_str(self.as_str())
27303    }
27304}
27305
27306impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27307    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27308        f.write_str(self.as_str())
27309    }
27310}
27311impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27312    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27313    where
27314        S: serde::Serializer,
27315    {
27316        serializer.serialize_str(self.as_str())
27317    }
27318}
27319#[cfg(feature = "deserialize")]
27320impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
27321    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27322        use std::str::FromStr;
27323        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27324        Self::from_str(&s).map_err(|_| {
27325            serde::de::Error::custom(
27326                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod",
27327            )
27328        })
27329    }
27330}
27331/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
27332#[derive(Clone, Debug, serde::Serialize)]
27333pub struct ConfirmPaymentIntentPaymentMethodOptionsBlik {
27334    /// The 6-digit BLIK code that a customer has generated using their banking application.
27335    /// Can only be set on confirmation.
27336    #[serde(skip_serializing_if = "Option::is_none")]
27337    pub code: Option<String>,
27338    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27339    ///
27340    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27341    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27342    ///
27343    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27344    ///
27345    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27346    ///
27347    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27348    #[serde(skip_serializing_if = "Option::is_none")]
27349    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
27350}
27351impl ConfirmPaymentIntentPaymentMethodOptionsBlik {
27352    pub fn new() -> Self {
27353        Self { code: None, setup_future_usage: None }
27354    }
27355}
27356impl Default for ConfirmPaymentIntentPaymentMethodOptionsBlik {
27357    fn default() -> Self {
27358        Self::new()
27359    }
27360}
27361/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27362///
27363/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27364/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27365///
27366/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27367///
27368/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27369///
27370/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27371#[derive(Copy, Clone, Eq, PartialEq)]
27372pub enum ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27373    None,
27374}
27375impl ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27376    pub fn as_str(self) -> &'static str {
27377        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
27378        match self {
27379            None => "none",
27380        }
27381    }
27382}
27383
27384impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27385    type Err = stripe_types::StripeParseError;
27386    fn from_str(s: &str) -> Result<Self, Self::Err> {
27387        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
27388        match s {
27389            "none" => Ok(None),
27390            _ => Err(stripe_types::StripeParseError),
27391        }
27392    }
27393}
27394impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27395    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27396        f.write_str(self.as_str())
27397    }
27398}
27399
27400impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27401    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27402        f.write_str(self.as_str())
27403    }
27404}
27405impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27406    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27407    where
27408        S: serde::Serializer,
27409    {
27410        serializer.serialize_str(self.as_str())
27411    }
27412}
27413#[cfg(feature = "deserialize")]
27414impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
27415    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27416        use std::str::FromStr;
27417        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27418        Self::from_str(&s).map_err(|_| {
27419            serde::de::Error::custom(
27420                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage",
27421            )
27422        })
27423    }
27424}
27425/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
27426#[derive(Copy, Clone, Debug, serde::Serialize)]
27427pub struct ConfirmPaymentIntentPaymentMethodOptionsBoleto {
27428    /// The number of calendar days before a Boleto voucher expires.
27429    /// 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.
27430    #[serde(skip_serializing_if = "Option::is_none")]
27431    pub expires_after_days: Option<u32>,
27432    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27433    ///
27434    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27435    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27436    ///
27437    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27438    ///
27439    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27440    ///
27441    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27442    #[serde(skip_serializing_if = "Option::is_none")]
27443    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
27444}
27445impl ConfirmPaymentIntentPaymentMethodOptionsBoleto {
27446    pub fn new() -> Self {
27447        Self { expires_after_days: None, setup_future_usage: None }
27448    }
27449}
27450impl Default for ConfirmPaymentIntentPaymentMethodOptionsBoleto {
27451    fn default() -> Self {
27452        Self::new()
27453    }
27454}
27455/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27456///
27457/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27458/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27459///
27460/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27461///
27462/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27463///
27464/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27465#[derive(Copy, Clone, Eq, PartialEq)]
27466pub enum ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27467    None,
27468    OffSession,
27469    OnSession,
27470}
27471impl ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27472    pub fn as_str(self) -> &'static str {
27473        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
27474        match self {
27475            None => "none",
27476            OffSession => "off_session",
27477            OnSession => "on_session",
27478        }
27479    }
27480}
27481
27482impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27483    type Err = stripe_types::StripeParseError;
27484    fn from_str(s: &str) -> Result<Self, Self::Err> {
27485        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
27486        match s {
27487            "none" => Ok(None),
27488            "off_session" => Ok(OffSession),
27489            "on_session" => Ok(OnSession),
27490            _ => Err(stripe_types::StripeParseError),
27491        }
27492    }
27493}
27494impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27495    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27496        f.write_str(self.as_str())
27497    }
27498}
27499
27500impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27501    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27502        f.write_str(self.as_str())
27503    }
27504}
27505impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
27506    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27507    where
27508        S: serde::Serializer,
27509    {
27510        serializer.serialize_str(self.as_str())
27511    }
27512}
27513#[cfg(feature = "deserialize")]
27514impl<'de> serde::Deserialize<'de>
27515    for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
27516{
27517    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27518        use std::str::FromStr;
27519        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27520        Self::from_str(&s).map_err(|_| {
27521            serde::de::Error::custom(
27522                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage",
27523            )
27524        })
27525    }
27526}
27527/// Configuration for any card payments attempted on this PaymentIntent.
27528#[derive(Clone, Debug, serde::Serialize)]
27529pub struct ConfirmPaymentIntentPaymentMethodOptionsCard {
27530    /// Controls when the funds are captured from the customer's account.
27531    ///
27532    /// 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.
27533    ///
27534    /// 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.
27535    #[serde(skip_serializing_if = "Option::is_none")]
27536    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod>,
27537    /// A single-use `cvc_update` Token that represents a card CVC value.
27538    /// When provided, the CVC value will be verified during the card payment attempt.
27539    /// This parameter can only be provided during confirmation.
27540    #[serde(skip_serializing_if = "Option::is_none")]
27541    pub cvc_token: Option<String>,
27542    /// Installment configuration for payments attempted on this PaymentIntent.
27543    ///
27544    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
27545    #[serde(skip_serializing_if = "Option::is_none")]
27546    pub installments: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallments>,
27547    /// Configuration options for setting up an eMandate for cards issued in India.
27548    #[serde(skip_serializing_if = "Option::is_none")]
27549    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions>,
27550    /// When specified, this parameter indicates that a transaction will be marked
27551    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
27552    /// parameter can only be provided during confirmation.
27553    #[serde(skip_serializing_if = "Option::is_none")]
27554    pub moto: Option<bool>,
27555    /// Selected network to process this PaymentIntent on.
27556    /// Depends on the available networks of the card attached to the PaymentIntent.
27557    /// Can be only set confirm-time.
27558    #[serde(skip_serializing_if = "Option::is_none")]
27559    pub network: Option<ConfirmPaymentIntentPaymentMethodOptionsCardNetwork>,
27560    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
27561    #[serde(skip_serializing_if = "Option::is_none")]
27562    pub request_extended_authorization:
27563        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
27564    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
27565    #[serde(skip_serializing_if = "Option::is_none")]
27566    pub request_incremental_authorization:
27567        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
27568    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
27569    #[serde(skip_serializing_if = "Option::is_none")]
27570    pub request_multicapture:
27571        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
27572    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
27573    #[serde(skip_serializing_if = "Option::is_none")]
27574    pub request_overcapture: Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
27575    /// 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).
27576    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
27577    /// If not provided, this value defaults to `automatic`.
27578    /// 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.
27579    #[serde(skip_serializing_if = "Option::is_none")]
27580    pub request_three_d_secure:
27581        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
27582    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
27583    /// using the cvc_token parameter).
27584    #[serde(skip_serializing_if = "Option::is_none")]
27585    pub require_cvc_recollection: Option<bool>,
27586    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
27587    ///
27588    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
27589    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
27590    ///
27591    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
27592    ///
27593    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
27594    ///
27595    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
27596    #[serde(skip_serializing_if = "Option::is_none")]
27597    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
27598    /// Provides information about a card payment that customers see on their statements.
27599    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
27600    /// Maximum 22 characters.
27601    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
27602    #[serde(skip_serializing_if = "Option::is_none")]
27603    pub statement_descriptor_suffix_kana: Option<String>,
27604    /// Provides information about a card payment that customers see on their statements.
27605    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
27606    /// Maximum 17 characters.
27607    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
27608    #[serde(skip_serializing_if = "Option::is_none")]
27609    pub statement_descriptor_suffix_kanji: Option<String>,
27610    /// If 3D Secure authentication was performed with a third-party provider,
27611    /// the authentication details to use for this payment.
27612    #[serde(skip_serializing_if = "Option::is_none")]
27613    pub three_d_secure: Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure>,
27614}
27615impl ConfirmPaymentIntentPaymentMethodOptionsCard {
27616    pub fn new() -> Self {
27617        Self {
27618            capture_method: None,
27619            cvc_token: None,
27620            installments: None,
27621            mandate_options: None,
27622            moto: None,
27623            network: None,
27624            request_extended_authorization: None,
27625            request_incremental_authorization: None,
27626            request_multicapture: None,
27627            request_overcapture: None,
27628            request_three_d_secure: None,
27629            require_cvc_recollection: None,
27630            setup_future_usage: None,
27631            statement_descriptor_suffix_kana: None,
27632            statement_descriptor_suffix_kanji: None,
27633            three_d_secure: None,
27634        }
27635    }
27636}
27637impl Default for ConfirmPaymentIntentPaymentMethodOptionsCard {
27638    fn default() -> Self {
27639        Self::new()
27640    }
27641}
27642/// Controls when the funds are captured from the customer's account.
27643///
27644/// 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.
27645///
27646/// 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.
27647#[derive(Copy, Clone, Eq, PartialEq)]
27648pub enum ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27649    Manual,
27650}
27651impl ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27652    pub fn as_str(self) -> &'static str {
27653        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
27654        match self {
27655            Manual => "manual",
27656        }
27657    }
27658}
27659
27660impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27661    type Err = stripe_types::StripeParseError;
27662    fn from_str(s: &str) -> Result<Self, Self::Err> {
27663        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
27664        match s {
27665            "manual" => Ok(Manual),
27666            _ => Err(stripe_types::StripeParseError),
27667        }
27668    }
27669}
27670impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27672        f.write_str(self.as_str())
27673    }
27674}
27675
27676impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27677    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27678        f.write_str(self.as_str())
27679    }
27680}
27681impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27682    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27683    where
27684        S: serde::Serializer,
27685    {
27686        serializer.serialize_str(self.as_str())
27687    }
27688}
27689#[cfg(feature = "deserialize")]
27690impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
27691    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27692        use std::str::FromStr;
27693        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27694        Self::from_str(&s).map_err(|_| {
27695            serde::de::Error::custom(
27696                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod",
27697            )
27698        })
27699    }
27700}
27701/// Installment configuration for payments attempted on this PaymentIntent.
27702///
27703/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
27704#[derive(Copy, Clone, Debug, serde::Serialize)]
27705pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
27706    /// Setting to true enables installments for this PaymentIntent.
27707    /// This will cause the response to contain a list of available installment plans.
27708    /// Setting to false will prevent any selected plan from applying to a charge.
27709    #[serde(skip_serializing_if = "Option::is_none")]
27710    pub enabled: Option<bool>,
27711    /// The selected installment plan to use for this payment attempt.
27712    /// This parameter can only be provided during confirmation.
27713    #[serde(skip_serializing_if = "Option::is_none")]
27714    pub plan: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
27715}
27716impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
27717    pub fn new() -> Self {
27718        Self { enabled: None, plan: None }
27719    }
27720}
27721impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
27722    fn default() -> Self {
27723        Self::new()
27724    }
27725}
27726/// The selected installment plan to use for this payment attempt.
27727/// This parameter can only be provided during confirmation.
27728#[derive(Copy, Clone, Debug, serde::Serialize)]
27729pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
27730    /// For `fixed_count` installment plans, this is required.
27731    /// It represents the number of installment payments your customer will make to their credit card.
27732    #[serde(skip_serializing_if = "Option::is_none")]
27733    pub count: Option<u64>,
27734    /// For `fixed_count` installment plans, this is required.
27735    /// It represents the interval between installment payments your customer will make to their credit card.
27736    /// One of `month`.
27737    #[serde(skip_serializing_if = "Option::is_none")]
27738    pub interval: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
27739    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
27740    #[serde(rename = "type")]
27741    pub type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
27742}
27743impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
27744    pub fn new(
27745        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
27746    ) -> Self {
27747        Self { count: None, interval: None, type_: type_.into() }
27748    }
27749}
27750/// For `fixed_count` installment plans, this is required.
27751/// It represents the interval between installment payments your customer will make to their credit card.
27752/// One of `month`.
27753#[derive(Copy, Clone, Eq, PartialEq)]
27754pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27755    Month,
27756}
27757impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27758    pub fn as_str(self) -> &'static str {
27759        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
27760        match self {
27761            Month => "month",
27762        }
27763    }
27764}
27765
27766impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27767    type Err = stripe_types::StripeParseError;
27768    fn from_str(s: &str) -> Result<Self, Self::Err> {
27769        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
27770        match s {
27771            "month" => Ok(Month),
27772            _ => Err(stripe_types::StripeParseError),
27773        }
27774    }
27775}
27776impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27777    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27778        f.write_str(self.as_str())
27779    }
27780}
27781
27782impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27784        f.write_str(self.as_str())
27785    }
27786}
27787impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
27788    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27789    where
27790        S: serde::Serializer,
27791    {
27792        serializer.serialize_str(self.as_str())
27793    }
27794}
27795#[cfg(feature = "deserialize")]
27796impl<'de> serde::Deserialize<'de>
27797    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
27798{
27799    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27800        use std::str::FromStr;
27801        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27802        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"))
27803    }
27804}
27805/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
27806#[derive(Copy, Clone, Eq, PartialEq)]
27807pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27808    Bonus,
27809    FixedCount,
27810    Revolving,
27811}
27812impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27813    pub fn as_str(self) -> &'static str {
27814        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
27815        match self {
27816            Bonus => "bonus",
27817            FixedCount => "fixed_count",
27818            Revolving => "revolving",
27819        }
27820    }
27821}
27822
27823impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27824    type Err = stripe_types::StripeParseError;
27825    fn from_str(s: &str) -> Result<Self, Self::Err> {
27826        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
27827        match s {
27828            "bonus" => Ok(Bonus),
27829            "fixed_count" => Ok(FixedCount),
27830            "revolving" => Ok(Revolving),
27831            _ => Err(stripe_types::StripeParseError),
27832        }
27833    }
27834}
27835impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27837        f.write_str(self.as_str())
27838    }
27839}
27840
27841impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27842    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27843        f.write_str(self.as_str())
27844    }
27845}
27846impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
27847    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27848    where
27849        S: serde::Serializer,
27850    {
27851        serializer.serialize_str(self.as_str())
27852    }
27853}
27854#[cfg(feature = "deserialize")]
27855impl<'de> serde::Deserialize<'de>
27856    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
27857{
27858    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27859        use std::str::FromStr;
27860        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27861        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType"))
27862    }
27863}
27864/// Configuration options for setting up an eMandate for cards issued in India.
27865#[derive(Clone, Debug, serde::Serialize)]
27866pub struct ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
27867    /// Amount to be charged for future payments.
27868    pub amount: i64,
27869    /// One of `fixed` or `maximum`.
27870    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
27871    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
27872    pub amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
27873    /// A description of the mandate or subscription that is meant to be displayed to the customer.
27874    #[serde(skip_serializing_if = "Option::is_none")]
27875    pub description: Option<String>,
27876    /// End date of the mandate or subscription.
27877    /// If not provided, the mandate will be active until canceled.
27878    /// If provided, end date should be after start date.
27879    #[serde(skip_serializing_if = "Option::is_none")]
27880    pub end_date: Option<stripe_types::Timestamp>,
27881    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
27882    pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
27883    /// The number of intervals between payments.
27884    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
27885    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
27886    /// This parameter is optional when `interval=sporadic`.
27887    #[serde(skip_serializing_if = "Option::is_none")]
27888    pub interval_count: Option<u64>,
27889    /// Unique identifier for the mandate or subscription.
27890    pub reference: String,
27891    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
27892    pub start_date: stripe_types::Timestamp,
27893    /// Specifies the type of mandates supported. Possible values are `india`.
27894    #[serde(skip_serializing_if = "Option::is_none")]
27895    pub supported_types:
27896        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
27897}
27898impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
27899    pub fn new(
27900        amount: impl Into<i64>,
27901        amount_type: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
27902        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
27903        reference: impl Into<String>,
27904        start_date: impl Into<stripe_types::Timestamp>,
27905    ) -> Self {
27906        Self {
27907            amount: amount.into(),
27908            amount_type: amount_type.into(),
27909            description: None,
27910            end_date: None,
27911            interval: interval.into(),
27912            interval_count: None,
27913            reference: reference.into(),
27914            start_date: start_date.into(),
27915            supported_types: None,
27916        }
27917    }
27918}
27919/// One of `fixed` or `maximum`.
27920/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
27921/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
27922#[derive(Copy, Clone, Eq, PartialEq)]
27923pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
27924    Fixed,
27925    Maximum,
27926}
27927impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
27928    pub fn as_str(self) -> &'static str {
27929        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
27930        match self {
27931            Fixed => "fixed",
27932            Maximum => "maximum",
27933        }
27934    }
27935}
27936
27937impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
27938    type Err = stripe_types::StripeParseError;
27939    fn from_str(s: &str) -> Result<Self, Self::Err> {
27940        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
27941        match s {
27942            "fixed" => Ok(Fixed),
27943            "maximum" => Ok(Maximum),
27944            _ => Err(stripe_types::StripeParseError),
27945        }
27946    }
27947}
27948impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
27949    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27950        f.write_str(self.as_str())
27951    }
27952}
27953
27954impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
27955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27956        f.write_str(self.as_str())
27957    }
27958}
27959impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
27960    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27961    where
27962        S: serde::Serializer,
27963    {
27964        serializer.serialize_str(self.as_str())
27965    }
27966}
27967#[cfg(feature = "deserialize")]
27968impl<'de> serde::Deserialize<'de>
27969    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
27970{
27971    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27972        use std::str::FromStr;
27973        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27974        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"))
27975    }
27976}
27977/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
27978#[derive(Copy, Clone, Eq, PartialEq)]
27979pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
27980    Day,
27981    Month,
27982    Sporadic,
27983    Week,
27984    Year,
27985}
27986impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
27987    pub fn as_str(self) -> &'static str {
27988        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
27989        match self {
27990            Day => "day",
27991            Month => "month",
27992            Sporadic => "sporadic",
27993            Week => "week",
27994            Year => "year",
27995        }
27996    }
27997}
27998
27999impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28000    type Err = stripe_types::StripeParseError;
28001    fn from_str(s: &str) -> Result<Self, Self::Err> {
28002        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
28003        match s {
28004            "day" => Ok(Day),
28005            "month" => Ok(Month),
28006            "sporadic" => Ok(Sporadic),
28007            "week" => Ok(Week),
28008            "year" => Ok(Year),
28009            _ => Err(stripe_types::StripeParseError),
28010        }
28011    }
28012}
28013impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28015        f.write_str(self.as_str())
28016    }
28017}
28018
28019impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28021        f.write_str(self.as_str())
28022    }
28023}
28024impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
28025    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28026    where
28027        S: serde::Serializer,
28028    {
28029        serializer.serialize_str(self.as_str())
28030    }
28031}
28032#[cfg(feature = "deserialize")]
28033impl<'de> serde::Deserialize<'de>
28034    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
28035{
28036    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28037        use std::str::FromStr;
28038        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28039        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"))
28040    }
28041}
28042/// Specifies the type of mandates supported. Possible values are `india`.
28043#[derive(Copy, Clone, Eq, PartialEq)]
28044pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28045    India,
28046}
28047impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28048    pub fn as_str(self) -> &'static str {
28049        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
28050        match self {
28051            India => "india",
28052        }
28053    }
28054}
28055
28056impl std::str::FromStr
28057    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
28058{
28059    type Err = stripe_types::StripeParseError;
28060    fn from_str(s: &str) -> Result<Self, Self::Err> {
28061        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
28062        match s {
28063            "india" => Ok(India),
28064            _ => Err(stripe_types::StripeParseError),
28065        }
28066    }
28067}
28068impl std::fmt::Display
28069    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
28070{
28071    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28072        f.write_str(self.as_str())
28073    }
28074}
28075
28076impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28077    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28078        f.write_str(self.as_str())
28079    }
28080}
28081impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
28082    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28083    where
28084        S: serde::Serializer,
28085    {
28086        serializer.serialize_str(self.as_str())
28087    }
28088}
28089#[cfg(feature = "deserialize")]
28090impl<'de> serde::Deserialize<'de>
28091    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
28092{
28093    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28094        use std::str::FromStr;
28095        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28096        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"))
28097    }
28098}
28099/// Selected network to process this PaymentIntent on.
28100/// Depends on the available networks of the card attached to the PaymentIntent.
28101/// Can be only set confirm-time.
28102#[derive(Copy, Clone, Eq, PartialEq)]
28103pub enum ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28104    Amex,
28105    CartesBancaires,
28106    Diners,
28107    Discover,
28108    EftposAu,
28109    Girocard,
28110    Interac,
28111    Jcb,
28112    Link,
28113    Mastercard,
28114    Unionpay,
28115    Unknown,
28116    Visa,
28117}
28118impl ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28119    pub fn as_str(self) -> &'static str {
28120        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
28121        match self {
28122            Amex => "amex",
28123            CartesBancaires => "cartes_bancaires",
28124            Diners => "diners",
28125            Discover => "discover",
28126            EftposAu => "eftpos_au",
28127            Girocard => "girocard",
28128            Interac => "interac",
28129            Jcb => "jcb",
28130            Link => "link",
28131            Mastercard => "mastercard",
28132            Unionpay => "unionpay",
28133            Unknown => "unknown",
28134            Visa => "visa",
28135        }
28136    }
28137}
28138
28139impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28140    type Err = stripe_types::StripeParseError;
28141    fn from_str(s: &str) -> Result<Self, Self::Err> {
28142        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
28143        match s {
28144            "amex" => Ok(Amex),
28145            "cartes_bancaires" => Ok(CartesBancaires),
28146            "diners" => Ok(Diners),
28147            "discover" => Ok(Discover),
28148            "eftpos_au" => Ok(EftposAu),
28149            "girocard" => Ok(Girocard),
28150            "interac" => Ok(Interac),
28151            "jcb" => Ok(Jcb),
28152            "link" => Ok(Link),
28153            "mastercard" => Ok(Mastercard),
28154            "unionpay" => Ok(Unionpay),
28155            "unknown" => Ok(Unknown),
28156            "visa" => Ok(Visa),
28157            _ => Err(stripe_types::StripeParseError),
28158        }
28159    }
28160}
28161impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28162    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28163        f.write_str(self.as_str())
28164    }
28165}
28166
28167impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28168    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28169        f.write_str(self.as_str())
28170    }
28171}
28172impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28173    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28174    where
28175        S: serde::Serializer,
28176    {
28177        serializer.serialize_str(self.as_str())
28178    }
28179}
28180#[cfg(feature = "deserialize")]
28181impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
28182    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28183        use std::str::FromStr;
28184        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28185        Self::from_str(&s).map_err(|_| {
28186            serde::de::Error::custom(
28187                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork",
28188            )
28189        })
28190    }
28191}
28192/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
28193#[derive(Copy, Clone, Eq, PartialEq)]
28194pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28195    IfAvailable,
28196    Never,
28197}
28198impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28199    pub fn as_str(self) -> &'static str {
28200        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
28201        match self {
28202            IfAvailable => "if_available",
28203            Never => "never",
28204        }
28205    }
28206}
28207
28208impl std::str::FromStr
28209    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
28210{
28211    type Err = stripe_types::StripeParseError;
28212    fn from_str(s: &str) -> Result<Self, Self::Err> {
28213        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
28214        match s {
28215            "if_available" => Ok(IfAvailable),
28216            "never" => Ok(Never),
28217            _ => Err(stripe_types::StripeParseError),
28218        }
28219    }
28220}
28221impl std::fmt::Display
28222    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
28223{
28224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28225        f.write_str(self.as_str())
28226    }
28227}
28228
28229impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28231        f.write_str(self.as_str())
28232    }
28233}
28234impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
28235    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28236    where
28237        S: serde::Serializer,
28238    {
28239        serializer.serialize_str(self.as_str())
28240    }
28241}
28242#[cfg(feature = "deserialize")]
28243impl<'de> serde::Deserialize<'de>
28244    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
28245{
28246    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28247        use std::str::FromStr;
28248        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28249        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"))
28250    }
28251}
28252/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
28253#[derive(Copy, Clone, Eq, PartialEq)]
28254pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
28255    IfAvailable,
28256    Never,
28257}
28258impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
28259    pub fn as_str(self) -> &'static str {
28260        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
28261        match self {
28262            IfAvailable => "if_available",
28263            Never => "never",
28264        }
28265    }
28266}
28267
28268impl std::str::FromStr
28269    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28270{
28271    type Err = stripe_types::StripeParseError;
28272    fn from_str(s: &str) -> Result<Self, Self::Err> {
28273        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
28274        match s {
28275            "if_available" => Ok(IfAvailable),
28276            "never" => Ok(Never),
28277            _ => Err(stripe_types::StripeParseError),
28278        }
28279    }
28280}
28281impl std::fmt::Display
28282    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28283{
28284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28285        f.write_str(self.as_str())
28286    }
28287}
28288
28289impl std::fmt::Debug
28290    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28291{
28292    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28293        f.write_str(self.as_str())
28294    }
28295}
28296impl serde::Serialize
28297    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28298{
28299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28300    where
28301        S: serde::Serializer,
28302    {
28303        serializer.serialize_str(self.as_str())
28304    }
28305}
28306#[cfg(feature = "deserialize")]
28307impl<'de> serde::Deserialize<'de>
28308    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
28309{
28310    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28311        use std::str::FromStr;
28312        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28313        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"))
28314    }
28315}
28316/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
28317#[derive(Copy, Clone, Eq, PartialEq)]
28318pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28319    IfAvailable,
28320    Never,
28321}
28322impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28323    pub fn as_str(self) -> &'static str {
28324        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
28325        match self {
28326            IfAvailable => "if_available",
28327            Never => "never",
28328        }
28329    }
28330}
28331
28332impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28333    type Err = stripe_types::StripeParseError;
28334    fn from_str(s: &str) -> Result<Self, Self::Err> {
28335        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
28336        match s {
28337            "if_available" => Ok(IfAvailable),
28338            "never" => Ok(Never),
28339            _ => Err(stripe_types::StripeParseError),
28340        }
28341    }
28342}
28343impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28345        f.write_str(self.as_str())
28346    }
28347}
28348
28349impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28350    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28351        f.write_str(self.as_str())
28352    }
28353}
28354impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
28355    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28356    where
28357        S: serde::Serializer,
28358    {
28359        serializer.serialize_str(self.as_str())
28360    }
28361}
28362#[cfg(feature = "deserialize")]
28363impl<'de> serde::Deserialize<'de>
28364    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture
28365{
28366    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28367        use std::str::FromStr;
28368        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28369        Self::from_str(&s).map_err(|_| {
28370            serde::de::Error::custom(
28371                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture",
28372            )
28373        })
28374    }
28375}
28376/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
28377#[derive(Copy, Clone, Eq, PartialEq)]
28378pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28379    IfAvailable,
28380    Never,
28381}
28382impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28383    pub fn as_str(self) -> &'static str {
28384        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
28385        match self {
28386            IfAvailable => "if_available",
28387            Never => "never",
28388        }
28389    }
28390}
28391
28392impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
28393    type Err = stripe_types::StripeParseError;
28394    fn from_str(s: &str) -> Result<Self, Self::Err> {
28395        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
28396        match s {
28397            "if_available" => Ok(IfAvailable),
28398            "never" => Ok(Never),
28399            _ => Err(stripe_types::StripeParseError),
28400        }
28401    }
28402}
28403impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
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 ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
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 ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
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 ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture
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(|_| {
28430            serde::de::Error::custom(
28431                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture",
28432            )
28433        })
28434    }
28435}
28436/// 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).
28437/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
28438/// If not provided, this value defaults to `automatic`.
28439/// 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.
28440#[derive(Copy, Clone, Eq, PartialEq)]
28441pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28442    Any,
28443    Automatic,
28444    Challenge,
28445}
28446impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28447    pub fn as_str(self) -> &'static str {
28448        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
28449        match self {
28450            Any => "any",
28451            Automatic => "automatic",
28452            Challenge => "challenge",
28453        }
28454    }
28455}
28456
28457impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28458    type Err = stripe_types::StripeParseError;
28459    fn from_str(s: &str) -> Result<Self, Self::Err> {
28460        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
28461        match s {
28462            "any" => Ok(Any),
28463            "automatic" => Ok(Automatic),
28464            "challenge" => Ok(Challenge),
28465            _ => Err(stripe_types::StripeParseError),
28466        }
28467    }
28468}
28469impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28470    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28471        f.write_str(self.as_str())
28472    }
28473}
28474
28475impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28476    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28477        f.write_str(self.as_str())
28478    }
28479}
28480impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
28481    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28482    where
28483        S: serde::Serializer,
28484    {
28485        serializer.serialize_str(self.as_str())
28486    }
28487}
28488#[cfg(feature = "deserialize")]
28489impl<'de> serde::Deserialize<'de>
28490    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
28491{
28492    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28493        use std::str::FromStr;
28494        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28495        Self::from_str(&s).map_err(|_| {
28496            serde::de::Error::custom(
28497                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure",
28498            )
28499        })
28500    }
28501}
28502/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28503///
28504/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28505/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28506///
28507/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28508///
28509/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28510///
28511/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28512#[derive(Copy, Clone, Eq, PartialEq)]
28513pub enum ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28514    None,
28515    OffSession,
28516    OnSession,
28517}
28518impl ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28519    pub fn as_str(self) -> &'static str {
28520        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
28521        match self {
28522            None => "none",
28523            OffSession => "off_session",
28524            OnSession => "on_session",
28525        }
28526    }
28527}
28528
28529impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28530    type Err = stripe_types::StripeParseError;
28531    fn from_str(s: &str) -> Result<Self, Self::Err> {
28532        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
28533        match s {
28534            "none" => Ok(None),
28535            "off_session" => Ok(OffSession),
28536            "on_session" => Ok(OnSession),
28537            _ => Err(stripe_types::StripeParseError),
28538        }
28539    }
28540}
28541impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28542    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28543        f.write_str(self.as_str())
28544    }
28545}
28546
28547impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28548    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28549        f.write_str(self.as_str())
28550    }
28551}
28552impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28553    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28554    where
28555        S: serde::Serializer,
28556    {
28557        serializer.serialize_str(self.as_str())
28558    }
28559}
28560#[cfg(feature = "deserialize")]
28561impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
28562    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28563        use std::str::FromStr;
28564        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28565        Self::from_str(&s).map_err(|_| {
28566            serde::de::Error::custom(
28567                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage",
28568            )
28569        })
28570    }
28571}
28572/// If 3D Secure authentication was performed with a third-party provider,
28573/// the authentication details to use for this payment.
28574#[derive(Clone, Debug, serde::Serialize)]
28575pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
28576    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
28577    #[serde(skip_serializing_if = "Option::is_none")]
28578    pub ares_trans_status:
28579        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
28580    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
28581    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
28582    /// (Most 3D Secure providers will return the base64-encoded version, which
28583    /// is what you should specify here.)
28584    pub cryptogram: String,
28585    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
28586    /// provider and indicates what degree of authentication was performed.
28587    #[serde(skip_serializing_if = "Option::is_none")]
28588    pub electronic_commerce_indicator:
28589        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
28590    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
28591    #[serde(skip_serializing_if = "Option::is_none")]
28592    pub exemption_indicator:
28593        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
28594    /// Network specific 3DS fields. Network specific arguments require an
28595    /// explicit card brand choice. The parameter `payment_method_options.card.network``
28596    /// must be populated accordingly
28597    #[serde(skip_serializing_if = "Option::is_none")]
28598    pub network_options:
28599        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
28600    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
28601    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
28602    #[serde(skip_serializing_if = "Option::is_none")]
28603    pub requestor_challenge_indicator: Option<String>,
28604    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
28605    /// Transaction ID (dsTransID).
28606    pub transaction_id: String,
28607    /// The version of 3D Secure that was performed.
28608    pub version: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
28609}
28610impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
28611    pub fn new(
28612        cryptogram: impl Into<String>,
28613        transaction_id: impl Into<String>,
28614        version: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
28615    ) -> Self {
28616        Self {
28617            ares_trans_status: None,
28618            cryptogram: cryptogram.into(),
28619            electronic_commerce_indicator: None,
28620            exemption_indicator: None,
28621            network_options: None,
28622            requestor_challenge_indicator: None,
28623            transaction_id: transaction_id.into(),
28624            version: version.into(),
28625        }
28626    }
28627}
28628/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
28629#[derive(Copy, Clone, Eq, PartialEq)]
28630pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28631    A,
28632    C,
28633    I,
28634    N,
28635    R,
28636    U,
28637    Y,
28638}
28639impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28640    pub fn as_str(self) -> &'static str {
28641        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
28642        match self {
28643            A => "A",
28644            C => "C",
28645            I => "I",
28646            N => "N",
28647            R => "R",
28648            U => "U",
28649            Y => "Y",
28650        }
28651    }
28652}
28653
28654impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28655    type Err = stripe_types::StripeParseError;
28656    fn from_str(s: &str) -> Result<Self, Self::Err> {
28657        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
28658        match s {
28659            "A" => Ok(A),
28660            "C" => Ok(C),
28661            "I" => Ok(I),
28662            "N" => Ok(N),
28663            "R" => Ok(R),
28664            "U" => Ok(U),
28665            "Y" => Ok(Y),
28666            _ => Err(stripe_types::StripeParseError),
28667        }
28668    }
28669}
28670impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28672        f.write_str(self.as_str())
28673    }
28674}
28675
28676impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28677    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28678        f.write_str(self.as_str())
28679    }
28680}
28681impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
28682    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28683    where
28684        S: serde::Serializer,
28685    {
28686        serializer.serialize_str(self.as_str())
28687    }
28688}
28689#[cfg(feature = "deserialize")]
28690impl<'de> serde::Deserialize<'de>
28691    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
28692{
28693    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28694        use std::str::FromStr;
28695        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28696        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"))
28697    }
28698}
28699/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
28700/// provider and indicates what degree of authentication was performed.
28701#[derive(Copy, Clone, Eq, PartialEq)]
28702pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
28703    V01,
28704    V02,
28705    V05,
28706    V06,
28707    V07,
28708}
28709impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
28710    pub fn as_str(self) -> &'static str {
28711        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
28712        match self {
28713            V01 => "01",
28714            V02 => "02",
28715            V05 => "05",
28716            V06 => "06",
28717            V07 => "07",
28718        }
28719    }
28720}
28721
28722impl std::str::FromStr
28723    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28724{
28725    type Err = stripe_types::StripeParseError;
28726    fn from_str(s: &str) -> Result<Self, Self::Err> {
28727        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
28728        match s {
28729            "01" => Ok(V01),
28730            "02" => Ok(V02),
28731            "05" => Ok(V05),
28732            "06" => Ok(V06),
28733            "07" => Ok(V07),
28734            _ => Err(stripe_types::StripeParseError),
28735        }
28736    }
28737}
28738impl std::fmt::Display
28739    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28740{
28741    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28742        f.write_str(self.as_str())
28743    }
28744}
28745
28746impl std::fmt::Debug
28747    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28748{
28749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28750        f.write_str(self.as_str())
28751    }
28752}
28753impl serde::Serialize
28754    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28755{
28756    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28757    where
28758        S: serde::Serializer,
28759    {
28760        serializer.serialize_str(self.as_str())
28761    }
28762}
28763#[cfg(feature = "deserialize")]
28764impl<'de> serde::Deserialize<'de>
28765    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
28766{
28767    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28768        use std::str::FromStr;
28769        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28770        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"))
28771    }
28772}
28773/// The exemption requested via 3DS and accepted by the issuer at authentication time.
28774#[derive(Copy, Clone, Eq, PartialEq)]
28775pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
28776    LowRisk,
28777    None,
28778}
28779impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
28780    pub fn as_str(self) -> &'static str {
28781        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
28782        match self {
28783            LowRisk => "low_risk",
28784            None => "none",
28785        }
28786    }
28787}
28788
28789impl std::str::FromStr
28790    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28791{
28792    type Err = stripe_types::StripeParseError;
28793    fn from_str(s: &str) -> Result<Self, Self::Err> {
28794        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
28795        match s {
28796            "low_risk" => Ok(LowRisk),
28797            "none" => Ok(None),
28798            _ => Err(stripe_types::StripeParseError),
28799        }
28800    }
28801}
28802impl std::fmt::Display
28803    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28804{
28805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28806        f.write_str(self.as_str())
28807    }
28808}
28809
28810impl std::fmt::Debug
28811    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28812{
28813    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28814        f.write_str(self.as_str())
28815    }
28816}
28817impl serde::Serialize
28818    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28819{
28820    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28821    where
28822        S: serde::Serializer,
28823    {
28824        serializer.serialize_str(self.as_str())
28825    }
28826}
28827#[cfg(feature = "deserialize")]
28828impl<'de> serde::Deserialize<'de>
28829    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
28830{
28831    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28832        use std::str::FromStr;
28833        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28834        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"))
28835    }
28836}
28837/// Network specific 3DS fields. Network specific arguments require an
28838/// explicit card brand choice. The parameter `payment_method_options.card.network``
28839/// must be populated accordingly
28840#[derive(Clone, Debug, serde::Serialize)]
28841pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
28842    /// Cartes Bancaires-specific 3DS fields.
28843    #[serde(skip_serializing_if = "Option::is_none")]
28844    pub cartes_bancaires: Option<
28845        ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
28846    >,
28847}
28848impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
28849    pub fn new() -> Self {
28850        Self { cartes_bancaires: None }
28851    }
28852}
28853impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
28854    fn default() -> Self {
28855        Self::new()
28856    }
28857}
28858/// Cartes Bancaires-specific 3DS fields.
28859#[derive(Clone, Debug, serde::Serialize)]
28860pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
28861    /// The cryptogram calculation algorithm used by the card Issuer's ACS
28862    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
28863    /// messageExtension: CB-AVALGO
28864pub cb_avalgo: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
28865    /// The exemption indicator returned from Cartes Bancaires in the ARes.
28866    /// message extension: CB-EXEMPTION; string (4 characters)
28867    /// This is a 3 byte bitmap (low significant byte first and most significant
28868    /// bit first) that has been Base64 encoded
28869#[serde(skip_serializing_if = "Option::is_none")]
28870pub cb_exemption: Option<String>,
28871    /// The risk score returned from Cartes Bancaires in the ARes.
28872    /// message extension: CB-SCORE; numeric value 0-99
28873#[serde(skip_serializing_if = "Option::is_none")]
28874pub cb_score: Option<i64>,
28875
28876}
28877impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
28878    pub fn new(
28879        cb_avalgo: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
28880    ) -> Self {
28881        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
28882    }
28883}
28884/// The cryptogram calculation algorithm used by the card Issuer's ACS
28885/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
28886/// messageExtension: CB-AVALGO
28887#[derive(Copy, Clone, Eq, PartialEq)]
28888pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
28889{
28890    V0,
28891    V1,
28892    V2,
28893    V3,
28894    V4,
28895    A,
28896}
28897impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
28898    pub fn as_str(self) -> &'static str {
28899        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
28900        match self {
28901            V0 => "0",
28902            V1 => "1",
28903            V2 => "2",
28904            V3 => "3",
28905            V4 => "4",
28906            A => "A",
28907        }
28908    }
28909}
28910
28911impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
28912    type Err = stripe_types::StripeParseError;
28913    fn from_str(s: &str) -> Result<Self, Self::Err> {
28914        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
28915        match s {
28916    "0" => Ok(V0),
28917"1" => Ok(V1),
28918"2" => Ok(V2),
28919"3" => Ok(V3),
28920"4" => Ok(V4),
28921"A" => Ok(A),
28922_ => Err(stripe_types::StripeParseError)
28923
28924        }
28925    }
28926}
28927impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
28928    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28929        f.write_str(self.as_str())
28930    }
28931}
28932
28933impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
28934    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28935        f.write_str(self.as_str())
28936    }
28937}
28938impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
28939    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
28940        serializer.serialize_str(self.as_str())
28941    }
28942}
28943#[cfg(feature = "deserialize")]
28944impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
28945    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28946        use std::str::FromStr;
28947        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28948        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"))
28949    }
28950}
28951/// The version of 3D Secure that was performed.
28952#[derive(Copy, Clone, Eq, PartialEq)]
28953pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
28954    V1_0_2,
28955    V2_1_0,
28956    V2_2_0,
28957}
28958impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
28959    pub fn as_str(self) -> &'static str {
28960        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
28961        match self {
28962            V1_0_2 => "1.0.2",
28963            V2_1_0 => "2.1.0",
28964            V2_2_0 => "2.2.0",
28965        }
28966    }
28967}
28968
28969impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
28970    type Err = stripe_types::StripeParseError;
28971    fn from_str(s: &str) -> Result<Self, Self::Err> {
28972        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
28973        match s {
28974            "1.0.2" => Ok(V1_0_2),
28975            "2.1.0" => Ok(V2_1_0),
28976            "2.2.0" => Ok(V2_2_0),
28977            _ => Err(stripe_types::StripeParseError),
28978        }
28979    }
28980}
28981impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
28982    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28983        f.write_str(self.as_str())
28984    }
28985}
28986
28987impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
28988    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28989        f.write_str(self.as_str())
28990    }
28991}
28992impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
28993    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28994    where
28995        S: serde::Serializer,
28996    {
28997        serializer.serialize_str(self.as_str())
28998    }
28999}
29000#[cfg(feature = "deserialize")]
29001impl<'de> serde::Deserialize<'de>
29002    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
29003{
29004    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29005        use std::str::FromStr;
29006        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29007        Self::from_str(&s).map_err(|_| {
29008            serde::de::Error::custom(
29009                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion",
29010            )
29011        })
29012    }
29013}
29014/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
29015#[derive(Copy, Clone, Debug, serde::Serialize)]
29016pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
29017    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
29018    #[serde(skip_serializing_if = "Option::is_none")]
29019    pub request_extended_authorization: Option<bool>,
29020    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
29021    /// 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.
29022    #[serde(skip_serializing_if = "Option::is_none")]
29023    pub request_incremental_authorization_support: Option<bool>,
29024    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
29025    #[serde(skip_serializing_if = "Option::is_none")]
29026    pub routing: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting>,
29027}
29028impl ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
29029    pub fn new() -> Self {
29030        Self {
29031            request_extended_authorization: None,
29032            request_incremental_authorization_support: None,
29033            routing: None,
29034        }
29035    }
29036}
29037impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
29038    fn default() -> Self {
29039        Self::new()
29040    }
29041}
29042/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
29043#[derive(Copy, Clone, Debug, serde::Serialize)]
29044pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
29045    /// Routing requested priority
29046    #[serde(skip_serializing_if = "Option::is_none")]
29047    pub requested_priority:
29048        Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
29049}
29050impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
29051    pub fn new() -> Self {
29052        Self { requested_priority: None }
29053    }
29054}
29055impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
29056    fn default() -> Self {
29057        Self::new()
29058    }
29059}
29060/// Routing requested priority
29061#[derive(Copy, Clone, Eq, PartialEq)]
29062pub enum ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
29063    Domestic,
29064    International,
29065}
29066impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
29067    pub fn as_str(self) -> &'static str {
29068        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
29069        match self {
29070            Domestic => "domestic",
29071            International => "international",
29072        }
29073    }
29074}
29075
29076impl std::str::FromStr
29077    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29078{
29079    type Err = stripe_types::StripeParseError;
29080    fn from_str(s: &str) -> Result<Self, Self::Err> {
29081        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
29082        match s {
29083            "domestic" => Ok(Domestic),
29084            "international" => Ok(International),
29085            _ => Err(stripe_types::StripeParseError),
29086        }
29087    }
29088}
29089impl std::fmt::Display
29090    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29091{
29092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29093        f.write_str(self.as_str())
29094    }
29095}
29096
29097impl std::fmt::Debug
29098    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29099{
29100    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29101        f.write_str(self.as_str())
29102    }
29103}
29104impl serde::Serialize
29105    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29106{
29107    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29108    where
29109        S: serde::Serializer,
29110    {
29111        serializer.serialize_str(self.as_str())
29112    }
29113}
29114#[cfg(feature = "deserialize")]
29115impl<'de> serde::Deserialize<'de>
29116    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
29117{
29118    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29119        use std::str::FromStr;
29120        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29121        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"))
29122    }
29123}
29124/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
29125#[derive(Copy, Clone, Debug, serde::Serialize)]
29126pub struct ConfirmPaymentIntentPaymentMethodOptionsCashapp {
29127    /// Controls when the funds are captured from the customer's account.
29128    ///
29129    /// 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.
29130    ///
29131    /// 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.
29132    #[serde(skip_serializing_if = "Option::is_none")]
29133    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
29134    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29135    ///
29136    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29137    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29138    ///
29139    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29140    ///
29141    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29142    ///
29143    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29144    #[serde(skip_serializing_if = "Option::is_none")]
29145    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
29146}
29147impl ConfirmPaymentIntentPaymentMethodOptionsCashapp {
29148    pub fn new() -> Self {
29149        Self { capture_method: None, setup_future_usage: None }
29150    }
29151}
29152impl Default for ConfirmPaymentIntentPaymentMethodOptionsCashapp {
29153    fn default() -> Self {
29154        Self::new()
29155    }
29156}
29157/// Controls when the funds are captured from the customer's account.
29158///
29159/// 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.
29160///
29161/// 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.
29162#[derive(Copy, Clone, Eq, PartialEq)]
29163pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29164    Manual,
29165}
29166impl ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29167    pub fn as_str(self) -> &'static str {
29168        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
29169        match self {
29170            Manual => "manual",
29171        }
29172    }
29173}
29174
29175impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29176    type Err = stripe_types::StripeParseError;
29177    fn from_str(s: &str) -> Result<Self, Self::Err> {
29178        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
29179        match s {
29180            "manual" => Ok(Manual),
29181            _ => Err(stripe_types::StripeParseError),
29182        }
29183    }
29184}
29185impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29186    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29187        f.write_str(self.as_str())
29188    }
29189}
29190
29191impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29193        f.write_str(self.as_str())
29194    }
29195}
29196impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29197    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29198    where
29199        S: serde::Serializer,
29200    {
29201        serializer.serialize_str(self.as_str())
29202    }
29203}
29204#[cfg(feature = "deserialize")]
29205impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
29206    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29207        use std::str::FromStr;
29208        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29209        Self::from_str(&s).map_err(|_| {
29210            serde::de::Error::custom(
29211                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod",
29212            )
29213        })
29214    }
29215}
29216/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29217///
29218/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29219/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29220///
29221/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29222///
29223/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29224///
29225/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29226#[derive(Copy, Clone, Eq, PartialEq)]
29227pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29228    None,
29229    OffSession,
29230    OnSession,
29231}
29232impl ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29233    pub fn as_str(self) -> &'static str {
29234        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
29235        match self {
29236            None => "none",
29237            OffSession => "off_session",
29238            OnSession => "on_session",
29239        }
29240    }
29241}
29242
29243impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29244    type Err = stripe_types::StripeParseError;
29245    fn from_str(s: &str) -> Result<Self, Self::Err> {
29246        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
29247        match s {
29248            "none" => Ok(None),
29249            "off_session" => Ok(OffSession),
29250            "on_session" => Ok(OnSession),
29251            _ => Err(stripe_types::StripeParseError),
29252        }
29253    }
29254}
29255impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29256    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29257        f.write_str(self.as_str())
29258    }
29259}
29260
29261impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29262    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29263        f.write_str(self.as_str())
29264    }
29265}
29266impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
29267    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29268    where
29269        S: serde::Serializer,
29270    {
29271        serializer.serialize_str(self.as_str())
29272    }
29273}
29274#[cfg(feature = "deserialize")]
29275impl<'de> serde::Deserialize<'de>
29276    for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
29277{
29278    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29279        use std::str::FromStr;
29280        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29281        Self::from_str(&s).map_err(|_| {
29282            serde::de::Error::custom(
29283                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage",
29284            )
29285        })
29286    }
29287}
29288/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
29289#[derive(Copy, Clone, Debug, serde::Serialize)]
29290pub struct ConfirmPaymentIntentPaymentMethodOptionsCrypto {
29291    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29292    ///
29293    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29294    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29295    ///
29296    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29297    ///
29298    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29299    ///
29300    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29301    #[serde(skip_serializing_if = "Option::is_none")]
29302    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
29303}
29304impl ConfirmPaymentIntentPaymentMethodOptionsCrypto {
29305    pub fn new() -> Self {
29306        Self { setup_future_usage: None }
29307    }
29308}
29309impl Default for ConfirmPaymentIntentPaymentMethodOptionsCrypto {
29310    fn default() -> Self {
29311        Self::new()
29312    }
29313}
29314/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29315///
29316/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29317/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29318///
29319/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29320///
29321/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29322///
29323/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29324#[derive(Copy, Clone, Eq, PartialEq)]
29325pub enum ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29326    None,
29327}
29328impl ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29329    pub fn as_str(self) -> &'static str {
29330        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
29331        match self {
29332            None => "none",
29333        }
29334    }
29335}
29336
29337impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29338    type Err = stripe_types::StripeParseError;
29339    fn from_str(s: &str) -> Result<Self, Self::Err> {
29340        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
29341        match s {
29342            "none" => Ok(None),
29343            _ => Err(stripe_types::StripeParseError),
29344        }
29345    }
29346}
29347impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29349        f.write_str(self.as_str())
29350    }
29351}
29352
29353impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29354    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29355        f.write_str(self.as_str())
29356    }
29357}
29358impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
29359    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29360    where
29361        S: serde::Serializer,
29362    {
29363        serializer.serialize_str(self.as_str())
29364    }
29365}
29366#[cfg(feature = "deserialize")]
29367impl<'de> serde::Deserialize<'de>
29368    for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
29369{
29370    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29371        use std::str::FromStr;
29372        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29373        Self::from_str(&s).map_err(|_| {
29374            serde::de::Error::custom(
29375                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage",
29376            )
29377        })
29378    }
29379}
29380/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
29381#[derive(Clone, Debug, serde::Serialize)]
29382pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
29383    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
29384    #[serde(skip_serializing_if = "Option::is_none")]
29385    pub bank_transfer: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
29386    /// The funding method type to be used when there are not enough funds in the customer balance.
29387    /// Permitted values include: `bank_transfer`.
29388    #[serde(skip_serializing_if = "Option::is_none")]
29389    pub funding_type: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
29390    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29391    ///
29392    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29393    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29394    ///
29395    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29396    ///
29397    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29398    ///
29399    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29400    #[serde(skip_serializing_if = "Option::is_none")]
29401    pub setup_future_usage:
29402        Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
29403}
29404impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
29405    pub fn new() -> Self {
29406        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
29407    }
29408}
29409impl Default for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
29410    fn default() -> Self {
29411        Self::new()
29412    }
29413}
29414/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
29415#[derive(Clone, Debug, serde::Serialize)]
29416pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
29417    /// Configuration for the eu_bank_transfer funding type.
29418#[serde(skip_serializing_if = "Option::is_none")]
29419pub eu_bank_transfer: Option<EuBankTransferParams>,
29420        /// List of address types that should be returned in the financial_addresses response.
29421    /// If not specified, all valid types will be returned.
29422    ///
29423    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
29424#[serde(skip_serializing_if = "Option::is_none")]
29425pub requested_address_types: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,
29426        /// 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`.
29427#[serde(rename = "type")]
29428pub type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
29429
29430}
29431impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
29432    pub fn new(
29433        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
29434    ) -> Self {
29435        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
29436    }
29437}
29438/// List of address types that should be returned in the financial_addresses response.
29439/// If not specified, all valid types will be returned.
29440///
29441/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
29442#[derive(Copy, Clone, Eq, PartialEq)]
29443pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
29444    Aba,
29445    Iban,
29446    Sepa,
29447    SortCode,
29448    Spei,
29449    Swift,
29450    Zengin,
29451}
29452impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
29453    pub fn as_str(self) -> &'static str {
29454        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
29455        match self {
29456            Aba => "aba",
29457            Iban => "iban",
29458            Sepa => "sepa",
29459            SortCode => "sort_code",
29460            Spei => "spei",
29461            Swift => "swift",
29462            Zengin => "zengin",
29463        }
29464    }
29465}
29466
29467impl std::str::FromStr
29468    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29469{
29470    type Err = stripe_types::StripeParseError;
29471    fn from_str(s: &str) -> Result<Self, Self::Err> {
29472        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
29473        match s {
29474            "aba" => Ok(Aba),
29475            "iban" => Ok(Iban),
29476            "sepa" => Ok(Sepa),
29477            "sort_code" => Ok(SortCode),
29478            "spei" => Ok(Spei),
29479            "swift" => Ok(Swift),
29480            "zengin" => Ok(Zengin),
29481            _ => Err(stripe_types::StripeParseError),
29482        }
29483    }
29484}
29485impl std::fmt::Display
29486    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29487{
29488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29489        f.write_str(self.as_str())
29490    }
29491}
29492
29493impl std::fmt::Debug
29494    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29495{
29496    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29497        f.write_str(self.as_str())
29498    }
29499}
29500impl serde::Serialize
29501    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29502{
29503    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29504    where
29505        S: serde::Serializer,
29506    {
29507        serializer.serialize_str(self.as_str())
29508    }
29509}
29510#[cfg(feature = "deserialize")]
29511impl<'de> serde::Deserialize<'de>
29512    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
29513{
29514    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29515        use std::str::FromStr;
29516        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29517        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"))
29518    }
29519}
29520/// 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`.
29521#[derive(Copy, Clone, Eq, PartialEq)]
29522pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29523    EuBankTransfer,
29524    GbBankTransfer,
29525    JpBankTransfer,
29526    MxBankTransfer,
29527    UsBankTransfer,
29528}
29529impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29530    pub fn as_str(self) -> &'static str {
29531        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
29532        match self {
29533            EuBankTransfer => "eu_bank_transfer",
29534            GbBankTransfer => "gb_bank_transfer",
29535            JpBankTransfer => "jp_bank_transfer",
29536            MxBankTransfer => "mx_bank_transfer",
29537            UsBankTransfer => "us_bank_transfer",
29538        }
29539    }
29540}
29541
29542impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29543    type Err = stripe_types::StripeParseError;
29544    fn from_str(s: &str) -> Result<Self, Self::Err> {
29545        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
29546        match s {
29547            "eu_bank_transfer" => Ok(EuBankTransfer),
29548            "gb_bank_transfer" => Ok(GbBankTransfer),
29549            "jp_bank_transfer" => Ok(JpBankTransfer),
29550            "mx_bank_transfer" => Ok(MxBankTransfer),
29551            "us_bank_transfer" => Ok(UsBankTransfer),
29552            _ => Err(stripe_types::StripeParseError),
29553        }
29554    }
29555}
29556impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29557    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29558        f.write_str(self.as_str())
29559    }
29560}
29561
29562impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29563    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29564        f.write_str(self.as_str())
29565    }
29566}
29567impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
29568    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29569    where
29570        S: serde::Serializer,
29571    {
29572        serializer.serialize_str(self.as_str())
29573    }
29574}
29575#[cfg(feature = "deserialize")]
29576impl<'de> serde::Deserialize<'de>
29577    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
29578{
29579    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29580        use std::str::FromStr;
29581        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29582        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"))
29583    }
29584}
29585/// The funding method type to be used when there are not enough funds in the customer balance.
29586/// Permitted values include: `bank_transfer`.
29587#[derive(Copy, Clone, Eq, PartialEq)]
29588pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29589    BankTransfer,
29590}
29591impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29592    pub fn as_str(self) -> &'static str {
29593        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
29594        match self {
29595            BankTransfer => "bank_transfer",
29596        }
29597    }
29598}
29599
29600impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29601    type Err = stripe_types::StripeParseError;
29602    fn from_str(s: &str) -> Result<Self, Self::Err> {
29603        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
29604        match s {
29605            "bank_transfer" => Ok(BankTransfer),
29606            _ => Err(stripe_types::StripeParseError),
29607        }
29608    }
29609}
29610impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29611    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29612        f.write_str(self.as_str())
29613    }
29614}
29615
29616impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29617    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29618        f.write_str(self.as_str())
29619    }
29620}
29621impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
29622    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29623    where
29624        S: serde::Serializer,
29625    {
29626        serializer.serialize_str(self.as_str())
29627    }
29628}
29629#[cfg(feature = "deserialize")]
29630impl<'de> serde::Deserialize<'de>
29631    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
29632{
29633    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29634        use std::str::FromStr;
29635        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29636        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"))
29637    }
29638}
29639/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29640///
29641/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29642/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29643///
29644/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29645///
29646/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29647///
29648/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29649#[derive(Copy, Clone, Eq, PartialEq)]
29650pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29651    None,
29652}
29653impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29654    pub fn as_str(self) -> &'static str {
29655        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
29656        match self {
29657            None => "none",
29658        }
29659    }
29660}
29661
29662impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29663    type Err = stripe_types::StripeParseError;
29664    fn from_str(s: &str) -> Result<Self, Self::Err> {
29665        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
29666        match s {
29667            "none" => Ok(None),
29668            _ => Err(stripe_types::StripeParseError),
29669        }
29670    }
29671}
29672impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29673    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29674        f.write_str(self.as_str())
29675    }
29676}
29677
29678impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29679    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29680        f.write_str(self.as_str())
29681    }
29682}
29683impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
29684    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29685    where
29686        S: serde::Serializer,
29687    {
29688        serializer.serialize_str(self.as_str())
29689    }
29690}
29691#[cfg(feature = "deserialize")]
29692impl<'de> serde::Deserialize<'de>
29693    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
29694{
29695    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29696        use std::str::FromStr;
29697        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29698        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"))
29699    }
29700}
29701/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
29702#[derive(Copy, Clone, Debug, serde::Serialize)]
29703pub struct ConfirmPaymentIntentPaymentMethodOptionsEps {
29704    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29705    ///
29706    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29707    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29708    ///
29709    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29710    ///
29711    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29712    ///
29713    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29714    #[serde(skip_serializing_if = "Option::is_none")]
29715    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
29716}
29717impl ConfirmPaymentIntentPaymentMethodOptionsEps {
29718    pub fn new() -> Self {
29719        Self { setup_future_usage: None }
29720    }
29721}
29722impl Default for ConfirmPaymentIntentPaymentMethodOptionsEps {
29723    fn default() -> Self {
29724        Self::new()
29725    }
29726}
29727/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29728///
29729/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29730/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29731///
29732/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29733///
29734/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29735///
29736/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29737#[derive(Copy, Clone, Eq, PartialEq)]
29738pub enum ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29739    None,
29740}
29741impl ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29742    pub fn as_str(self) -> &'static str {
29743        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
29744        match self {
29745            None => "none",
29746        }
29747    }
29748}
29749
29750impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29751    type Err = stripe_types::StripeParseError;
29752    fn from_str(s: &str) -> Result<Self, Self::Err> {
29753        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
29754        match s {
29755            "none" => Ok(None),
29756            _ => Err(stripe_types::StripeParseError),
29757        }
29758    }
29759}
29760impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29761    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29762        f.write_str(self.as_str())
29763    }
29764}
29765
29766impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29767    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29768        f.write_str(self.as_str())
29769    }
29770}
29771impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29772    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29773    where
29774        S: serde::Serializer,
29775    {
29776        serializer.serialize_str(self.as_str())
29777    }
29778}
29779#[cfg(feature = "deserialize")]
29780impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
29781    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29782        use std::str::FromStr;
29783        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29784        Self::from_str(&s).map_err(|_| {
29785            serde::de::Error::custom(
29786                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage",
29787            )
29788        })
29789    }
29790}
29791/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
29792#[derive(Copy, Clone, Debug, serde::Serialize)]
29793pub struct ConfirmPaymentIntentPaymentMethodOptionsFpx {
29794    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29795    ///
29796    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29797    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29798    ///
29799    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29800    ///
29801    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29802    ///
29803    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29804    #[serde(skip_serializing_if = "Option::is_none")]
29805    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
29806}
29807impl ConfirmPaymentIntentPaymentMethodOptionsFpx {
29808    pub fn new() -> Self {
29809        Self { setup_future_usage: None }
29810    }
29811}
29812impl Default for ConfirmPaymentIntentPaymentMethodOptionsFpx {
29813    fn default() -> Self {
29814        Self::new()
29815    }
29816}
29817/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29818///
29819/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29820/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29821///
29822/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29823///
29824/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29825///
29826/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29827#[derive(Copy, Clone, Eq, PartialEq)]
29828pub enum ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29829    None,
29830}
29831impl ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29832    pub fn as_str(self) -> &'static str {
29833        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
29834        match self {
29835            None => "none",
29836        }
29837    }
29838}
29839
29840impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29841    type Err = stripe_types::StripeParseError;
29842    fn from_str(s: &str) -> Result<Self, Self::Err> {
29843        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
29844        match s {
29845            "none" => Ok(None),
29846            _ => Err(stripe_types::StripeParseError),
29847        }
29848    }
29849}
29850impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29852        f.write_str(self.as_str())
29853    }
29854}
29855
29856impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29857    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29858        f.write_str(self.as_str())
29859    }
29860}
29861impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29862    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29863    where
29864        S: serde::Serializer,
29865    {
29866        serializer.serialize_str(self.as_str())
29867    }
29868}
29869#[cfg(feature = "deserialize")]
29870impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
29871    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29872        use std::str::FromStr;
29873        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29874        Self::from_str(&s).map_err(|_| {
29875            serde::de::Error::custom(
29876                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage",
29877            )
29878        })
29879    }
29880}
29881/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
29882#[derive(Copy, Clone, Debug, serde::Serialize)]
29883pub struct ConfirmPaymentIntentPaymentMethodOptionsGiropay {
29884    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29885    ///
29886    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29887    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29888    ///
29889    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29890    ///
29891    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29892    ///
29893    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29894    #[serde(skip_serializing_if = "Option::is_none")]
29895    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
29896}
29897impl ConfirmPaymentIntentPaymentMethodOptionsGiropay {
29898    pub fn new() -> Self {
29899        Self { setup_future_usage: None }
29900    }
29901}
29902impl Default for ConfirmPaymentIntentPaymentMethodOptionsGiropay {
29903    fn default() -> Self {
29904        Self::new()
29905    }
29906}
29907/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29908///
29909/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29910/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29911///
29912/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29913///
29914/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29915///
29916/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29917#[derive(Copy, Clone, Eq, PartialEq)]
29918pub enum ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
29919    None,
29920}
29921impl ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
29922    pub fn as_str(self) -> &'static str {
29923        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
29924        match self {
29925            None => "none",
29926        }
29927    }
29928}
29929
29930impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
29931    type Err = stripe_types::StripeParseError;
29932    fn from_str(s: &str) -> Result<Self, Self::Err> {
29933        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
29934        match s {
29935            "none" => Ok(None),
29936            _ => Err(stripe_types::StripeParseError),
29937        }
29938    }
29939}
29940impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
29941    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29942        f.write_str(self.as_str())
29943    }
29944}
29945
29946impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
29947    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29948        f.write_str(self.as_str())
29949    }
29950}
29951impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
29952    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29953    where
29954        S: serde::Serializer,
29955    {
29956        serializer.serialize_str(self.as_str())
29957    }
29958}
29959#[cfg(feature = "deserialize")]
29960impl<'de> serde::Deserialize<'de>
29961    for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
29962{
29963    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29964        use std::str::FromStr;
29965        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29966        Self::from_str(&s).map_err(|_| {
29967            serde::de::Error::custom(
29968                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage",
29969            )
29970        })
29971    }
29972}
29973/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
29974#[derive(Copy, Clone, Debug, serde::Serialize)]
29975pub struct ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
29976    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29977    ///
29978    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29979    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29980    ///
29981    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29982    ///
29983    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29984    ///
29985    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29986    #[serde(skip_serializing_if = "Option::is_none")]
29987    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
29988}
29989impl ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
29990    pub fn new() -> Self {
29991        Self { setup_future_usage: None }
29992    }
29993}
29994impl Default for ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
29995    fn default() -> Self {
29996        Self::new()
29997    }
29998}
29999/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30000///
30001/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30002/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30003///
30004/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30005///
30006/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30007///
30008/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30009#[derive(Copy, Clone, Eq, PartialEq)]
30010pub enum ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30011    None,
30012}
30013impl ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30014    pub fn as_str(self) -> &'static str {
30015        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
30016        match self {
30017            None => "none",
30018        }
30019    }
30020}
30021
30022impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30023    type Err = stripe_types::StripeParseError;
30024    fn from_str(s: &str) -> Result<Self, Self::Err> {
30025        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
30026        match s {
30027            "none" => Ok(None),
30028            _ => Err(stripe_types::StripeParseError),
30029        }
30030    }
30031}
30032impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30033    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30034        f.write_str(self.as_str())
30035    }
30036}
30037
30038impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30039    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30040        f.write_str(self.as_str())
30041    }
30042}
30043impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
30044    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30045    where
30046        S: serde::Serializer,
30047    {
30048        serializer.serialize_str(self.as_str())
30049    }
30050}
30051#[cfg(feature = "deserialize")]
30052impl<'de> serde::Deserialize<'de>
30053    for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
30054{
30055    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30056        use std::str::FromStr;
30057        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30058        Self::from_str(&s).map_err(|_| {
30059            serde::de::Error::custom(
30060                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage",
30061            )
30062        })
30063    }
30064}
30065/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
30066#[derive(Copy, Clone, Debug, serde::Serialize)]
30067pub struct ConfirmPaymentIntentPaymentMethodOptionsIdeal {
30068    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30069    ///
30070    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30071    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30072    ///
30073    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30074    ///
30075    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30076    ///
30077    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30078    #[serde(skip_serializing_if = "Option::is_none")]
30079    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
30080}
30081impl ConfirmPaymentIntentPaymentMethodOptionsIdeal {
30082    pub fn new() -> Self {
30083        Self { setup_future_usage: None }
30084    }
30085}
30086impl Default for ConfirmPaymentIntentPaymentMethodOptionsIdeal {
30087    fn default() -> Self {
30088        Self::new()
30089    }
30090}
30091/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30092///
30093/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30094/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30095///
30096/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30097///
30098/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30099///
30100/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30101#[derive(Copy, Clone, Eq, PartialEq)]
30102pub enum ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30103    None,
30104    OffSession,
30105}
30106impl ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30107    pub fn as_str(self) -> &'static str {
30108        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
30109        match self {
30110            None => "none",
30111            OffSession => "off_session",
30112        }
30113    }
30114}
30115
30116impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30117    type Err = stripe_types::StripeParseError;
30118    fn from_str(s: &str) -> Result<Self, Self::Err> {
30119        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
30120        match s {
30121            "none" => Ok(None),
30122            "off_session" => Ok(OffSession),
30123            _ => Err(stripe_types::StripeParseError),
30124        }
30125    }
30126}
30127impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30129        f.write_str(self.as_str())
30130    }
30131}
30132
30133impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30135        f.write_str(self.as_str())
30136    }
30137}
30138impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
30139    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30140    where
30141        S: serde::Serializer,
30142    {
30143        serializer.serialize_str(self.as_str())
30144    }
30145}
30146#[cfg(feature = "deserialize")]
30147impl<'de> serde::Deserialize<'de>
30148    for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage
30149{
30150    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30151        use std::str::FromStr;
30152        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30153        Self::from_str(&s).map_err(|_| {
30154            serde::de::Error::custom(
30155                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage",
30156            )
30157        })
30158    }
30159}
30160/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
30161#[derive(Copy, Clone, Debug, serde::Serialize)]
30162pub struct ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
30163    /// Controls when the funds are captured from the customer's account.
30164    ///
30165    /// 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.
30166    ///
30167    /// 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.
30168    #[serde(skip_serializing_if = "Option::is_none")]
30169    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
30170    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30171    ///
30172    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30173    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30174    ///
30175    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30176    ///
30177    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30178    #[serde(skip_serializing_if = "Option::is_none")]
30179    pub setup_future_usage:
30180        Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
30181}
30182impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
30183    pub fn new() -> Self {
30184        Self { capture_method: None, setup_future_usage: None }
30185    }
30186}
30187impl Default for ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
30188    fn default() -> Self {
30189        Self::new()
30190    }
30191}
30192/// Controls when the funds are captured from the customer's account.
30193///
30194/// 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.
30195///
30196/// 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.
30197#[derive(Copy, Clone, Eq, PartialEq)]
30198pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30199    Manual,
30200}
30201impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30202    pub fn as_str(self) -> &'static str {
30203        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
30204        match self {
30205            Manual => "manual",
30206        }
30207    }
30208}
30209
30210impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30211    type Err = stripe_types::StripeParseError;
30212    fn from_str(s: &str) -> Result<Self, Self::Err> {
30213        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
30214        match s {
30215            "manual" => Ok(Manual),
30216            _ => Err(stripe_types::StripeParseError),
30217        }
30218    }
30219}
30220impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30221    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30222        f.write_str(self.as_str())
30223    }
30224}
30225
30226impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30228        f.write_str(self.as_str())
30229    }
30230}
30231impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
30232    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30233    where
30234        S: serde::Serializer,
30235    {
30236        serializer.serialize_str(self.as_str())
30237    }
30238}
30239#[cfg(feature = "deserialize")]
30240impl<'de> serde::Deserialize<'de>
30241    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod
30242{
30243    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30244        use std::str::FromStr;
30245        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30246        Self::from_str(&s).map_err(|_| {
30247            serde::de::Error::custom(
30248                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod",
30249            )
30250        })
30251    }
30252}
30253/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30254///
30255/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30256/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30257///
30258/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30259///
30260/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30261#[derive(Copy, Clone, Eq, PartialEq)]
30262pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30263    None,
30264    OffSession,
30265}
30266impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30267    pub fn as_str(self) -> &'static str {
30268        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
30269        match self {
30270            None => "none",
30271            OffSession => "off_session",
30272        }
30273    }
30274}
30275
30276impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30277    type Err = stripe_types::StripeParseError;
30278    fn from_str(s: &str) -> Result<Self, Self::Err> {
30279        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
30280        match s {
30281            "none" => Ok(None),
30282            "off_session" => Ok(OffSession),
30283            _ => Err(stripe_types::StripeParseError),
30284        }
30285    }
30286}
30287impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30288    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30289        f.write_str(self.as_str())
30290    }
30291}
30292
30293impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30294    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30295        f.write_str(self.as_str())
30296    }
30297}
30298impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
30299    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30300    where
30301        S: serde::Serializer,
30302    {
30303        serializer.serialize_str(self.as_str())
30304    }
30305}
30306#[cfg(feature = "deserialize")]
30307impl<'de> serde::Deserialize<'de>
30308    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
30309{
30310    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30311        use std::str::FromStr;
30312        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30313        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage"))
30314    }
30315}
30316/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
30317#[derive(Clone, Debug, serde::Serialize)]
30318pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarna {
30319    /// Controls when the funds are captured from the customer's account.
30320    ///
30321    /// 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.
30322    ///
30323    /// 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.
30324    #[serde(skip_serializing_if = "Option::is_none")]
30325    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
30326    /// On-demand details if setting up or charging an on-demand payment.
30327    #[serde(skip_serializing_if = "Option::is_none")]
30328    pub on_demand: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
30329    /// Preferred language of the Klarna authorization page that the customer is redirected to
30330    #[serde(skip_serializing_if = "Option::is_none")]
30331    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
30332    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30333    ///
30334    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30335    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30336    ///
30337    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30338    ///
30339    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30340    ///
30341    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30342    #[serde(skip_serializing_if = "Option::is_none")]
30343    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
30344    /// Subscription details if setting up or charging a subscription.
30345    #[serde(skip_serializing_if = "Option::is_none")]
30346    pub subscriptions: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
30347}
30348impl ConfirmPaymentIntentPaymentMethodOptionsKlarna {
30349    pub fn new() -> Self {
30350        Self {
30351            capture_method: None,
30352            on_demand: None,
30353            preferred_locale: None,
30354            setup_future_usage: None,
30355            subscriptions: None,
30356        }
30357    }
30358}
30359impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarna {
30360    fn default() -> Self {
30361        Self::new()
30362    }
30363}
30364/// Controls when the funds are captured from the customer's account.
30365///
30366/// 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.
30367///
30368/// 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.
30369#[derive(Copy, Clone, Eq, PartialEq)]
30370pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30371    Manual,
30372}
30373impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30374    pub fn as_str(self) -> &'static str {
30375        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
30376        match self {
30377            Manual => "manual",
30378        }
30379    }
30380}
30381
30382impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30383    type Err = stripe_types::StripeParseError;
30384    fn from_str(s: &str) -> Result<Self, Self::Err> {
30385        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
30386        match s {
30387            "manual" => Ok(Manual),
30388            _ => Err(stripe_types::StripeParseError),
30389        }
30390    }
30391}
30392impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30394        f.write_str(self.as_str())
30395    }
30396}
30397
30398impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30399    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30400        f.write_str(self.as_str())
30401    }
30402}
30403impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30404    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30405    where
30406        S: serde::Serializer,
30407    {
30408        serializer.serialize_str(self.as_str())
30409    }
30410}
30411#[cfg(feature = "deserialize")]
30412impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
30413    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30414        use std::str::FromStr;
30415        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30416        Self::from_str(&s).map_err(|_| {
30417            serde::de::Error::custom(
30418                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod",
30419            )
30420        })
30421    }
30422}
30423/// On-demand details if setting up or charging an on-demand payment.
30424#[derive(Copy, Clone, Debug, serde::Serialize)]
30425pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
30426    /// Your average amount value.
30427    /// You can use a value across your customer base, or segment based on customer type, country, etc.
30428    #[serde(skip_serializing_if = "Option::is_none")]
30429    pub average_amount: Option<i64>,
30430    /// The maximum value you may charge a customer per purchase.
30431    /// You can use a value across your customer base, or segment based on customer type, country, etc.
30432    #[serde(skip_serializing_if = "Option::is_none")]
30433    pub maximum_amount: Option<i64>,
30434    /// The lowest or minimum value you may charge a customer per purchase.
30435    /// You can use a value across your customer base, or segment based on customer type, country, etc.
30436    #[serde(skip_serializing_if = "Option::is_none")]
30437    pub minimum_amount: Option<i64>,
30438    /// Interval at which the customer is making purchases
30439    #[serde(skip_serializing_if = "Option::is_none")]
30440    pub purchase_interval:
30441        Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
30442    /// The number of `purchase_interval` between charges
30443    #[serde(skip_serializing_if = "Option::is_none")]
30444    pub purchase_interval_count: Option<u64>,
30445}
30446impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
30447    pub fn new() -> Self {
30448        Self {
30449            average_amount: None,
30450            maximum_amount: None,
30451            minimum_amount: None,
30452            purchase_interval: None,
30453            purchase_interval_count: None,
30454        }
30455    }
30456}
30457impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
30458    fn default() -> Self {
30459        Self::new()
30460    }
30461}
30462/// Interval at which the customer is making purchases
30463#[derive(Copy, Clone, Eq, PartialEq)]
30464pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30465    Day,
30466    Month,
30467    Week,
30468    Year,
30469}
30470impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30471    pub fn as_str(self) -> &'static str {
30472        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
30473        match self {
30474            Day => "day",
30475            Month => "month",
30476            Week => "week",
30477            Year => "year",
30478        }
30479    }
30480}
30481
30482impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30483    type Err = stripe_types::StripeParseError;
30484    fn from_str(s: &str) -> Result<Self, Self::Err> {
30485        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
30486        match s {
30487            "day" => Ok(Day),
30488            "month" => Ok(Month),
30489            "week" => Ok(Week),
30490            "year" => Ok(Year),
30491            _ => Err(stripe_types::StripeParseError),
30492        }
30493    }
30494}
30495impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30496    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30497        f.write_str(self.as_str())
30498    }
30499}
30500
30501impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30502    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30503        f.write_str(self.as_str())
30504    }
30505}
30506impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
30507    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30508    where
30509        S: serde::Serializer,
30510    {
30511        serializer.serialize_str(self.as_str())
30512    }
30513}
30514#[cfg(feature = "deserialize")]
30515impl<'de> serde::Deserialize<'de>
30516    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
30517{
30518    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30519        use std::str::FromStr;
30520        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30521        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"))
30522    }
30523}
30524/// Preferred language of the Klarna authorization page that the customer is redirected to
30525#[derive(Clone, Eq, PartialEq)]
30526#[non_exhaustive]
30527pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30528    CsMinusCz,
30529    DaMinusDk,
30530    DeMinusAt,
30531    DeMinusCh,
30532    DeMinusDe,
30533    ElMinusGr,
30534    EnMinusAt,
30535    EnMinusAu,
30536    EnMinusBe,
30537    EnMinusCa,
30538    EnMinusCh,
30539    EnMinusCz,
30540    EnMinusDe,
30541    EnMinusDk,
30542    EnMinusEs,
30543    EnMinusFi,
30544    EnMinusFr,
30545    EnMinusGb,
30546    EnMinusGr,
30547    EnMinusIe,
30548    EnMinusIt,
30549    EnMinusNl,
30550    EnMinusNo,
30551    EnMinusNz,
30552    EnMinusPl,
30553    EnMinusPt,
30554    EnMinusRo,
30555    EnMinusSe,
30556    EnMinusUs,
30557    EsMinusEs,
30558    EsMinusUs,
30559    FiMinusFi,
30560    FrMinusBe,
30561    FrMinusCa,
30562    FrMinusCh,
30563    FrMinusFr,
30564    ItMinusCh,
30565    ItMinusIt,
30566    NbMinusNo,
30567    NlMinusBe,
30568    NlMinusNl,
30569    PlMinusPl,
30570    PtMinusPt,
30571    RoMinusRo,
30572    SvMinusFi,
30573    SvMinusSe,
30574    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30575    Unknown(String),
30576}
30577impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30578    pub fn as_str(&self) -> &str {
30579        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
30580        match self {
30581            CsMinusCz => "cs-CZ",
30582            DaMinusDk => "da-DK",
30583            DeMinusAt => "de-AT",
30584            DeMinusCh => "de-CH",
30585            DeMinusDe => "de-DE",
30586            ElMinusGr => "el-GR",
30587            EnMinusAt => "en-AT",
30588            EnMinusAu => "en-AU",
30589            EnMinusBe => "en-BE",
30590            EnMinusCa => "en-CA",
30591            EnMinusCh => "en-CH",
30592            EnMinusCz => "en-CZ",
30593            EnMinusDe => "en-DE",
30594            EnMinusDk => "en-DK",
30595            EnMinusEs => "en-ES",
30596            EnMinusFi => "en-FI",
30597            EnMinusFr => "en-FR",
30598            EnMinusGb => "en-GB",
30599            EnMinusGr => "en-GR",
30600            EnMinusIe => "en-IE",
30601            EnMinusIt => "en-IT",
30602            EnMinusNl => "en-NL",
30603            EnMinusNo => "en-NO",
30604            EnMinusNz => "en-NZ",
30605            EnMinusPl => "en-PL",
30606            EnMinusPt => "en-PT",
30607            EnMinusRo => "en-RO",
30608            EnMinusSe => "en-SE",
30609            EnMinusUs => "en-US",
30610            EsMinusEs => "es-ES",
30611            EsMinusUs => "es-US",
30612            FiMinusFi => "fi-FI",
30613            FrMinusBe => "fr-BE",
30614            FrMinusCa => "fr-CA",
30615            FrMinusCh => "fr-CH",
30616            FrMinusFr => "fr-FR",
30617            ItMinusCh => "it-CH",
30618            ItMinusIt => "it-IT",
30619            NbMinusNo => "nb-NO",
30620            NlMinusBe => "nl-BE",
30621            NlMinusNl => "nl-NL",
30622            PlMinusPl => "pl-PL",
30623            PtMinusPt => "pt-PT",
30624            RoMinusRo => "ro-RO",
30625            SvMinusFi => "sv-FI",
30626            SvMinusSe => "sv-SE",
30627            Unknown(v) => v,
30628        }
30629    }
30630}
30631
30632impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30633    type Err = std::convert::Infallible;
30634    fn from_str(s: &str) -> Result<Self, Self::Err> {
30635        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
30636        match s {
30637            "cs-CZ" => Ok(CsMinusCz),
30638            "da-DK" => Ok(DaMinusDk),
30639            "de-AT" => Ok(DeMinusAt),
30640            "de-CH" => Ok(DeMinusCh),
30641            "de-DE" => Ok(DeMinusDe),
30642            "el-GR" => Ok(ElMinusGr),
30643            "en-AT" => Ok(EnMinusAt),
30644            "en-AU" => Ok(EnMinusAu),
30645            "en-BE" => Ok(EnMinusBe),
30646            "en-CA" => Ok(EnMinusCa),
30647            "en-CH" => Ok(EnMinusCh),
30648            "en-CZ" => Ok(EnMinusCz),
30649            "en-DE" => Ok(EnMinusDe),
30650            "en-DK" => Ok(EnMinusDk),
30651            "en-ES" => Ok(EnMinusEs),
30652            "en-FI" => Ok(EnMinusFi),
30653            "en-FR" => Ok(EnMinusFr),
30654            "en-GB" => Ok(EnMinusGb),
30655            "en-GR" => Ok(EnMinusGr),
30656            "en-IE" => Ok(EnMinusIe),
30657            "en-IT" => Ok(EnMinusIt),
30658            "en-NL" => Ok(EnMinusNl),
30659            "en-NO" => Ok(EnMinusNo),
30660            "en-NZ" => Ok(EnMinusNz),
30661            "en-PL" => Ok(EnMinusPl),
30662            "en-PT" => Ok(EnMinusPt),
30663            "en-RO" => Ok(EnMinusRo),
30664            "en-SE" => Ok(EnMinusSe),
30665            "en-US" => Ok(EnMinusUs),
30666            "es-ES" => Ok(EsMinusEs),
30667            "es-US" => Ok(EsMinusUs),
30668            "fi-FI" => Ok(FiMinusFi),
30669            "fr-BE" => Ok(FrMinusBe),
30670            "fr-CA" => Ok(FrMinusCa),
30671            "fr-CH" => Ok(FrMinusCh),
30672            "fr-FR" => Ok(FrMinusFr),
30673            "it-CH" => Ok(ItMinusCh),
30674            "it-IT" => Ok(ItMinusIt),
30675            "nb-NO" => Ok(NbMinusNo),
30676            "nl-BE" => Ok(NlMinusBe),
30677            "nl-NL" => Ok(NlMinusNl),
30678            "pl-PL" => Ok(PlMinusPl),
30679            "pt-PT" => Ok(PtMinusPt),
30680            "ro-RO" => Ok(RoMinusRo),
30681            "sv-FI" => Ok(SvMinusFi),
30682            "sv-SE" => Ok(SvMinusSe),
30683            v => Ok(Unknown(v.to_owned())),
30684        }
30685    }
30686}
30687impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30688    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30689        f.write_str(self.as_str())
30690    }
30691}
30692
30693impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30694    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30695        f.write_str(self.as_str())
30696    }
30697}
30698impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
30699    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30700    where
30701        S: serde::Serializer,
30702    {
30703        serializer.serialize_str(self.as_str())
30704    }
30705}
30706#[cfg(feature = "deserialize")]
30707impl<'de> serde::Deserialize<'de>
30708    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale
30709{
30710    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30711        use std::str::FromStr;
30712        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30713        Ok(Self::from_str(&s).unwrap())
30714    }
30715}
30716/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30717///
30718/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30719/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30720///
30721/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30722///
30723/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30724///
30725/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30726#[derive(Copy, Clone, Eq, PartialEq)]
30727pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30728    None,
30729    OffSession,
30730    OnSession,
30731}
30732impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30733    pub fn as_str(self) -> &'static str {
30734        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
30735        match self {
30736            None => "none",
30737            OffSession => "off_session",
30738            OnSession => "on_session",
30739        }
30740    }
30741}
30742
30743impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30744    type Err = stripe_types::StripeParseError;
30745    fn from_str(s: &str) -> Result<Self, Self::Err> {
30746        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
30747        match s {
30748            "none" => Ok(None),
30749            "off_session" => Ok(OffSession),
30750            "on_session" => Ok(OnSession),
30751            _ => Err(stripe_types::StripeParseError),
30752        }
30753    }
30754}
30755impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30756    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30757        f.write_str(self.as_str())
30758    }
30759}
30760
30761impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30762    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30763        f.write_str(self.as_str())
30764    }
30765}
30766impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
30767    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30768    where
30769        S: serde::Serializer,
30770    {
30771        serializer.serialize_str(self.as_str())
30772    }
30773}
30774#[cfg(feature = "deserialize")]
30775impl<'de> serde::Deserialize<'de>
30776    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
30777{
30778    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30779        use std::str::FromStr;
30780        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30781        Self::from_str(&s).map_err(|_| {
30782            serde::de::Error::custom(
30783                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage",
30784            )
30785        })
30786    }
30787}
30788/// Subscription details if setting up or charging a subscription.
30789#[derive(Clone, Debug, serde::Serialize)]
30790pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
30791    /// Unit of time between subscription charges.
30792    pub interval: ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
30793    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
30794    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
30795    #[serde(skip_serializing_if = "Option::is_none")]
30796    pub interval_count: Option<u64>,
30797    /// Name for subscription.
30798    #[serde(skip_serializing_if = "Option::is_none")]
30799    pub name: Option<String>,
30800    /// Describes the upcoming charge for this subscription.
30801    #[serde(skip_serializing_if = "Option::is_none")]
30802    pub next_billing: Option<SubscriptionNextBillingParam>,
30803    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
30804    /// Use a value that persists across subscription charges.
30805    pub reference: String,
30806}
30807impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
30808    pub fn new(
30809        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
30810        reference: impl Into<String>,
30811    ) -> Self {
30812        Self {
30813            interval: interval.into(),
30814            interval_count: None,
30815            name: None,
30816            next_billing: None,
30817            reference: reference.into(),
30818        }
30819    }
30820}
30821/// Unit of time between subscription charges.
30822#[derive(Copy, Clone, Eq, PartialEq)]
30823pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
30824    Day,
30825    Month,
30826    Week,
30827    Year,
30828}
30829impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
30830    pub fn as_str(self) -> &'static str {
30831        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
30832        match self {
30833            Day => "day",
30834            Month => "month",
30835            Week => "week",
30836            Year => "year",
30837        }
30838    }
30839}
30840
30841impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
30842    type Err = stripe_types::StripeParseError;
30843    fn from_str(s: &str) -> Result<Self, Self::Err> {
30844        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
30845        match s {
30846            "day" => Ok(Day),
30847            "month" => Ok(Month),
30848            "week" => Ok(Week),
30849            "year" => Ok(Year),
30850            _ => Err(stripe_types::StripeParseError),
30851        }
30852    }
30853}
30854impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
30855    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30856        f.write_str(self.as_str())
30857    }
30858}
30859
30860impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
30861    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30862        f.write_str(self.as_str())
30863    }
30864}
30865impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
30866    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30867    where
30868        S: serde::Serializer,
30869    {
30870        serializer.serialize_str(self.as_str())
30871    }
30872}
30873#[cfg(feature = "deserialize")]
30874impl<'de> serde::Deserialize<'de>
30875    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
30876{
30877    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30878        use std::str::FromStr;
30879        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30880        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"))
30881    }
30882}
30883/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
30884#[derive(Clone, Debug, serde::Serialize)]
30885pub struct ConfirmPaymentIntentPaymentMethodOptionsKonbini {
30886    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
30887    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
30888    /// We recommend to use the customer's phone number.
30889    #[serde(skip_serializing_if = "Option::is_none")]
30890    pub confirmation_number: Option<String>,
30891    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
30892    /// 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.
30893    /// Defaults to 3 days.
30894    #[serde(skip_serializing_if = "Option::is_none")]
30895    pub expires_after_days: Option<u32>,
30896    /// The timestamp at which the Konbini payment instructions will expire.
30897    /// Only one of `expires_after_days` or `expires_at` may be set.
30898    #[serde(skip_serializing_if = "Option::is_none")]
30899    pub expires_at: Option<stripe_types::Timestamp>,
30900    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
30901    #[serde(skip_serializing_if = "Option::is_none")]
30902    pub product_description: Option<String>,
30903    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30904    ///
30905    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30906    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30907    ///
30908    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30909    ///
30910    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30911    ///
30912    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30913    #[serde(skip_serializing_if = "Option::is_none")]
30914    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
30915}
30916impl ConfirmPaymentIntentPaymentMethodOptionsKonbini {
30917    pub fn new() -> Self {
30918        Self {
30919            confirmation_number: None,
30920            expires_after_days: None,
30921            expires_at: None,
30922            product_description: None,
30923            setup_future_usage: None,
30924        }
30925    }
30926}
30927impl Default for ConfirmPaymentIntentPaymentMethodOptionsKonbini {
30928    fn default() -> Self {
30929        Self::new()
30930    }
30931}
30932/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
30933///
30934/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
30935/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
30936///
30937/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
30938///
30939/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
30940///
30941/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
30942#[derive(Copy, Clone, Eq, PartialEq)]
30943pub enum ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
30944    None,
30945}
30946impl ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
30947    pub fn as_str(self) -> &'static str {
30948        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
30949        match self {
30950            None => "none",
30951        }
30952    }
30953}
30954
30955impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
30956    type Err = stripe_types::StripeParseError;
30957    fn from_str(s: &str) -> Result<Self, Self::Err> {
30958        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
30959        match s {
30960            "none" => Ok(None),
30961            _ => Err(stripe_types::StripeParseError),
30962        }
30963    }
30964}
30965impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
30966    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30967        f.write_str(self.as_str())
30968    }
30969}
30970
30971impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
30972    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30973        f.write_str(self.as_str())
30974    }
30975}
30976impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
30977    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30978    where
30979        S: serde::Serializer,
30980    {
30981        serializer.serialize_str(self.as_str())
30982    }
30983}
30984#[cfg(feature = "deserialize")]
30985impl<'de> serde::Deserialize<'de>
30986    for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
30987{
30988    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30989        use std::str::FromStr;
30990        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30991        Self::from_str(&s).map_err(|_| {
30992            serde::de::Error::custom(
30993                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage",
30994            )
30995        })
30996    }
30997}
30998/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
30999#[derive(Copy, Clone, Debug, serde::Serialize)]
31000pub struct ConfirmPaymentIntentPaymentMethodOptionsKrCard {
31001    /// Controls when the funds are captured from the customer's account.
31002    ///
31003    /// 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.
31004    ///
31005    /// 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.
31006    #[serde(skip_serializing_if = "Option::is_none")]
31007    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
31008    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31009    ///
31010    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31011    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31012    ///
31013    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31014    ///
31015    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31016    #[serde(skip_serializing_if = "Option::is_none")]
31017    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
31018}
31019impl ConfirmPaymentIntentPaymentMethodOptionsKrCard {
31020    pub fn new() -> Self {
31021        Self { capture_method: None, setup_future_usage: None }
31022    }
31023}
31024impl Default for ConfirmPaymentIntentPaymentMethodOptionsKrCard {
31025    fn default() -> Self {
31026        Self::new()
31027    }
31028}
31029/// Controls when the funds are captured from the customer's account.
31030///
31031/// 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.
31032///
31033/// 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.
31034#[derive(Copy, Clone, Eq, PartialEq)]
31035pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31036    Manual,
31037}
31038impl ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31039    pub fn as_str(self) -> &'static str {
31040        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
31041        match self {
31042            Manual => "manual",
31043        }
31044    }
31045}
31046
31047impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31048    type Err = stripe_types::StripeParseError;
31049    fn from_str(s: &str) -> Result<Self, Self::Err> {
31050        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
31051        match s {
31052            "manual" => Ok(Manual),
31053            _ => Err(stripe_types::StripeParseError),
31054        }
31055    }
31056}
31057impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31058    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31059        f.write_str(self.as_str())
31060    }
31061}
31062
31063impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31064    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31065        f.write_str(self.as_str())
31066    }
31067}
31068impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31069    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31070    where
31071        S: serde::Serializer,
31072    {
31073        serializer.serialize_str(self.as_str())
31074    }
31075}
31076#[cfg(feature = "deserialize")]
31077impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
31078    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31079        use std::str::FromStr;
31080        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31081        Self::from_str(&s).map_err(|_| {
31082            serde::de::Error::custom(
31083                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod",
31084            )
31085        })
31086    }
31087}
31088/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31089///
31090/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31091/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31092///
31093/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31094///
31095/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31096#[derive(Copy, Clone, Eq, PartialEq)]
31097pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31098    None,
31099    OffSession,
31100}
31101impl ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31102    pub fn as_str(self) -> &'static str {
31103        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
31104        match self {
31105            None => "none",
31106            OffSession => "off_session",
31107        }
31108    }
31109}
31110
31111impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31112    type Err = stripe_types::StripeParseError;
31113    fn from_str(s: &str) -> Result<Self, Self::Err> {
31114        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
31115        match s {
31116            "none" => Ok(None),
31117            "off_session" => Ok(OffSession),
31118            _ => Err(stripe_types::StripeParseError),
31119        }
31120    }
31121}
31122impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31123    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31124        f.write_str(self.as_str())
31125    }
31126}
31127
31128impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31130        f.write_str(self.as_str())
31131    }
31132}
31133impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
31134    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31135    where
31136        S: serde::Serializer,
31137    {
31138        serializer.serialize_str(self.as_str())
31139    }
31140}
31141#[cfg(feature = "deserialize")]
31142impl<'de> serde::Deserialize<'de>
31143    for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
31144{
31145    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31146        use std::str::FromStr;
31147        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31148        Self::from_str(&s).map_err(|_| {
31149            serde::de::Error::custom(
31150                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage",
31151            )
31152        })
31153    }
31154}
31155/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
31156#[derive(Clone, Debug, serde::Serialize)]
31157pub struct ConfirmPaymentIntentPaymentMethodOptionsLink {
31158    /// Controls when the funds are captured from the customer's account.
31159    ///
31160    /// 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.
31161    ///
31162    /// 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.
31163    #[serde(skip_serializing_if = "Option::is_none")]
31164    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
31165    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
31166    #[serde(skip_serializing_if = "Option::is_none")]
31167    pub persistent_token: Option<String>,
31168    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31169    ///
31170    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31171    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31172    ///
31173    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31174    ///
31175    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31176    ///
31177    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31178    #[serde(skip_serializing_if = "Option::is_none")]
31179    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
31180}
31181impl ConfirmPaymentIntentPaymentMethodOptionsLink {
31182    pub fn new() -> Self {
31183        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
31184    }
31185}
31186impl Default for ConfirmPaymentIntentPaymentMethodOptionsLink {
31187    fn default() -> Self {
31188        Self::new()
31189    }
31190}
31191/// Controls when the funds are captured from the customer's account.
31192///
31193/// 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.
31194///
31195/// 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.
31196#[derive(Copy, Clone, Eq, PartialEq)]
31197pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31198    Manual,
31199}
31200impl ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31201    pub fn as_str(self) -> &'static str {
31202        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
31203        match self {
31204            Manual => "manual",
31205        }
31206    }
31207}
31208
31209impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31210    type Err = stripe_types::StripeParseError;
31211    fn from_str(s: &str) -> Result<Self, Self::Err> {
31212        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
31213        match s {
31214            "manual" => Ok(Manual),
31215            _ => Err(stripe_types::StripeParseError),
31216        }
31217    }
31218}
31219impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31220    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31221        f.write_str(self.as_str())
31222    }
31223}
31224
31225impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31226    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31227        f.write_str(self.as_str())
31228    }
31229}
31230impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31231    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31232    where
31233        S: serde::Serializer,
31234    {
31235        serializer.serialize_str(self.as_str())
31236    }
31237}
31238#[cfg(feature = "deserialize")]
31239impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
31240    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31241        use std::str::FromStr;
31242        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31243        Self::from_str(&s).map_err(|_| {
31244            serde::de::Error::custom(
31245                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod",
31246            )
31247        })
31248    }
31249}
31250/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31251///
31252/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31253/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31254///
31255/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31256///
31257/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31258///
31259/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31260#[derive(Copy, Clone, Eq, PartialEq)]
31261pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31262    None,
31263    OffSession,
31264}
31265impl ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31266    pub fn as_str(self) -> &'static str {
31267        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
31268        match self {
31269            None => "none",
31270            OffSession => "off_session",
31271        }
31272    }
31273}
31274
31275impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31276    type Err = stripe_types::StripeParseError;
31277    fn from_str(s: &str) -> Result<Self, Self::Err> {
31278        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
31279        match s {
31280            "none" => Ok(None),
31281            "off_session" => Ok(OffSession),
31282            _ => Err(stripe_types::StripeParseError),
31283        }
31284    }
31285}
31286impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31287    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31288        f.write_str(self.as_str())
31289    }
31290}
31291
31292impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31293    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31294        f.write_str(self.as_str())
31295    }
31296}
31297impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31298    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31299    where
31300        S: serde::Serializer,
31301    {
31302        serializer.serialize_str(self.as_str())
31303    }
31304}
31305#[cfg(feature = "deserialize")]
31306impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
31307    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31308        use std::str::FromStr;
31309        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31310        Self::from_str(&s).map_err(|_| {
31311            serde::de::Error::custom(
31312                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage",
31313            )
31314        })
31315    }
31316}
31317/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
31318#[derive(Copy, Clone, Debug, serde::Serialize)]
31319pub struct ConfirmPaymentIntentPaymentMethodOptionsMbWay {
31320    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31321    ///
31322    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31323    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31324    ///
31325    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31326    ///
31327    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31328    ///
31329    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31330    #[serde(skip_serializing_if = "Option::is_none")]
31331    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
31332}
31333impl ConfirmPaymentIntentPaymentMethodOptionsMbWay {
31334    pub fn new() -> Self {
31335        Self { setup_future_usage: None }
31336    }
31337}
31338impl Default for ConfirmPaymentIntentPaymentMethodOptionsMbWay {
31339    fn default() -> Self {
31340        Self::new()
31341    }
31342}
31343/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31344///
31345/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31346/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31347///
31348/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31349///
31350/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31351///
31352/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31353#[derive(Copy, Clone, Eq, PartialEq)]
31354pub enum ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31355    None,
31356}
31357impl ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31358    pub fn as_str(self) -> &'static str {
31359        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
31360        match self {
31361            None => "none",
31362        }
31363    }
31364}
31365
31366impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31367    type Err = stripe_types::StripeParseError;
31368    fn from_str(s: &str) -> Result<Self, Self::Err> {
31369        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
31370        match s {
31371            "none" => Ok(None),
31372            _ => Err(stripe_types::StripeParseError),
31373        }
31374    }
31375}
31376impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31377    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31378        f.write_str(self.as_str())
31379    }
31380}
31381
31382impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31383    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31384        f.write_str(self.as_str())
31385    }
31386}
31387impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
31388    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31389    where
31390        S: serde::Serializer,
31391    {
31392        serializer.serialize_str(self.as_str())
31393    }
31394}
31395#[cfg(feature = "deserialize")]
31396impl<'de> serde::Deserialize<'de>
31397    for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage
31398{
31399    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31400        use std::str::FromStr;
31401        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31402        Self::from_str(&s).map_err(|_| {
31403            serde::de::Error::custom(
31404                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage",
31405            )
31406        })
31407    }
31408}
31409/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
31410#[derive(Copy, Clone, Debug, serde::Serialize)]
31411pub struct ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
31412    /// Controls when the funds are captured from the customer's account.
31413    ///
31414    /// 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.
31415    ///
31416    /// 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.
31417    #[serde(skip_serializing_if = "Option::is_none")]
31418    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
31419    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31420    ///
31421    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31422    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31423    ///
31424    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31425    ///
31426    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31427    ///
31428    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31429    #[serde(skip_serializing_if = "Option::is_none")]
31430    pub setup_future_usage:
31431        Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
31432}
31433impl ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
31434    pub fn new() -> Self {
31435        Self { capture_method: None, setup_future_usage: None }
31436    }
31437}
31438impl Default for ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
31439    fn default() -> Self {
31440        Self::new()
31441    }
31442}
31443/// Controls when the funds are captured from the customer's account.
31444///
31445/// 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.
31446///
31447/// 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.
31448#[derive(Copy, Clone, Eq, PartialEq)]
31449pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31450    Manual,
31451}
31452impl ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31453    pub fn as_str(self) -> &'static str {
31454        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
31455        match self {
31456            Manual => "manual",
31457        }
31458    }
31459}
31460
31461impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31462    type Err = stripe_types::StripeParseError;
31463    fn from_str(s: &str) -> Result<Self, Self::Err> {
31464        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
31465        match s {
31466            "manual" => Ok(Manual),
31467            _ => Err(stripe_types::StripeParseError),
31468        }
31469    }
31470}
31471impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31472    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31473        f.write_str(self.as_str())
31474    }
31475}
31476
31477impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31479        f.write_str(self.as_str())
31480    }
31481}
31482impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
31483    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31484    where
31485        S: serde::Serializer,
31486    {
31487        serializer.serialize_str(self.as_str())
31488    }
31489}
31490#[cfg(feature = "deserialize")]
31491impl<'de> serde::Deserialize<'de>
31492    for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
31493{
31494    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31495        use std::str::FromStr;
31496        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31497        Self::from_str(&s).map_err(|_| {
31498            serde::de::Error::custom(
31499                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod",
31500            )
31501        })
31502    }
31503}
31504/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31505///
31506/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31507/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31508///
31509/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31510///
31511/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31512///
31513/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31514#[derive(Copy, Clone, Eq, PartialEq)]
31515pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31516    None,
31517}
31518impl ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31519    pub fn as_str(self) -> &'static str {
31520        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
31521        match self {
31522            None => "none",
31523        }
31524    }
31525}
31526
31527impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31528    type Err = stripe_types::StripeParseError;
31529    fn from_str(s: &str) -> Result<Self, Self::Err> {
31530        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
31531        match s {
31532            "none" => Ok(None),
31533            _ => Err(stripe_types::StripeParseError),
31534        }
31535    }
31536}
31537impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31538    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31539        f.write_str(self.as_str())
31540    }
31541}
31542
31543impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31544    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31545        f.write_str(self.as_str())
31546    }
31547}
31548impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
31549    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31550    where
31551        S: serde::Serializer,
31552    {
31553        serializer.serialize_str(self.as_str())
31554    }
31555}
31556#[cfg(feature = "deserialize")]
31557impl<'de> serde::Deserialize<'de>
31558    for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
31559{
31560    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31561        use std::str::FromStr;
31562        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31563        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"))
31564    }
31565}
31566/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
31567#[derive(Copy, Clone, Debug, serde::Serialize)]
31568pub struct ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
31569    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31570    ///
31571    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31572    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31573    ///
31574    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31575    ///
31576    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31577    ///
31578    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31579    #[serde(skip_serializing_if = "Option::is_none")]
31580    pub setup_future_usage:
31581        Option<ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
31582}
31583impl ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
31584    pub fn new() -> Self {
31585        Self { setup_future_usage: None }
31586    }
31587}
31588impl Default for ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
31589    fn default() -> Self {
31590        Self::new()
31591    }
31592}
31593/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31594///
31595/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31596/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31597///
31598/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31599///
31600/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31601///
31602/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31603#[derive(Copy, Clone, Eq, PartialEq)]
31604pub enum ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31605    None,
31606}
31607impl ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31608    pub fn as_str(self) -> &'static str {
31609        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
31610        match self {
31611            None => "none",
31612        }
31613    }
31614}
31615
31616impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31617    type Err = stripe_types::StripeParseError;
31618    fn from_str(s: &str) -> Result<Self, Self::Err> {
31619        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
31620        match s {
31621            "none" => Ok(None),
31622            _ => Err(stripe_types::StripeParseError),
31623        }
31624    }
31625}
31626impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31628        f.write_str(self.as_str())
31629    }
31630}
31631
31632impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31633    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31634        f.write_str(self.as_str())
31635    }
31636}
31637impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
31638    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31639    where
31640        S: serde::Serializer,
31641    {
31642        serializer.serialize_str(self.as_str())
31643    }
31644}
31645#[cfg(feature = "deserialize")]
31646impl<'de> serde::Deserialize<'de>
31647    for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
31648{
31649    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31650        use std::str::FromStr;
31651        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31652        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"))
31653    }
31654}
31655/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
31656#[derive(Copy, Clone, Debug, serde::Serialize)]
31657pub struct ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
31658    /// Controls when the funds are captured from the customer's account.
31659    ///
31660    /// 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.
31661    ///
31662    /// 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.
31663    #[serde(skip_serializing_if = "Option::is_none")]
31664    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
31665    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31666    ///
31667    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31668    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31669    ///
31670    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31671    ///
31672    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31673    #[serde(skip_serializing_if = "Option::is_none")]
31674    pub setup_future_usage:
31675        Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
31676}
31677impl ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
31678    pub fn new() -> Self {
31679        Self { capture_method: None, setup_future_usage: None }
31680    }
31681}
31682impl Default for ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
31683    fn default() -> Self {
31684        Self::new()
31685    }
31686}
31687/// Controls when the funds are captured from the customer's account.
31688///
31689/// 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.
31690///
31691/// 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.
31692#[derive(Copy, Clone, Eq, PartialEq)]
31693pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31694    Manual,
31695}
31696impl ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31697    pub fn as_str(self) -> &'static str {
31698        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
31699        match self {
31700            Manual => "manual",
31701        }
31702    }
31703}
31704
31705impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31706    type Err = stripe_types::StripeParseError;
31707    fn from_str(s: &str) -> Result<Self, Self::Err> {
31708        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
31709        match s {
31710            "manual" => Ok(Manual),
31711            _ => Err(stripe_types::StripeParseError),
31712        }
31713    }
31714}
31715impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31716    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31717        f.write_str(self.as_str())
31718    }
31719}
31720
31721impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31723        f.write_str(self.as_str())
31724    }
31725}
31726impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
31727    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31728    where
31729        S: serde::Serializer,
31730    {
31731        serializer.serialize_str(self.as_str())
31732    }
31733}
31734#[cfg(feature = "deserialize")]
31735impl<'de> serde::Deserialize<'de>
31736    for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod
31737{
31738    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31739        use std::str::FromStr;
31740        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31741        Self::from_str(&s).map_err(|_| {
31742            serde::de::Error::custom(
31743                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod",
31744            )
31745        })
31746    }
31747}
31748/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31749///
31750/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31751/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31752///
31753/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31754///
31755/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31756#[derive(Copy, Clone, Eq, PartialEq)]
31757pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
31758    None,
31759    OffSession,
31760}
31761impl ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
31762    pub fn as_str(self) -> &'static str {
31763        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
31764        match self {
31765            None => "none",
31766            OffSession => "off_session",
31767        }
31768    }
31769}
31770
31771impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
31772    type Err = stripe_types::StripeParseError;
31773    fn from_str(s: &str) -> Result<Self, Self::Err> {
31774        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
31775        match s {
31776            "none" => Ok(None),
31777            "off_session" => Ok(OffSession),
31778            _ => Err(stripe_types::StripeParseError),
31779        }
31780    }
31781}
31782impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
31783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31784        f.write_str(self.as_str())
31785    }
31786}
31787
31788impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
31789    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31790        f.write_str(self.as_str())
31791    }
31792}
31793impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
31794    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31795    where
31796        S: serde::Serializer,
31797    {
31798        serializer.serialize_str(self.as_str())
31799    }
31800}
31801#[cfg(feature = "deserialize")]
31802impl<'de> serde::Deserialize<'de>
31803    for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
31804{
31805    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31806        use std::str::FromStr;
31807        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31808        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage"))
31809    }
31810}
31811/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
31812#[derive(Clone, Debug, serde::Serialize)]
31813pub struct ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
31814    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31815    ///
31816    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31817    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31818    ///
31819    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31820    ///
31821    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31822    ///
31823    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31824    #[serde(skip_serializing_if = "Option::is_none")]
31825    pub setup_future_usage:
31826        Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
31827    /// Controls when Stripe will attempt to debit the funds from the customer's account.
31828    /// The date must be a string in YYYY-MM-DD format.
31829    /// The date must be in the future and between 3 and 15 calendar days from now.
31830    #[serde(skip_serializing_if = "Option::is_none")]
31831    pub target_date: Option<String>,
31832}
31833impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
31834    pub fn new() -> Self {
31835        Self { setup_future_usage: None, target_date: None }
31836    }
31837}
31838impl Default for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
31839    fn default() -> Self {
31840        Self::new()
31841    }
31842}
31843/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31844///
31845/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31846/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31847///
31848/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31849///
31850/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31851///
31852/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31853#[derive(Copy, Clone, Eq, PartialEq)]
31854pub enum ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
31855    None,
31856    OffSession,
31857    OnSession,
31858}
31859impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
31860    pub fn as_str(self) -> &'static str {
31861        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
31862        match self {
31863            None => "none",
31864            OffSession => "off_session",
31865            OnSession => "on_session",
31866        }
31867    }
31868}
31869
31870impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
31871    type Err = stripe_types::StripeParseError;
31872    fn from_str(s: &str) -> Result<Self, Self::Err> {
31873        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
31874        match s {
31875            "none" => Ok(None),
31876            "off_session" => Ok(OffSession),
31877            "on_session" => Ok(OnSession),
31878            _ => Err(stripe_types::StripeParseError),
31879        }
31880    }
31881}
31882impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
31883    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31884        f.write_str(self.as_str())
31885    }
31886}
31887
31888impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
31889    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31890        f.write_str(self.as_str())
31891    }
31892}
31893impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
31894    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31895    where
31896        S: serde::Serializer,
31897    {
31898        serializer.serialize_str(self.as_str())
31899    }
31900}
31901#[cfg(feature = "deserialize")]
31902impl<'de> serde::Deserialize<'de>
31903    for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
31904{
31905    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31906        use std::str::FromStr;
31907        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31908        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"))
31909    }
31910}
31911/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
31912#[derive(Copy, Clone, Debug, serde::Serialize)]
31913pub struct ConfirmPaymentIntentPaymentMethodOptionsOxxo {
31914    /// The number of calendar days before an OXXO voucher expires.
31915    /// 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.
31916    #[serde(skip_serializing_if = "Option::is_none")]
31917    pub expires_after_days: Option<u32>,
31918    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31919    ///
31920    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31921    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31922    ///
31923    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31924    ///
31925    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31926    ///
31927    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31928    #[serde(skip_serializing_if = "Option::is_none")]
31929    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
31930}
31931impl ConfirmPaymentIntentPaymentMethodOptionsOxxo {
31932    pub fn new() -> Self {
31933        Self { expires_after_days: None, setup_future_usage: None }
31934    }
31935}
31936impl Default for ConfirmPaymentIntentPaymentMethodOptionsOxxo {
31937    fn default() -> Self {
31938        Self::new()
31939    }
31940}
31941/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31942///
31943/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31944/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31945///
31946/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31947///
31948/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31949///
31950/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31951#[derive(Copy, Clone, Eq, PartialEq)]
31952pub enum ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31953    None,
31954}
31955impl ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31956    pub fn as_str(self) -> &'static str {
31957        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
31958        match self {
31959            None => "none",
31960        }
31961    }
31962}
31963
31964impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31965    type Err = stripe_types::StripeParseError;
31966    fn from_str(s: &str) -> Result<Self, Self::Err> {
31967        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
31968        match s {
31969            "none" => Ok(None),
31970            _ => Err(stripe_types::StripeParseError),
31971        }
31972    }
31973}
31974impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31975    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31976        f.write_str(self.as_str())
31977    }
31978}
31979
31980impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31981    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31982        f.write_str(self.as_str())
31983    }
31984}
31985impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31986    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31987    where
31988        S: serde::Serializer,
31989    {
31990        serializer.serialize_str(self.as_str())
31991    }
31992}
31993#[cfg(feature = "deserialize")]
31994impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
31995    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31996        use std::str::FromStr;
31997        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31998        Self::from_str(&s).map_err(|_| {
31999            serde::de::Error::custom(
32000                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage",
32001            )
32002        })
32003    }
32004}
32005/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
32006#[derive(Copy, Clone, Debug, serde::Serialize)]
32007pub struct ConfirmPaymentIntentPaymentMethodOptionsP24 {
32008    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32009    ///
32010    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32011    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32012    ///
32013    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32014    ///
32015    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32016    ///
32017    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32018    #[serde(skip_serializing_if = "Option::is_none")]
32019    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
32020    /// Confirm that the payer has accepted the P24 terms and conditions.
32021    #[serde(skip_serializing_if = "Option::is_none")]
32022    pub tos_shown_and_accepted: Option<bool>,
32023}
32024impl ConfirmPaymentIntentPaymentMethodOptionsP24 {
32025    pub fn new() -> Self {
32026        Self { setup_future_usage: None, tos_shown_and_accepted: None }
32027    }
32028}
32029impl Default for ConfirmPaymentIntentPaymentMethodOptionsP24 {
32030    fn default() -> Self {
32031        Self::new()
32032    }
32033}
32034/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32035///
32036/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32037/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32038///
32039/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32040///
32041/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32042///
32043/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32044#[derive(Copy, Clone, Eq, PartialEq)]
32045pub enum ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32046    None,
32047}
32048impl ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32049    pub fn as_str(self) -> &'static str {
32050        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
32051        match self {
32052            None => "none",
32053        }
32054    }
32055}
32056
32057impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32058    type Err = stripe_types::StripeParseError;
32059    fn from_str(s: &str) -> Result<Self, Self::Err> {
32060        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
32061        match s {
32062            "none" => Ok(None),
32063            _ => Err(stripe_types::StripeParseError),
32064        }
32065    }
32066}
32067impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32068    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32069        f.write_str(self.as_str())
32070    }
32071}
32072
32073impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32074    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32075        f.write_str(self.as_str())
32076    }
32077}
32078impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32079    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32080    where
32081        S: serde::Serializer,
32082    {
32083        serializer.serialize_str(self.as_str())
32084    }
32085}
32086#[cfg(feature = "deserialize")]
32087impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
32088    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32089        use std::str::FromStr;
32090        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32091        Self::from_str(&s).map_err(|_| {
32092            serde::de::Error::custom(
32093                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage",
32094            )
32095        })
32096    }
32097}
32098/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
32099#[derive(Copy, Clone, Debug, serde::Serialize)]
32100pub struct ConfirmPaymentIntentPaymentMethodOptionsPayco {
32101    /// Controls when the funds are captured from the customer's account.
32102    ///
32103    /// 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.
32104    ///
32105    /// 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.
32106    #[serde(skip_serializing_if = "Option::is_none")]
32107    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
32108}
32109impl ConfirmPaymentIntentPaymentMethodOptionsPayco {
32110    pub fn new() -> Self {
32111        Self { capture_method: None }
32112    }
32113}
32114impl Default for ConfirmPaymentIntentPaymentMethodOptionsPayco {
32115    fn default() -> Self {
32116        Self::new()
32117    }
32118}
32119/// Controls when the funds are captured from the customer's account.
32120///
32121/// 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.
32122///
32123/// 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.
32124#[derive(Copy, Clone, Eq, PartialEq)]
32125pub enum ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32126    Manual,
32127}
32128impl ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32129    pub fn as_str(self) -> &'static str {
32130        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
32131        match self {
32132            Manual => "manual",
32133        }
32134    }
32135}
32136
32137impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32138    type Err = stripe_types::StripeParseError;
32139    fn from_str(s: &str) -> Result<Self, Self::Err> {
32140        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
32141        match s {
32142            "manual" => Ok(Manual),
32143            _ => Err(stripe_types::StripeParseError),
32144        }
32145    }
32146}
32147impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32148    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32149        f.write_str(self.as_str())
32150    }
32151}
32152
32153impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32155        f.write_str(self.as_str())
32156    }
32157}
32158impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32159    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32160    where
32161        S: serde::Serializer,
32162    {
32163        serializer.serialize_str(self.as_str())
32164    }
32165}
32166#[cfg(feature = "deserialize")]
32167impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
32168    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32169        use std::str::FromStr;
32170        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32171        Self::from_str(&s).map_err(|_| {
32172            serde::de::Error::custom(
32173                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod",
32174            )
32175        })
32176    }
32177}
32178/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
32179#[derive(Copy, Clone, Debug, serde::Serialize)]
32180pub struct ConfirmPaymentIntentPaymentMethodOptionsPaynow {
32181    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32182    ///
32183    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32184    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32185    ///
32186    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32187    ///
32188    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32189    ///
32190    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32191    #[serde(skip_serializing_if = "Option::is_none")]
32192    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
32193}
32194impl ConfirmPaymentIntentPaymentMethodOptionsPaynow {
32195    pub fn new() -> Self {
32196        Self { setup_future_usage: None }
32197    }
32198}
32199impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaynow {
32200    fn default() -> Self {
32201        Self::new()
32202    }
32203}
32204/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32205///
32206/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32207/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32208///
32209/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32210///
32211/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32212///
32213/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32214#[derive(Copy, Clone, Eq, PartialEq)]
32215pub enum ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32216    None,
32217}
32218impl ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32219    pub fn as_str(self) -> &'static str {
32220        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
32221        match self {
32222            None => "none",
32223        }
32224    }
32225}
32226
32227impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32228    type Err = stripe_types::StripeParseError;
32229    fn from_str(s: &str) -> Result<Self, Self::Err> {
32230        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
32231        match s {
32232            "none" => Ok(None),
32233            _ => Err(stripe_types::StripeParseError),
32234        }
32235    }
32236}
32237impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32238    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32239        f.write_str(self.as_str())
32240    }
32241}
32242
32243impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32244    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32245        f.write_str(self.as_str())
32246    }
32247}
32248impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
32249    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32250    where
32251        S: serde::Serializer,
32252    {
32253        serializer.serialize_str(self.as_str())
32254    }
32255}
32256#[cfg(feature = "deserialize")]
32257impl<'de> serde::Deserialize<'de>
32258    for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
32259{
32260    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32261        use std::str::FromStr;
32262        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32263        Self::from_str(&s).map_err(|_| {
32264            serde::de::Error::custom(
32265                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage",
32266            )
32267        })
32268    }
32269}
32270/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
32271#[derive(Clone, Debug, serde::Serialize)]
32272pub struct ConfirmPaymentIntentPaymentMethodOptionsPaypal {
32273    /// Controls when the funds will be captured from the customer's account.
32274    #[serde(skip_serializing_if = "Option::is_none")]
32275    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
32276    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
32277    #[serde(skip_serializing_if = "Option::is_none")]
32278    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
32279    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
32280    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
32281    #[serde(skip_serializing_if = "Option::is_none")]
32282    pub reference: Option<String>,
32283    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
32284    #[serde(skip_serializing_if = "Option::is_none")]
32285    pub risk_correlation_id: Option<String>,
32286    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32287    ///
32288    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32289    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32290    ///
32291    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32292    ///
32293    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32294    ///
32295    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32296    #[serde(skip_serializing_if = "Option::is_none")]
32297    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
32298}
32299impl ConfirmPaymentIntentPaymentMethodOptionsPaypal {
32300    pub fn new() -> Self {
32301        Self {
32302            capture_method: None,
32303            preferred_locale: None,
32304            reference: None,
32305            risk_correlation_id: None,
32306            setup_future_usage: None,
32307        }
32308    }
32309}
32310impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaypal {
32311    fn default() -> Self {
32312        Self::new()
32313    }
32314}
32315/// Controls when the funds will be captured from the customer's account.
32316#[derive(Copy, Clone, Eq, PartialEq)]
32317pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32318    Manual,
32319}
32320impl ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32321    pub fn as_str(self) -> &'static str {
32322        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
32323        match self {
32324            Manual => "manual",
32325        }
32326    }
32327}
32328
32329impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32330    type Err = stripe_types::StripeParseError;
32331    fn from_str(s: &str) -> Result<Self, Self::Err> {
32332        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
32333        match s {
32334            "manual" => Ok(Manual),
32335            _ => Err(stripe_types::StripeParseError),
32336        }
32337    }
32338}
32339impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32340    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32341        f.write_str(self.as_str())
32342    }
32343}
32344
32345impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32346    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32347        f.write_str(self.as_str())
32348    }
32349}
32350impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32351    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32352    where
32353        S: serde::Serializer,
32354    {
32355        serializer.serialize_str(self.as_str())
32356    }
32357}
32358#[cfg(feature = "deserialize")]
32359impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
32360    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32361        use std::str::FromStr;
32362        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32363        Self::from_str(&s).map_err(|_| {
32364            serde::de::Error::custom(
32365                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod",
32366            )
32367        })
32368    }
32369}
32370/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
32371#[derive(Clone, Eq, PartialEq)]
32372#[non_exhaustive]
32373pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32374    CsMinusCz,
32375    DaMinusDk,
32376    DeMinusAt,
32377    DeMinusDe,
32378    DeMinusLu,
32379    ElMinusGr,
32380    EnMinusGb,
32381    EnMinusUs,
32382    EsMinusEs,
32383    FiMinusFi,
32384    FrMinusBe,
32385    FrMinusFr,
32386    FrMinusLu,
32387    HuMinusHu,
32388    ItMinusIt,
32389    NlMinusBe,
32390    NlMinusNl,
32391    PlMinusPl,
32392    PtMinusPt,
32393    SkMinusSk,
32394    SvMinusSe,
32395    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32396    Unknown(String),
32397}
32398impl ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32399    pub fn as_str(&self) -> &str {
32400        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
32401        match self {
32402            CsMinusCz => "cs-CZ",
32403            DaMinusDk => "da-DK",
32404            DeMinusAt => "de-AT",
32405            DeMinusDe => "de-DE",
32406            DeMinusLu => "de-LU",
32407            ElMinusGr => "el-GR",
32408            EnMinusGb => "en-GB",
32409            EnMinusUs => "en-US",
32410            EsMinusEs => "es-ES",
32411            FiMinusFi => "fi-FI",
32412            FrMinusBe => "fr-BE",
32413            FrMinusFr => "fr-FR",
32414            FrMinusLu => "fr-LU",
32415            HuMinusHu => "hu-HU",
32416            ItMinusIt => "it-IT",
32417            NlMinusBe => "nl-BE",
32418            NlMinusNl => "nl-NL",
32419            PlMinusPl => "pl-PL",
32420            PtMinusPt => "pt-PT",
32421            SkMinusSk => "sk-SK",
32422            SvMinusSe => "sv-SE",
32423            Unknown(v) => v,
32424        }
32425    }
32426}
32427
32428impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32429    type Err = std::convert::Infallible;
32430    fn from_str(s: &str) -> Result<Self, Self::Err> {
32431        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
32432        match s {
32433            "cs-CZ" => Ok(CsMinusCz),
32434            "da-DK" => Ok(DaMinusDk),
32435            "de-AT" => Ok(DeMinusAt),
32436            "de-DE" => Ok(DeMinusDe),
32437            "de-LU" => Ok(DeMinusLu),
32438            "el-GR" => Ok(ElMinusGr),
32439            "en-GB" => Ok(EnMinusGb),
32440            "en-US" => Ok(EnMinusUs),
32441            "es-ES" => Ok(EsMinusEs),
32442            "fi-FI" => Ok(FiMinusFi),
32443            "fr-BE" => Ok(FrMinusBe),
32444            "fr-FR" => Ok(FrMinusFr),
32445            "fr-LU" => Ok(FrMinusLu),
32446            "hu-HU" => Ok(HuMinusHu),
32447            "it-IT" => Ok(ItMinusIt),
32448            "nl-BE" => Ok(NlMinusBe),
32449            "nl-NL" => Ok(NlMinusNl),
32450            "pl-PL" => Ok(PlMinusPl),
32451            "pt-PT" => Ok(PtMinusPt),
32452            "sk-SK" => Ok(SkMinusSk),
32453            "sv-SE" => Ok(SvMinusSe),
32454            v => Ok(Unknown(v.to_owned())),
32455        }
32456    }
32457}
32458impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32459    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32460        f.write_str(self.as_str())
32461    }
32462}
32463
32464impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32465    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32466        f.write_str(self.as_str())
32467    }
32468}
32469impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
32470    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32471    where
32472        S: serde::Serializer,
32473    {
32474        serializer.serialize_str(self.as_str())
32475    }
32476}
32477#[cfg(feature = "deserialize")]
32478impl<'de> serde::Deserialize<'de>
32479    for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale
32480{
32481    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32482        use std::str::FromStr;
32483        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32484        Ok(Self::from_str(&s).unwrap())
32485    }
32486}
32487/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32488///
32489/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32490/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32491///
32492/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32493///
32494/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32495///
32496/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32497#[derive(Copy, Clone, Eq, PartialEq)]
32498pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32499    None,
32500    OffSession,
32501}
32502impl ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32503    pub fn as_str(self) -> &'static str {
32504        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
32505        match self {
32506            None => "none",
32507            OffSession => "off_session",
32508        }
32509    }
32510}
32511
32512impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32513    type Err = stripe_types::StripeParseError;
32514    fn from_str(s: &str) -> Result<Self, Self::Err> {
32515        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
32516        match s {
32517            "none" => Ok(None),
32518            "off_session" => Ok(OffSession),
32519            _ => Err(stripe_types::StripeParseError),
32520        }
32521    }
32522}
32523impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32524    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32525        f.write_str(self.as_str())
32526    }
32527}
32528
32529impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32530    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32531        f.write_str(self.as_str())
32532    }
32533}
32534impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
32535    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32536    where
32537        S: serde::Serializer,
32538    {
32539        serializer.serialize_str(self.as_str())
32540    }
32541}
32542#[cfg(feature = "deserialize")]
32543impl<'de> serde::Deserialize<'de>
32544    for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
32545{
32546    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32547        use std::str::FromStr;
32548        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32549        Self::from_str(&s).map_err(|_| {
32550            serde::de::Error::custom(
32551                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage",
32552            )
32553        })
32554    }
32555}
32556/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
32557#[derive(Copy, Clone, Debug, serde::Serialize)]
32558pub struct ConfirmPaymentIntentPaymentMethodOptionsPix {
32559    /// Determines if the amount includes the IOF tax. Defaults to `never`.
32560    #[serde(skip_serializing_if = "Option::is_none")]
32561    pub amount_includes_iof: Option<ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
32562    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
32563    /// Defaults to 86400 seconds.
32564    #[serde(skip_serializing_if = "Option::is_none")]
32565    pub expires_after_seconds: Option<i64>,
32566    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
32567    /// Defaults to 1 day in the future.
32568    #[serde(skip_serializing_if = "Option::is_none")]
32569    pub expires_at: Option<stripe_types::Timestamp>,
32570    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32571    ///
32572    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32573    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32574    ///
32575    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32576    ///
32577    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32578    ///
32579    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32580    #[serde(skip_serializing_if = "Option::is_none")]
32581    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
32582}
32583impl ConfirmPaymentIntentPaymentMethodOptionsPix {
32584    pub fn new() -> Self {
32585        Self {
32586            amount_includes_iof: None,
32587            expires_after_seconds: None,
32588            expires_at: None,
32589            setup_future_usage: None,
32590        }
32591    }
32592}
32593impl Default for ConfirmPaymentIntentPaymentMethodOptionsPix {
32594    fn default() -> Self {
32595        Self::new()
32596    }
32597}
32598/// Determines if the amount includes the IOF tax. Defaults to `never`.
32599#[derive(Copy, Clone, Eq, PartialEq)]
32600pub enum ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32601    Always,
32602    Never,
32603}
32604impl ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32605    pub fn as_str(self) -> &'static str {
32606        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
32607        match self {
32608            Always => "always",
32609            Never => "never",
32610        }
32611    }
32612}
32613
32614impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32615    type Err = stripe_types::StripeParseError;
32616    fn from_str(s: &str) -> Result<Self, Self::Err> {
32617        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
32618        match s {
32619            "always" => Ok(Always),
32620            "never" => Ok(Never),
32621            _ => Err(stripe_types::StripeParseError),
32622        }
32623    }
32624}
32625impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32626    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32627        f.write_str(self.as_str())
32628    }
32629}
32630
32631impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32632    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32633        f.write_str(self.as_str())
32634    }
32635}
32636impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32637    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32638    where
32639        S: serde::Serializer,
32640    {
32641        serializer.serialize_str(self.as_str())
32642    }
32643}
32644#[cfg(feature = "deserialize")]
32645impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
32646    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32647        use std::str::FromStr;
32648        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32649        Self::from_str(&s).map_err(|_| {
32650            serde::de::Error::custom(
32651                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof",
32652            )
32653        })
32654    }
32655}
32656/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32657///
32658/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32659/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32660///
32661/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32662///
32663/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32664///
32665/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32666#[derive(Copy, Clone, Eq, PartialEq)]
32667pub enum ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32668    None,
32669}
32670impl ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32671    pub fn as_str(self) -> &'static str {
32672        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
32673        match self {
32674            None => "none",
32675        }
32676    }
32677}
32678
32679impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32680    type Err = stripe_types::StripeParseError;
32681    fn from_str(s: &str) -> Result<Self, Self::Err> {
32682        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
32683        match s {
32684            "none" => Ok(None),
32685            _ => Err(stripe_types::StripeParseError),
32686        }
32687    }
32688}
32689impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32690    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32691        f.write_str(self.as_str())
32692    }
32693}
32694
32695impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32696    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32697        f.write_str(self.as_str())
32698    }
32699}
32700impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32701    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32702    where
32703        S: serde::Serializer,
32704    {
32705        serializer.serialize_str(self.as_str())
32706    }
32707}
32708#[cfg(feature = "deserialize")]
32709impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
32710    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32711        use std::str::FromStr;
32712        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32713        Self::from_str(&s).map_err(|_| {
32714            serde::de::Error::custom(
32715                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage",
32716            )
32717        })
32718    }
32719}
32720/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
32721#[derive(Copy, Clone, Debug, serde::Serialize)]
32722pub struct ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
32723    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32724    ///
32725    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32726    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32727    ///
32728    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32729    ///
32730    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32731    ///
32732    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32733    #[serde(skip_serializing_if = "Option::is_none")]
32734    pub setup_future_usage:
32735        Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
32736}
32737impl ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
32738    pub fn new() -> Self {
32739        Self { setup_future_usage: None }
32740    }
32741}
32742impl Default for ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
32743    fn default() -> Self {
32744        Self::new()
32745    }
32746}
32747/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32748///
32749/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32750/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32751///
32752/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32753///
32754/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32755///
32756/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32757#[derive(Copy, Clone, Eq, PartialEq)]
32758pub enum ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
32759    None,
32760}
32761impl ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
32762    pub fn as_str(self) -> &'static str {
32763        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
32764        match self {
32765            None => "none",
32766        }
32767    }
32768}
32769
32770impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
32771    type Err = stripe_types::StripeParseError;
32772    fn from_str(s: &str) -> Result<Self, Self::Err> {
32773        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
32774        match s {
32775            "none" => Ok(None),
32776            _ => Err(stripe_types::StripeParseError),
32777        }
32778    }
32779}
32780impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
32781    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32782        f.write_str(self.as_str())
32783    }
32784}
32785
32786impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
32787    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32788        f.write_str(self.as_str())
32789    }
32790}
32791impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
32792    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32793    where
32794        S: serde::Serializer,
32795    {
32796        serializer.serialize_str(self.as_str())
32797    }
32798}
32799#[cfg(feature = "deserialize")]
32800impl<'de> serde::Deserialize<'de>
32801    for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
32802{
32803    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32804        use std::str::FromStr;
32805        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32806        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"))
32807    }
32808}
32809/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
32810#[derive(Copy, Clone, Debug, serde::Serialize)]
32811pub struct ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
32812    /// Controls when the funds are captured from the customer's account.
32813    ///
32814    /// 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.
32815    ///
32816    /// 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.
32817    #[serde(skip_serializing_if = "Option::is_none")]
32818    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
32819    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32820    ///
32821    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32822    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32823    ///
32824    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32825    ///
32826    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32827    #[serde(skip_serializing_if = "Option::is_none")]
32828    pub setup_future_usage:
32829        Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
32830}
32831impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
32832    pub fn new() -> Self {
32833        Self { capture_method: None, setup_future_usage: None }
32834    }
32835}
32836impl Default for ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
32837    fn default() -> Self {
32838        Self::new()
32839    }
32840}
32841/// Controls when the funds are captured from the customer's account.
32842///
32843/// 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.
32844///
32845/// 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.
32846#[derive(Copy, Clone, Eq, PartialEq)]
32847pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
32848    Manual,
32849}
32850impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
32851    pub fn as_str(self) -> &'static str {
32852        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
32853        match self {
32854            Manual => "manual",
32855        }
32856    }
32857}
32858
32859impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
32860    type Err = stripe_types::StripeParseError;
32861    fn from_str(s: &str) -> Result<Self, Self::Err> {
32862        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
32863        match s {
32864            "manual" => Ok(Manual),
32865            _ => Err(stripe_types::StripeParseError),
32866        }
32867    }
32868}
32869impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
32870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32871        f.write_str(self.as_str())
32872    }
32873}
32874
32875impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
32876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32877        f.write_str(self.as_str())
32878    }
32879}
32880impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
32881    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32882    where
32883        S: serde::Serializer,
32884    {
32885        serializer.serialize_str(self.as_str())
32886    }
32887}
32888#[cfg(feature = "deserialize")]
32889impl<'de> serde::Deserialize<'de>
32890    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
32891{
32892    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32893        use std::str::FromStr;
32894        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32895        Self::from_str(&s).map_err(|_| {
32896            serde::de::Error::custom(
32897                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod",
32898            )
32899        })
32900    }
32901}
32902/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32903///
32904/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32905/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32906///
32907/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32908///
32909/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32910#[derive(Copy, Clone, Eq, PartialEq)]
32911pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
32912    None,
32913    OffSession,
32914}
32915impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
32916    pub fn as_str(self) -> &'static str {
32917        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
32918        match self {
32919            None => "none",
32920            OffSession => "off_session",
32921        }
32922    }
32923}
32924
32925impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
32926    type Err = stripe_types::StripeParseError;
32927    fn from_str(s: &str) -> Result<Self, Self::Err> {
32928        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
32929        match s {
32930            "none" => Ok(None),
32931            "off_session" => Ok(OffSession),
32932            _ => Err(stripe_types::StripeParseError),
32933        }
32934    }
32935}
32936impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
32937    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32938        f.write_str(self.as_str())
32939    }
32940}
32941
32942impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
32943    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32944        f.write_str(self.as_str())
32945    }
32946}
32947impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
32948    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32949    where
32950        S: serde::Serializer,
32951    {
32952        serializer.serialize_str(self.as_str())
32953    }
32954}
32955#[cfg(feature = "deserialize")]
32956impl<'de> serde::Deserialize<'de>
32957    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
32958{
32959    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32960        use std::str::FromStr;
32961        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32962        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"))
32963    }
32964}
32965/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
32966#[derive(Copy, Clone, Debug, serde::Serialize)]
32967pub struct ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
32968    /// Controls when the funds are captured from the customer's account.
32969    ///
32970    /// 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.
32971    ///
32972    /// 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.
32973    #[serde(skip_serializing_if = "Option::is_none")]
32974    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
32975}
32976impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
32977    pub fn new() -> Self {
32978        Self { capture_method: None }
32979    }
32980}
32981impl Default for ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
32982    fn default() -> Self {
32983        Self::new()
32984    }
32985}
32986/// Controls when the funds are captured from the customer's account.
32987///
32988/// 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.
32989///
32990/// 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.
32991#[derive(Copy, Clone, Eq, PartialEq)]
32992pub enum ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
32993    Manual,
32994}
32995impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
32996    pub fn as_str(self) -> &'static str {
32997        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
32998        match self {
32999            Manual => "manual",
33000        }
33001    }
33002}
33003
33004impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33005    type Err = stripe_types::StripeParseError;
33006    fn from_str(s: &str) -> Result<Self, Self::Err> {
33007        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
33008        match s {
33009            "manual" => Ok(Manual),
33010            _ => Err(stripe_types::StripeParseError),
33011        }
33012    }
33013}
33014impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33015    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33016        f.write_str(self.as_str())
33017    }
33018}
33019
33020impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33021    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33022        f.write_str(self.as_str())
33023    }
33024}
33025impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
33026    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33027    where
33028        S: serde::Serializer,
33029    {
33030        serializer.serialize_str(self.as_str())
33031    }
33032}
33033#[cfg(feature = "deserialize")]
33034impl<'de> serde::Deserialize<'de>
33035    for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
33036{
33037    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33038        use std::str::FromStr;
33039        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33040        Self::from_str(&s).map_err(|_| {
33041            serde::de::Error::custom(
33042                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod",
33043            )
33044        })
33045    }
33046}
33047/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
33048#[derive(Copy, Clone, Debug, serde::Serialize)]
33049pub struct ConfirmPaymentIntentPaymentMethodOptionsSatispay {
33050    /// Controls when the funds are captured from the customer's account.
33051    ///
33052    /// 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.
33053    ///
33054    /// 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.
33055    #[serde(skip_serializing_if = "Option::is_none")]
33056    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
33057}
33058impl ConfirmPaymentIntentPaymentMethodOptionsSatispay {
33059    pub fn new() -> Self {
33060        Self { capture_method: None }
33061    }
33062}
33063impl Default for ConfirmPaymentIntentPaymentMethodOptionsSatispay {
33064    fn default() -> Self {
33065        Self::new()
33066    }
33067}
33068/// Controls when the funds are captured from the customer's account.
33069///
33070/// 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.
33071///
33072/// 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.
33073#[derive(Copy, Clone, Eq, PartialEq)]
33074pub enum ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33075    Manual,
33076}
33077impl ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33078    pub fn as_str(self) -> &'static str {
33079        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
33080        match self {
33081            Manual => "manual",
33082        }
33083    }
33084}
33085
33086impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33087    type Err = stripe_types::StripeParseError;
33088    fn from_str(s: &str) -> Result<Self, Self::Err> {
33089        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
33090        match s {
33091            "manual" => Ok(Manual),
33092            _ => Err(stripe_types::StripeParseError),
33093        }
33094    }
33095}
33096impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33097    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33098        f.write_str(self.as_str())
33099    }
33100}
33101
33102impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33104        f.write_str(self.as_str())
33105    }
33106}
33107impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
33108    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33109    where
33110        S: serde::Serializer,
33111    {
33112        serializer.serialize_str(self.as_str())
33113    }
33114}
33115#[cfg(feature = "deserialize")]
33116impl<'de> serde::Deserialize<'de>
33117    for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod
33118{
33119    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33120        use std::str::FromStr;
33121        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33122        Self::from_str(&s).map_err(|_| {
33123            serde::de::Error::custom(
33124                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod",
33125            )
33126        })
33127    }
33128}
33129/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
33130#[derive(Clone, Debug, serde::Serialize)]
33131pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
33132    /// Additional fields for Mandate creation
33133    #[serde(skip_serializing_if = "Option::is_none")]
33134    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
33135    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33136    ///
33137    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33138    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33139    ///
33140    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33141    ///
33142    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33143    ///
33144    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33145    #[serde(skip_serializing_if = "Option::is_none")]
33146    pub setup_future_usage:
33147        Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
33148    /// Controls when Stripe will attempt to debit the funds from the customer's account.
33149    /// The date must be a string in YYYY-MM-DD format.
33150    /// The date must be in the future and between 3 and 15 calendar days from now.
33151    #[serde(skip_serializing_if = "Option::is_none")]
33152    pub target_date: Option<String>,
33153}
33154impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
33155    pub fn new() -> Self {
33156        Self { mandate_options: None, setup_future_usage: None, target_date: None }
33157    }
33158}
33159impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
33160    fn default() -> Self {
33161        Self::new()
33162    }
33163}
33164/// Additional fields for Mandate creation
33165#[derive(Clone, Debug, serde::Serialize)]
33166pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
33167    /// Prefix used to generate the Mandate reference.
33168    /// Must be at most 12 characters long.
33169    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
33170    /// Cannot begin with 'STRIPE'.
33171    #[serde(skip_serializing_if = "Option::is_none")]
33172    pub reference_prefix: Option<String>,
33173}
33174impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
33175    pub fn new() -> Self {
33176        Self { reference_prefix: None }
33177    }
33178}
33179impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
33180    fn default() -> Self {
33181        Self::new()
33182    }
33183}
33184/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33185///
33186/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33187/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33188///
33189/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33190///
33191/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33192///
33193/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33194#[derive(Copy, Clone, Eq, PartialEq)]
33195pub enum ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33196    None,
33197    OffSession,
33198    OnSession,
33199}
33200impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33201    pub fn as_str(self) -> &'static str {
33202        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
33203        match self {
33204            None => "none",
33205            OffSession => "off_session",
33206            OnSession => "on_session",
33207        }
33208    }
33209}
33210
33211impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33212    type Err = stripe_types::StripeParseError;
33213    fn from_str(s: &str) -> Result<Self, Self::Err> {
33214        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
33215        match s {
33216            "none" => Ok(None),
33217            "off_session" => Ok(OffSession),
33218            "on_session" => Ok(OnSession),
33219            _ => Err(stripe_types::StripeParseError),
33220        }
33221    }
33222}
33223impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33224    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33225        f.write_str(self.as_str())
33226    }
33227}
33228
33229impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33231        f.write_str(self.as_str())
33232    }
33233}
33234impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
33235    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33236    where
33237        S: serde::Serializer,
33238    {
33239        serializer.serialize_str(self.as_str())
33240    }
33241}
33242#[cfg(feature = "deserialize")]
33243impl<'de> serde::Deserialize<'de>
33244    for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
33245{
33246    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33247        use std::str::FromStr;
33248        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33249        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"))
33250    }
33251}
33252/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
33253#[derive(Copy, Clone, Debug, serde::Serialize)]
33254pub struct ConfirmPaymentIntentPaymentMethodOptionsSofort {
33255    /// Language shown to the payer on redirect.
33256    #[serde(skip_serializing_if = "Option::is_none")]
33257    pub preferred_language: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
33258    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33259    ///
33260    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33261    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33262    ///
33263    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33264    ///
33265    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33266    ///
33267    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33268    #[serde(skip_serializing_if = "Option::is_none")]
33269    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
33270}
33271impl ConfirmPaymentIntentPaymentMethodOptionsSofort {
33272    pub fn new() -> Self {
33273        Self { preferred_language: None, setup_future_usage: None }
33274    }
33275}
33276impl Default for ConfirmPaymentIntentPaymentMethodOptionsSofort {
33277    fn default() -> Self {
33278        Self::new()
33279    }
33280}
33281/// Language shown to the payer on redirect.
33282#[derive(Copy, Clone, Eq, PartialEq)]
33283pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33284    De,
33285    En,
33286    Es,
33287    Fr,
33288    It,
33289    Nl,
33290    Pl,
33291}
33292impl ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33293    pub fn as_str(self) -> &'static str {
33294        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
33295        match self {
33296            De => "de",
33297            En => "en",
33298            Es => "es",
33299            Fr => "fr",
33300            It => "it",
33301            Nl => "nl",
33302            Pl => "pl",
33303        }
33304    }
33305}
33306
33307impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33308    type Err = stripe_types::StripeParseError;
33309    fn from_str(s: &str) -> Result<Self, Self::Err> {
33310        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
33311        match s {
33312            "de" => Ok(De),
33313            "en" => Ok(En),
33314            "es" => Ok(Es),
33315            "fr" => Ok(Fr),
33316            "it" => Ok(It),
33317            "nl" => Ok(Nl),
33318            "pl" => Ok(Pl),
33319            _ => Err(stripe_types::StripeParseError),
33320        }
33321    }
33322}
33323impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33324    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33325        f.write_str(self.as_str())
33326    }
33327}
33328
33329impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33330    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33331        f.write_str(self.as_str())
33332    }
33333}
33334impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
33335    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33336    where
33337        S: serde::Serializer,
33338    {
33339        serializer.serialize_str(self.as_str())
33340    }
33341}
33342#[cfg(feature = "deserialize")]
33343impl<'de> serde::Deserialize<'de>
33344    for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage
33345{
33346    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33347        use std::str::FromStr;
33348        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33349        Self::from_str(&s).map_err(|_| {
33350            serde::de::Error::custom(
33351                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage",
33352            )
33353        })
33354    }
33355}
33356/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33357///
33358/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33359/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33360///
33361/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33362///
33363/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33364///
33365/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33366#[derive(Copy, Clone, Eq, PartialEq)]
33367pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33368    None,
33369    OffSession,
33370}
33371impl ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33372    pub fn as_str(self) -> &'static str {
33373        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
33374        match self {
33375            None => "none",
33376            OffSession => "off_session",
33377        }
33378    }
33379}
33380
33381impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33382    type Err = stripe_types::StripeParseError;
33383    fn from_str(s: &str) -> Result<Self, Self::Err> {
33384        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
33385        match s {
33386            "none" => Ok(None),
33387            "off_session" => Ok(OffSession),
33388            _ => Err(stripe_types::StripeParseError),
33389        }
33390    }
33391}
33392impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33393    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33394        f.write_str(self.as_str())
33395    }
33396}
33397
33398impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33399    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33400        f.write_str(self.as_str())
33401    }
33402}
33403impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
33404    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33405    where
33406        S: serde::Serializer,
33407    {
33408        serializer.serialize_str(self.as_str())
33409    }
33410}
33411#[cfg(feature = "deserialize")]
33412impl<'de> serde::Deserialize<'de>
33413    for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
33414{
33415    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33416        use std::str::FromStr;
33417        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33418        Self::from_str(&s).map_err(|_| {
33419            serde::de::Error::custom(
33420                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage",
33421            )
33422        })
33423    }
33424}
33425/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
33426#[derive(Clone, Debug, serde::Serialize)]
33427pub struct ConfirmPaymentIntentPaymentMethodOptionsSwish {
33428    /// A reference for this payment to be displayed in the Swish app.
33429    #[serde(skip_serializing_if = "Option::is_none")]
33430    pub reference: Option<String>,
33431    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33432    ///
33433    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33434    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33435    ///
33436    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33437    ///
33438    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33439    ///
33440    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33441    #[serde(skip_serializing_if = "Option::is_none")]
33442    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
33443}
33444impl ConfirmPaymentIntentPaymentMethodOptionsSwish {
33445    pub fn new() -> Self {
33446        Self { reference: None, setup_future_usage: None }
33447    }
33448}
33449impl Default for ConfirmPaymentIntentPaymentMethodOptionsSwish {
33450    fn default() -> Self {
33451        Self::new()
33452    }
33453}
33454/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33455///
33456/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33457/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33458///
33459/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33460///
33461/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33462///
33463/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33464#[derive(Copy, Clone, Eq, PartialEq)]
33465pub enum ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33466    None,
33467}
33468impl ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33469    pub fn as_str(self) -> &'static str {
33470        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
33471        match self {
33472            None => "none",
33473        }
33474    }
33475}
33476
33477impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33478    type Err = stripe_types::StripeParseError;
33479    fn from_str(s: &str) -> Result<Self, Self::Err> {
33480        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
33481        match s {
33482            "none" => Ok(None),
33483            _ => Err(stripe_types::StripeParseError),
33484        }
33485    }
33486}
33487impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33488    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33489        f.write_str(self.as_str())
33490    }
33491}
33492
33493impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33494    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33495        f.write_str(self.as_str())
33496    }
33497}
33498impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
33499    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33500    where
33501        S: serde::Serializer,
33502    {
33503        serializer.serialize_str(self.as_str())
33504    }
33505}
33506#[cfg(feature = "deserialize")]
33507impl<'de> serde::Deserialize<'de>
33508    for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage
33509{
33510    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33511        use std::str::FromStr;
33512        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33513        Self::from_str(&s).map_err(|_| {
33514            serde::de::Error::custom(
33515                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage",
33516            )
33517        })
33518    }
33519}
33520/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
33521#[derive(Copy, Clone, Debug, serde::Serialize)]
33522pub struct ConfirmPaymentIntentPaymentMethodOptionsTwint {
33523    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33524    ///
33525    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33526    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33527    ///
33528    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33529    ///
33530    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33531    ///
33532    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33533    #[serde(skip_serializing_if = "Option::is_none")]
33534    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
33535}
33536impl ConfirmPaymentIntentPaymentMethodOptionsTwint {
33537    pub fn new() -> Self {
33538        Self { setup_future_usage: None }
33539    }
33540}
33541impl Default for ConfirmPaymentIntentPaymentMethodOptionsTwint {
33542    fn default() -> Self {
33543        Self::new()
33544    }
33545}
33546/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33547///
33548/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33549/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33550///
33551/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33552///
33553/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33554///
33555/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33556#[derive(Copy, Clone, Eq, PartialEq)]
33557pub enum ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33558    None,
33559}
33560impl ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33561    pub fn as_str(self) -> &'static str {
33562        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
33563        match self {
33564            None => "none",
33565        }
33566    }
33567}
33568
33569impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33570    type Err = stripe_types::StripeParseError;
33571    fn from_str(s: &str) -> Result<Self, Self::Err> {
33572        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
33573        match s {
33574            "none" => Ok(None),
33575            _ => Err(stripe_types::StripeParseError),
33576        }
33577    }
33578}
33579impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33580    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33581        f.write_str(self.as_str())
33582    }
33583}
33584
33585impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33586    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33587        f.write_str(self.as_str())
33588    }
33589}
33590impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
33591    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33592    where
33593        S: serde::Serializer,
33594    {
33595        serializer.serialize_str(self.as_str())
33596    }
33597}
33598#[cfg(feature = "deserialize")]
33599impl<'de> serde::Deserialize<'de>
33600    for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage
33601{
33602    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33603        use std::str::FromStr;
33604        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33605        Self::from_str(&s).map_err(|_| {
33606            serde::de::Error::custom(
33607                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage",
33608            )
33609        })
33610    }
33611}
33612/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
33613#[derive(Clone, Debug, serde::Serialize)]
33614pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
33615    /// Additional fields for Financial Connections Session creation
33616    #[serde(skip_serializing_if = "Option::is_none")]
33617    pub financial_connections:
33618        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
33619    /// Additional fields for Mandate creation
33620    #[serde(skip_serializing_if = "Option::is_none")]
33621    pub mandate_options:
33622        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
33623    /// Additional fields for network related functions
33624    #[serde(skip_serializing_if = "Option::is_none")]
33625    pub networks: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
33626    /// Preferred transaction settlement speed
33627    #[serde(skip_serializing_if = "Option::is_none")]
33628    pub preferred_settlement_speed:
33629        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
33630    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33631    ///
33632    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33633    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33634    ///
33635    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33636    ///
33637    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33638    ///
33639    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33640    #[serde(skip_serializing_if = "Option::is_none")]
33641    pub setup_future_usage:
33642        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
33643    /// Controls when Stripe will attempt to debit the funds from the customer's account.
33644    /// The date must be a string in YYYY-MM-DD format.
33645    /// The date must be in the future and between 3 and 15 calendar days from now.
33646    #[serde(skip_serializing_if = "Option::is_none")]
33647    pub target_date: Option<String>,
33648    /// Bank account verification method.
33649    #[serde(skip_serializing_if = "Option::is_none")]
33650    pub verification_method:
33651        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
33652}
33653impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
33654    pub fn new() -> Self {
33655        Self {
33656            financial_connections: None,
33657            mandate_options: None,
33658            networks: None,
33659            preferred_settlement_speed: None,
33660            setup_future_usage: None,
33661            target_date: None,
33662            verification_method: None,
33663        }
33664    }
33665}
33666impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
33667    fn default() -> Self {
33668        Self::new()
33669    }
33670}
33671/// Additional fields for Financial Connections Session creation
33672#[derive(Clone, Debug, serde::Serialize)]
33673pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
33674    /// Provide filters for the linked accounts that the customer can select for the payment method.
33675    #[serde(skip_serializing_if = "Option::is_none")]
33676    pub filters:
33677        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
33678    /// The list of permissions to request.
33679    /// If this parameter is passed, the `payment_method` permission must be included.
33680    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
33681    #[serde(skip_serializing_if = "Option::is_none")]
33682    pub permissions: Option<
33683        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
33684    >,
33685    /// List of data features that you would like to retrieve upon account creation.
33686    #[serde(skip_serializing_if = "Option::is_none")]
33687    pub prefetch: Option<
33688        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
33689    >,
33690    /// For webview integrations only.
33691    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
33692    #[serde(skip_serializing_if = "Option::is_none")]
33693    pub return_url: Option<String>,
33694}
33695impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
33696    pub fn new() -> Self {
33697        Self { filters: None, permissions: None, prefetch: None, return_url: None }
33698    }
33699}
33700impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
33701    fn default() -> Self {
33702        Self::new()
33703    }
33704}
33705/// Provide filters for the linked accounts that the customer can select for the payment method.
33706#[derive(Clone, Debug, serde::Serialize)]
33707pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
33708        /// The account subcategories to use to filter for selectable accounts.
33709    /// Valid subcategories are `checking` and `savings`.
33710#[serde(skip_serializing_if = "Option::is_none")]
33711pub account_subcategories: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
33712
33713}
33714impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
33715    pub fn new() -> Self {
33716        Self { account_subcategories: None }
33717    }
33718}
33719impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
33720    fn default() -> Self {
33721        Self::new()
33722    }
33723}
33724/// The account subcategories to use to filter for selectable accounts.
33725/// Valid subcategories are `checking` and `savings`.
33726#[derive(Copy, Clone, Eq, PartialEq)]
33727pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
33728{
33729    Checking,
33730    Savings,
33731}
33732impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33733    pub fn as_str(self) -> &'static str {
33734        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
33735        match self {
33736Checking => "checking",
33737Savings => "savings",
33738
33739        }
33740    }
33741}
33742
33743impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33744    type Err = stripe_types::StripeParseError;
33745    fn from_str(s: &str) -> Result<Self, Self::Err> {
33746        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
33747        match s {
33748    "checking" => Ok(Checking),
33749"savings" => Ok(Savings),
33750_ => Err(stripe_types::StripeParseError)
33751
33752        }
33753    }
33754}
33755impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33756    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33757        f.write_str(self.as_str())
33758    }
33759}
33760
33761impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33762    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33763        f.write_str(self.as_str())
33764    }
33765}
33766impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33767    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
33768        serializer.serialize_str(self.as_str())
33769    }
33770}
33771#[cfg(feature = "deserialize")]
33772impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
33773    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33774        use std::str::FromStr;
33775        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33776        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"))
33777    }
33778}
33779/// The list of permissions to request.
33780/// If this parameter is passed, the `payment_method` permission must be included.
33781/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
33782#[derive(Copy, Clone, Eq, PartialEq)]
33783pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
33784    Balances,
33785    Ownership,
33786    PaymentMethod,
33787    Transactions,
33788}
33789impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
33790    pub fn as_str(self) -> &'static str {
33791        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
33792        match self {
33793            Balances => "balances",
33794            Ownership => "ownership",
33795            PaymentMethod => "payment_method",
33796            Transactions => "transactions",
33797        }
33798    }
33799}
33800
33801impl std::str::FromStr
33802    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
33803{
33804    type Err = stripe_types::StripeParseError;
33805    fn from_str(s: &str) -> Result<Self, Self::Err> {
33806        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
33807        match s {
33808            "balances" => Ok(Balances),
33809            "ownership" => Ok(Ownership),
33810            "payment_method" => Ok(PaymentMethod),
33811            "transactions" => Ok(Transactions),
33812            _ => Err(stripe_types::StripeParseError),
33813        }
33814    }
33815}
33816impl std::fmt::Display
33817    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
33818{
33819    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33820        f.write_str(self.as_str())
33821    }
33822}
33823
33824impl std::fmt::Debug
33825    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
33826{
33827    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33828        f.write_str(self.as_str())
33829    }
33830}
33831impl serde::Serialize
33832    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
33833{
33834    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33835    where
33836        S: serde::Serializer,
33837    {
33838        serializer.serialize_str(self.as_str())
33839    }
33840}
33841#[cfg(feature = "deserialize")]
33842impl<'de> serde::Deserialize<'de>
33843    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
33844{
33845    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33846        use std::str::FromStr;
33847        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33848        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"))
33849    }
33850}
33851/// List of data features that you would like to retrieve upon account creation.
33852#[derive(Copy, Clone, Eq, PartialEq)]
33853pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
33854    Balances,
33855    Ownership,
33856    Transactions,
33857}
33858impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
33859    pub fn as_str(self) -> &'static str {
33860        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
33861        match self {
33862            Balances => "balances",
33863            Ownership => "ownership",
33864            Transactions => "transactions",
33865        }
33866    }
33867}
33868
33869impl std::str::FromStr
33870    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
33871{
33872    type Err = stripe_types::StripeParseError;
33873    fn from_str(s: &str) -> Result<Self, Self::Err> {
33874        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
33875        match s {
33876            "balances" => Ok(Balances),
33877            "ownership" => Ok(Ownership),
33878            "transactions" => Ok(Transactions),
33879            _ => Err(stripe_types::StripeParseError),
33880        }
33881    }
33882}
33883impl std::fmt::Display
33884    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
33885{
33886    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33887        f.write_str(self.as_str())
33888    }
33889}
33890
33891impl std::fmt::Debug
33892    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
33893{
33894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33895        f.write_str(self.as_str())
33896    }
33897}
33898impl serde::Serialize
33899    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
33900{
33901    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33902    where
33903        S: serde::Serializer,
33904    {
33905        serializer.serialize_str(self.as_str())
33906    }
33907}
33908#[cfg(feature = "deserialize")]
33909impl<'de> serde::Deserialize<'de>
33910    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
33911{
33912    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33913        use std::str::FromStr;
33914        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33915        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"))
33916    }
33917}
33918/// Additional fields for Mandate creation
33919#[derive(Copy, Clone, Debug, serde::Serialize)]
33920pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
33921    /// The method used to collect offline mandate customer acceptance.
33922    #[serde(skip_serializing_if = "Option::is_none")]
33923    pub collection_method:
33924        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
33925}
33926impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
33927    pub fn new() -> Self {
33928        Self { collection_method: None }
33929    }
33930}
33931impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
33932    fn default() -> Self {
33933        Self::new()
33934    }
33935}
33936/// The method used to collect offline mandate customer acceptance.
33937#[derive(Copy, Clone, Eq, PartialEq)]
33938pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
33939    Paper,
33940}
33941impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
33942    pub fn as_str(self) -> &'static str {
33943        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
33944        match self {
33945            Paper => "paper",
33946        }
33947    }
33948}
33949
33950impl std::str::FromStr
33951    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
33952{
33953    type Err = stripe_types::StripeParseError;
33954    fn from_str(s: &str) -> Result<Self, Self::Err> {
33955        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
33956        match s {
33957            "paper" => Ok(Paper),
33958            _ => Err(stripe_types::StripeParseError),
33959        }
33960    }
33961}
33962impl std::fmt::Display
33963    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
33964{
33965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33966        f.write_str(self.as_str())
33967    }
33968}
33969
33970impl std::fmt::Debug
33971    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
33972{
33973    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33974        f.write_str(self.as_str())
33975    }
33976}
33977impl serde::Serialize
33978    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
33979{
33980    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33981    where
33982        S: serde::Serializer,
33983    {
33984        serializer.serialize_str(self.as_str())
33985    }
33986}
33987#[cfg(feature = "deserialize")]
33988impl<'de> serde::Deserialize<'de>
33989    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
33990{
33991    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33992        use std::str::FromStr;
33993        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33994        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"))
33995    }
33996}
33997/// Additional fields for network related functions
33998#[derive(Clone, Debug, serde::Serialize)]
33999pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
34000    /// Triggers validations to run across the selected networks
34001    #[serde(skip_serializing_if = "Option::is_none")]
34002    pub requested:
34003        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
34004}
34005impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
34006    pub fn new() -> Self {
34007        Self { requested: None }
34008    }
34009}
34010impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
34011    fn default() -> Self {
34012        Self::new()
34013    }
34014}
34015/// Triggers validations to run across the selected networks
34016#[derive(Copy, Clone, Eq, PartialEq)]
34017pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34018    Ach,
34019    UsDomesticWire,
34020}
34021impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34022    pub fn as_str(self) -> &'static str {
34023        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
34024        match self {
34025            Ach => "ach",
34026            UsDomesticWire => "us_domestic_wire",
34027        }
34028    }
34029}
34030
34031impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34032    type Err = stripe_types::StripeParseError;
34033    fn from_str(s: &str) -> Result<Self, Self::Err> {
34034        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
34035        match s {
34036            "ach" => Ok(Ach),
34037            "us_domestic_wire" => Ok(UsDomesticWire),
34038            _ => Err(stripe_types::StripeParseError),
34039        }
34040    }
34041}
34042impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34043    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34044        f.write_str(self.as_str())
34045    }
34046}
34047
34048impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34049    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34050        f.write_str(self.as_str())
34051    }
34052}
34053impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
34054    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34055    where
34056        S: serde::Serializer,
34057    {
34058        serializer.serialize_str(self.as_str())
34059    }
34060}
34061#[cfg(feature = "deserialize")]
34062impl<'de> serde::Deserialize<'de>
34063    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
34064{
34065    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34066        use std::str::FromStr;
34067        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34068        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"))
34069    }
34070}
34071/// Preferred transaction settlement speed
34072#[derive(Copy, Clone, Eq, PartialEq)]
34073pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
34074    Fastest,
34075    Standard,
34076}
34077impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
34078    pub fn as_str(self) -> &'static str {
34079        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
34080        match self {
34081            Fastest => "fastest",
34082            Standard => "standard",
34083        }
34084    }
34085}
34086
34087impl std::str::FromStr
34088    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34089{
34090    type Err = stripe_types::StripeParseError;
34091    fn from_str(s: &str) -> Result<Self, Self::Err> {
34092        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
34093        match s {
34094            "fastest" => Ok(Fastest),
34095            "standard" => Ok(Standard),
34096            _ => Err(stripe_types::StripeParseError),
34097        }
34098    }
34099}
34100impl std::fmt::Display
34101    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34102{
34103    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34104        f.write_str(self.as_str())
34105    }
34106}
34107
34108impl std::fmt::Debug
34109    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34110{
34111    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34112        f.write_str(self.as_str())
34113    }
34114}
34115impl serde::Serialize
34116    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34117{
34118    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34119    where
34120        S: serde::Serializer,
34121    {
34122        serializer.serialize_str(self.as_str())
34123    }
34124}
34125#[cfg(feature = "deserialize")]
34126impl<'de> serde::Deserialize<'de>
34127    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
34128{
34129    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34130        use std::str::FromStr;
34131        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34132        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"))
34133    }
34134}
34135/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34136///
34137/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34138/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34139///
34140/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34141///
34142/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34143///
34144/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34145#[derive(Copy, Clone, Eq, PartialEq)]
34146pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34147    None,
34148    OffSession,
34149    OnSession,
34150}
34151impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34152    pub fn as_str(self) -> &'static str {
34153        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
34154        match self {
34155            None => "none",
34156            OffSession => "off_session",
34157            OnSession => "on_session",
34158        }
34159    }
34160}
34161
34162impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34163    type Err = stripe_types::StripeParseError;
34164    fn from_str(s: &str) -> Result<Self, Self::Err> {
34165        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
34166        match s {
34167            "none" => Ok(None),
34168            "off_session" => Ok(OffSession),
34169            "on_session" => Ok(OnSession),
34170            _ => Err(stripe_types::StripeParseError),
34171        }
34172    }
34173}
34174impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34175    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34176        f.write_str(self.as_str())
34177    }
34178}
34179
34180impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34181    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34182        f.write_str(self.as_str())
34183    }
34184}
34185impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
34186    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34187    where
34188        S: serde::Serializer,
34189    {
34190        serializer.serialize_str(self.as_str())
34191    }
34192}
34193#[cfg(feature = "deserialize")]
34194impl<'de> serde::Deserialize<'de>
34195    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
34196{
34197    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34198        use std::str::FromStr;
34199        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34200        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"))
34201    }
34202}
34203/// Bank account verification method.
34204#[derive(Copy, Clone, Eq, PartialEq)]
34205pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34206    Automatic,
34207    Instant,
34208    Microdeposits,
34209}
34210impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34211    pub fn as_str(self) -> &'static str {
34212        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
34213        match self {
34214            Automatic => "automatic",
34215            Instant => "instant",
34216            Microdeposits => "microdeposits",
34217        }
34218    }
34219}
34220
34221impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34222    type Err = stripe_types::StripeParseError;
34223    fn from_str(s: &str) -> Result<Self, Self::Err> {
34224        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
34225        match s {
34226            "automatic" => Ok(Automatic),
34227            "instant" => Ok(Instant),
34228            "microdeposits" => Ok(Microdeposits),
34229            _ => Err(stripe_types::StripeParseError),
34230        }
34231    }
34232}
34233impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34234    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34235        f.write_str(self.as_str())
34236    }
34237}
34238
34239impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34240    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34241        f.write_str(self.as_str())
34242    }
34243}
34244impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
34245    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34246    where
34247        S: serde::Serializer,
34248    {
34249        serializer.serialize_str(self.as_str())
34250    }
34251}
34252#[cfg(feature = "deserialize")]
34253impl<'de> serde::Deserialize<'de>
34254    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
34255{
34256    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34257        use std::str::FromStr;
34258        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34259        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"))
34260    }
34261}
34262/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
34263#[derive(Clone, Debug, serde::Serialize)]
34264pub struct ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
34265    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
34266    #[serde(skip_serializing_if = "Option::is_none")]
34267    pub app_id: Option<String>,
34268    /// The client type that the end customer will pay from
34269    #[serde(skip_serializing_if = "Option::is_none")]
34270    pub client: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient>,
34271    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34272    ///
34273    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34274    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34275    ///
34276    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34277    ///
34278    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34279    ///
34280    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34281    #[serde(skip_serializing_if = "Option::is_none")]
34282    pub setup_future_usage:
34283        Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
34284}
34285impl ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
34286    pub fn new() -> Self {
34287        Self { app_id: None, client: None, setup_future_usage: None }
34288    }
34289}
34290impl Default for ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
34291    fn default() -> Self {
34292        Self::new()
34293    }
34294}
34295/// The client type that the end customer will pay from
34296#[derive(Copy, Clone, Eq, PartialEq)]
34297pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34298    Android,
34299    Ios,
34300    Web,
34301}
34302impl ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34303    pub fn as_str(self) -> &'static str {
34304        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
34305        match self {
34306            Android => "android",
34307            Ios => "ios",
34308            Web => "web",
34309        }
34310    }
34311}
34312
34313impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34314    type Err = stripe_types::StripeParseError;
34315    fn from_str(s: &str) -> Result<Self, Self::Err> {
34316        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
34317        match s {
34318            "android" => Ok(Android),
34319            "ios" => Ok(Ios),
34320            "web" => Ok(Web),
34321            _ => Err(stripe_types::StripeParseError),
34322        }
34323    }
34324}
34325impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34326    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34327        f.write_str(self.as_str())
34328    }
34329}
34330
34331impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34332    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34333        f.write_str(self.as_str())
34334    }
34335}
34336impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34337    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34338    where
34339        S: serde::Serializer,
34340    {
34341        serializer.serialize_str(self.as_str())
34342    }
34343}
34344#[cfg(feature = "deserialize")]
34345impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
34346    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34347        use std::str::FromStr;
34348        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34349        Self::from_str(&s).map_err(|_| {
34350            serde::de::Error::custom(
34351                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient",
34352            )
34353        })
34354    }
34355}
34356/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34357///
34358/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34359/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34360///
34361/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34362///
34363/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34364///
34365/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34366#[derive(Copy, Clone, Eq, PartialEq)]
34367pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34368    None,
34369}
34370impl ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34371    pub fn as_str(self) -> &'static str {
34372        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
34373        match self {
34374            None => "none",
34375        }
34376    }
34377}
34378
34379impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34380    type Err = stripe_types::StripeParseError;
34381    fn from_str(s: &str) -> Result<Self, Self::Err> {
34382        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
34383        match s {
34384            "none" => Ok(None),
34385            _ => Err(stripe_types::StripeParseError),
34386        }
34387    }
34388}
34389impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34390    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34391        f.write_str(self.as_str())
34392    }
34393}
34394
34395impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34396    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34397        f.write_str(self.as_str())
34398    }
34399}
34400impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
34401    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34402    where
34403        S: serde::Serializer,
34404    {
34405        serializer.serialize_str(self.as_str())
34406    }
34407}
34408#[cfg(feature = "deserialize")]
34409impl<'de> serde::Deserialize<'de>
34410    for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
34411{
34412    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34413        use std::str::FromStr;
34414        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34415        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"))
34416    }
34417}
34418/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
34419#[derive(Copy, Clone, Debug, serde::Serialize)]
34420pub struct ConfirmPaymentIntentPaymentMethodOptionsZip {
34421    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34422    ///
34423    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34424    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34425    ///
34426    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34427    ///
34428    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34429    ///
34430    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34431    #[serde(skip_serializing_if = "Option::is_none")]
34432    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
34433}
34434impl ConfirmPaymentIntentPaymentMethodOptionsZip {
34435    pub fn new() -> Self {
34436        Self { setup_future_usage: None }
34437    }
34438}
34439impl Default for ConfirmPaymentIntentPaymentMethodOptionsZip {
34440    fn default() -> Self {
34441        Self::new()
34442    }
34443}
34444/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34445///
34446/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34447/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34448///
34449/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34450///
34451/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34452///
34453/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34454#[derive(Copy, Clone, Eq, PartialEq)]
34455pub enum ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34456    None,
34457}
34458impl ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34459    pub fn as_str(self) -> &'static str {
34460        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
34461        match self {
34462            None => "none",
34463        }
34464    }
34465}
34466
34467impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34468    type Err = stripe_types::StripeParseError;
34469    fn from_str(s: &str) -> Result<Self, Self::Err> {
34470        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
34471        match s {
34472            "none" => Ok(None),
34473            _ => Err(stripe_types::StripeParseError),
34474        }
34475    }
34476}
34477impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34479        f.write_str(self.as_str())
34480    }
34481}
34482
34483impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34484    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34485        f.write_str(self.as_str())
34486    }
34487}
34488impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34489    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34490    where
34491        S: serde::Serializer,
34492    {
34493        serializer.serialize_str(self.as_str())
34494    }
34495}
34496#[cfg(feature = "deserialize")]
34497impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
34498    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34499        use std::str::FromStr;
34500        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34501        Self::from_str(&s).map_err(|_| {
34502            serde::de::Error::custom(
34503                "Unknown value for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage",
34504            )
34505        })
34506    }
34507}
34508/// Options to configure Radar.
34509/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
34510#[derive(Clone, Debug, serde::Serialize)]
34511pub struct ConfirmPaymentIntentRadarOptions {
34512    /// 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.
34513    #[serde(skip_serializing_if = "Option::is_none")]
34514    pub session: Option<String>,
34515}
34516impl ConfirmPaymentIntentRadarOptions {
34517    pub fn new() -> Self {
34518        Self { session: None }
34519    }
34520}
34521impl Default for ConfirmPaymentIntentRadarOptions {
34522    fn default() -> Self {
34523        Self::new()
34524    }
34525}
34526/// Shipping information for this PaymentIntent.
34527#[derive(Clone, Debug, serde::Serialize)]
34528pub struct ConfirmPaymentIntentShipping {
34529    /// Shipping address.
34530    pub address: ConfirmPaymentIntentShippingAddress,
34531    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
34532    #[serde(skip_serializing_if = "Option::is_none")]
34533    pub carrier: Option<String>,
34534    /// Recipient name.
34535    pub name: String,
34536    /// Recipient phone (including extension).
34537    #[serde(skip_serializing_if = "Option::is_none")]
34538    pub phone: Option<String>,
34539    /// The tracking number for a physical product, obtained from the delivery service.
34540    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
34541    #[serde(skip_serializing_if = "Option::is_none")]
34542    pub tracking_number: Option<String>,
34543}
34544impl ConfirmPaymentIntentShipping {
34545    pub fn new(
34546        address: impl Into<ConfirmPaymentIntentShippingAddress>,
34547        name: impl Into<String>,
34548    ) -> Self {
34549        Self {
34550            address: address.into(),
34551            carrier: None,
34552            name: name.into(),
34553            phone: None,
34554            tracking_number: None,
34555        }
34556    }
34557}
34558/// Shipping address.
34559#[derive(Clone, Debug, serde::Serialize)]
34560pub struct ConfirmPaymentIntentShippingAddress {
34561    /// City, district, suburb, town, or village.
34562    #[serde(skip_serializing_if = "Option::is_none")]
34563    pub city: Option<String>,
34564    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
34565    #[serde(skip_serializing_if = "Option::is_none")]
34566    pub country: Option<String>,
34567    /// Address line 1, such as the street, PO Box, or company name.
34568    #[serde(skip_serializing_if = "Option::is_none")]
34569    pub line1: Option<String>,
34570    /// Address line 2, such as the apartment, suite, unit, or building.
34571    #[serde(skip_serializing_if = "Option::is_none")]
34572    pub line2: Option<String>,
34573    /// ZIP or postal code.
34574    #[serde(skip_serializing_if = "Option::is_none")]
34575    pub postal_code: Option<String>,
34576    /// State, county, province, or region.
34577    #[serde(skip_serializing_if = "Option::is_none")]
34578    pub state: Option<String>,
34579}
34580impl ConfirmPaymentIntentShippingAddress {
34581    pub fn new() -> Self {
34582        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
34583    }
34584}
34585impl Default for ConfirmPaymentIntentShippingAddress {
34586    fn default() -> Self {
34587        Self::new()
34588    }
34589}
34590/// Confirm that your customer intends to pay with current or provided
34591/// payment method. Upon confirmation, the PaymentIntent will attempt to initiate
34592/// a payment.
34593///
34594/// If the selected payment method requires additional authentication steps, the
34595/// PaymentIntent will transition to the `requires_action` status and
34596/// suggest additional actions via `next_action`. If payment fails,
34597/// the PaymentIntent transitions to the `requires_payment_method` status or the
34598/// `canceled` status if the confirmation limit is reached. If
34599/// payment succeeds, the PaymentIntent will transition to the `succeeded`
34600/// status (or `requires_capture`, if `capture_method` is set to `manual`).
34601///
34602/// If the `confirmation_method` is `automatic`, payment may be attempted
34603/// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
34604/// and the PaymentIntent’s [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
34605/// After `next_action`s are handled by the client, no additional
34606/// confirmation is required to complete the payment.
34607///
34608/// If the `confirmation_method` is `manual`, all payment attempts must be
34609/// initiated using a secret key.
34610///
34611/// If any actions are required for the payment, the PaymentIntent will
34612/// return to the `requires_confirmation` state
34613/// after those actions are completed. Your server needs to then
34614/// explicitly re-confirm the PaymentIntent to initiate the next payment
34615/// attempt.
34616///
34617/// There is a variable upper limit on how many times a PaymentIntent can be confirmed.
34618/// After this limit is reached, any further calls to this endpoint will
34619/// transition the PaymentIntent to the `canceled` state.
34620#[derive(Clone, Debug, serde::Serialize)]
34621pub struct ConfirmPaymentIntent {
34622    inner: ConfirmPaymentIntentBuilder,
34623    intent: stripe_shared::PaymentIntentId,
34624}
34625impl ConfirmPaymentIntent {
34626    /// Construct a new `ConfirmPaymentIntent`.
34627    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
34628        Self { intent: intent.into(), inner: ConfirmPaymentIntentBuilder::new() }
34629    }
34630    /// Provides industry-specific information about the amount.
34631    pub fn amount_details(
34632        mut self,
34633        amount_details: impl Into<ConfirmPaymentIntentAmountDetails>,
34634    ) -> Self {
34635        self.inner.amount_details = Some(amount_details.into());
34636        self
34637    }
34638    /// Controls when the funds will be captured from the customer's account.
34639    pub fn capture_method(
34640        mut self,
34641        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
34642    ) -> Self {
34643        self.inner.capture_method = Some(capture_method.into());
34644        self
34645    }
34646    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
34647    ///
34648    /// 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.
34649    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
34650        self.inner.confirmation_token = Some(confirmation_token.into());
34651        self
34652    }
34653    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
34654    /// 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).
34655    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
34656        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
34657        self
34658    }
34659    /// The list of payment method types to exclude from use with this payment.
34660    pub fn excluded_payment_method_types(
34661        mut self,
34662        excluded_payment_method_types: impl Into<
34663            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
34664        >,
34665    ) -> Self {
34666        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
34667        self
34668    }
34669    /// Specifies which fields in the response should be expanded.
34670    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
34671        self.inner.expand = Some(expand.into());
34672        self
34673    }
34674    /// ID of the mandate that's used for this payment.
34675    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
34676        self.inner.mandate = Some(mandate.into());
34677        self
34678    }
34679    pub fn mandate_data(
34680        mut self,
34681        mandate_data: impl Into<ConfirmPaymentIntentMandateData>,
34682    ) -> Self {
34683        self.inner.mandate_data = Some(mandate_data.into());
34684        self
34685    }
34686    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
34687    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
34688    pub fn off_session(mut self, off_session: impl Into<ConfirmPaymentIntentOffSession>) -> Self {
34689        self.inner.off_session = Some(off_session.into());
34690        self
34691    }
34692    /// Provides industry-specific information about the charge.
34693    pub fn payment_details(
34694        mut self,
34695        payment_details: impl Into<ConfirmPaymentIntentPaymentDetails>,
34696    ) -> Self {
34697        self.inner.payment_details = Some(payment_details.into());
34698        self
34699    }
34700    /// 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.
34701    /// 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.
34702    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
34703        self.inner.payment_method = Some(payment_method.into());
34704        self
34705    }
34706    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
34707    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
34708    /// property on the PaymentIntent.
34709    pub fn payment_method_data(
34710        mut self,
34711        payment_method_data: impl Into<ConfirmPaymentIntentPaymentMethodData>,
34712    ) -> Self {
34713        self.inner.payment_method_data = Some(payment_method_data.into());
34714        self
34715    }
34716    /// Payment method-specific configuration for this PaymentIntent.
34717    pub fn payment_method_options(
34718        mut self,
34719        payment_method_options: impl Into<ConfirmPaymentIntentPaymentMethodOptions>,
34720    ) -> Self {
34721        self.inner.payment_method_options = Some(payment_method_options.into());
34722        self
34723    }
34724    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
34725    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
34726    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
34727    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
34728        self.inner.payment_method_types = Some(payment_method_types.into());
34729        self
34730    }
34731    /// Options to configure Radar.
34732    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
34733    pub fn radar_options(
34734        mut self,
34735        radar_options: impl Into<ConfirmPaymentIntentRadarOptions>,
34736    ) -> Self {
34737        self.inner.radar_options = Some(radar_options.into());
34738        self
34739    }
34740    /// Email address that the receipt for the resulting payment will be sent to.
34741    /// 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).
34742    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
34743        self.inner.receipt_email = Some(receipt_email.into());
34744        self
34745    }
34746    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
34747    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
34748    /// This parameter is only used for cards and other redirect-based payment methods.
34749    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
34750        self.inner.return_url = Some(return_url.into());
34751        self
34752    }
34753    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34754    ///
34755    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34756    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34757    ///
34758    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34759    ///
34760    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34761    ///
34762    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34763    pub fn setup_future_usage(
34764        mut self,
34765        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
34766    ) -> Self {
34767        self.inner.setup_future_usage = Some(setup_future_usage.into());
34768        self
34769    }
34770    /// Shipping information for this PaymentIntent.
34771    pub fn shipping(mut self, shipping: impl Into<ConfirmPaymentIntentShipping>) -> Self {
34772        self.inner.shipping = Some(shipping.into());
34773        self
34774    }
34775    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
34776    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
34777        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
34778        self
34779    }
34780}
34781impl ConfirmPaymentIntent {
34782    /// Send the request and return the deserialized response.
34783    pub async fn send<C: StripeClient>(
34784        &self,
34785        client: &C,
34786    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
34787        self.customize().send(client).await
34788    }
34789
34790    /// Send the request and return the deserialized response, blocking until completion.
34791    pub fn send_blocking<C: StripeBlockingClient>(
34792        &self,
34793        client: &C,
34794    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
34795        self.customize().send_blocking(client)
34796    }
34797}
34798
34799impl StripeRequest for ConfirmPaymentIntent {
34800    type Output = stripe_shared::PaymentIntent;
34801
34802    fn build(&self) -> RequestBuilder {
34803        let intent = &self.intent;
34804        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/confirm"))
34805            .form(&self.inner)
34806    }
34807}
34808#[derive(Clone, Debug, serde::Serialize)]
34809struct IncrementAuthorizationPaymentIntentBuilder {
34810    amount: i64,
34811    #[serde(skip_serializing_if = "Option::is_none")]
34812    amount_details: Option<IncrementAuthorizationPaymentIntentAmountDetails>,
34813    #[serde(skip_serializing_if = "Option::is_none")]
34814    application_fee_amount: Option<i64>,
34815    #[serde(skip_serializing_if = "Option::is_none")]
34816    description: Option<String>,
34817    #[serde(skip_serializing_if = "Option::is_none")]
34818    expand: Option<Vec<String>>,
34819    #[serde(skip_serializing_if = "Option::is_none")]
34820    metadata: Option<std::collections::HashMap<String, String>>,
34821    #[serde(skip_serializing_if = "Option::is_none")]
34822    payment_details: Option<IncrementAuthorizationPaymentIntentPaymentDetails>,
34823    #[serde(skip_serializing_if = "Option::is_none")]
34824    statement_descriptor: Option<String>,
34825    #[serde(skip_serializing_if = "Option::is_none")]
34826    transfer_data: Option<IncrementAuthorizationPaymentIntentTransferData>,
34827}
34828impl IncrementAuthorizationPaymentIntentBuilder {
34829    fn new(amount: impl Into<i64>) -> Self {
34830        Self {
34831            amount: amount.into(),
34832            amount_details: None,
34833            application_fee_amount: None,
34834            description: None,
34835            expand: None,
34836            metadata: None,
34837            payment_details: None,
34838            statement_descriptor: None,
34839            transfer_data: None,
34840        }
34841    }
34842}
34843/// Provides industry-specific information about the amount.
34844#[derive(Clone, Debug, serde::Serialize)]
34845pub struct IncrementAuthorizationPaymentIntentAmountDetails {
34846    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
34847    /// An integer greater than 0.
34848    ///
34849    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
34850    #[serde(skip_serializing_if = "Option::is_none")]
34851    pub discount_amount: Option<i64>,
34852    /// A list of line items, each containing information about a product in the PaymentIntent.
34853    /// There is a maximum of 100 line items.
34854    #[serde(skip_serializing_if = "Option::is_none")]
34855    pub line_items: Option<Vec<IncrementAuthorizationPaymentIntentAmountDetailsLineItems>>,
34856    /// Contains information about the shipping portion of the amount.
34857    #[serde(skip_serializing_if = "Option::is_none")]
34858    pub shipping: Option<AmountDetailsShippingParam>,
34859    /// Contains information about the tax portion of the amount.
34860    #[serde(skip_serializing_if = "Option::is_none")]
34861    pub tax: Option<AmountDetailsTaxParam>,
34862}
34863impl IncrementAuthorizationPaymentIntentAmountDetails {
34864    pub fn new() -> Self {
34865        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
34866    }
34867}
34868impl Default for IncrementAuthorizationPaymentIntentAmountDetails {
34869    fn default() -> Self {
34870        Self::new()
34871    }
34872}
34873/// A list of line items, each containing information about a product in the PaymentIntent.
34874/// There is a maximum of 100 line items.
34875#[derive(Clone, Debug, serde::Serialize)]
34876pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItems {
34877    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
34878    /// An integer greater than 0.
34879    ///
34880    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
34881    #[serde(skip_serializing_if = "Option::is_none")]
34882    pub discount_amount: Option<i64>,
34883    /// Payment method-specific information for line items.
34884    #[serde(skip_serializing_if = "Option::is_none")]
34885    pub payment_method_options:
34886        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
34887    /// The product code of the line item, such as an SKU.
34888    /// Required for L3 rates.
34889    /// At most 12 characters long.
34890    #[serde(skip_serializing_if = "Option::is_none")]
34891    pub product_code: Option<String>,
34892    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
34893    ///
34894    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
34895    /// For Paypal, this field is truncated to 127 characters.
34896    pub product_name: String,
34897    /// The quantity of items. Required for L3 rates. An integer greater than 0.
34898    pub quantity: u64,
34899    /// Contains information about the tax on the item.
34900    #[serde(skip_serializing_if = "Option::is_none")]
34901    pub tax: Option<AmountDetailsLineItemTaxParam>,
34902    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
34903    /// Required for L3 rates.
34904    /// An integer greater than or equal to 0.
34905    pub unit_cost: i64,
34906    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
34907    #[serde(skip_serializing_if = "Option::is_none")]
34908    pub unit_of_measure: Option<String>,
34909}
34910impl IncrementAuthorizationPaymentIntentAmountDetailsLineItems {
34911    pub fn new(
34912        product_name: impl Into<String>,
34913        quantity: impl Into<u64>,
34914        unit_cost: impl Into<i64>,
34915    ) -> Self {
34916        Self {
34917            discount_amount: None,
34918            payment_method_options: None,
34919            product_code: None,
34920            product_name: product_name.into(),
34921            quantity: quantity.into(),
34922            tax: None,
34923            unit_cost: unit_cost.into(),
34924            unit_of_measure: None,
34925        }
34926    }
34927}
34928/// Payment method-specific information for line items.
34929#[derive(Clone, Debug, serde::Serialize)]
34930pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
34931    /// This sub-hash contains line item details that are specific to `card` payment method."
34932    #[serde(skip_serializing_if = "Option::is_none")]
34933    pub card:
34934        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
34935    /// This sub-hash contains line item details that are specific to `card_present` payment method."
34936    #[serde(skip_serializing_if = "Option::is_none")]
34937    pub card_present: Option<
34938        IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent,
34939    >,
34940    /// This sub-hash contains line item details that are specific to `klarna` payment method."
34941    #[serde(skip_serializing_if = "Option::is_none")]
34942    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
34943    /// This sub-hash contains line item details that are specific to `paypal` payment method."
34944    #[serde(skip_serializing_if = "Option::is_none")]
34945    pub paypal:
34946        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
34947}
34948impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
34949    pub fn new() -> Self {
34950        Self { card: None, card_present: None, klarna: None, paypal: None }
34951    }
34952}
34953impl Default for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
34954    fn default() -> Self {
34955        Self::new()
34956    }
34957}
34958/// This sub-hash contains line item details that are specific to `card` payment method."
34959#[derive(Clone, Debug, serde::Serialize)]
34960pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
34961    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
34962    #[serde(skip_serializing_if = "Option::is_none")]
34963    pub commodity_code: Option<String>,
34964}
34965impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
34966    pub fn new() -> Self {
34967        Self { commodity_code: None }
34968    }
34969}
34970impl Default for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
34971    fn default() -> Self {
34972        Self::new()
34973    }
34974}
34975/// This sub-hash contains line item details that are specific to `card_present` payment method."
34976#[derive(Clone, Debug, serde::Serialize)]
34977pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent
34978{
34979    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
34980    #[serde(skip_serializing_if = "Option::is_none")]
34981    pub commodity_code: Option<String>,
34982}
34983impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
34984    pub fn new() -> Self {
34985        Self { commodity_code: None }
34986    }
34987}
34988impl Default
34989    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent
34990{
34991    fn default() -> Self {
34992        Self::new()
34993    }
34994}
34995/// This sub-hash contains line item details that are specific to `paypal` payment method."
34996#[derive(Clone, Debug, serde::Serialize)]
34997pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
34998    /// Type of the line item.
34999    #[serde(skip_serializing_if = "Option::is_none")]
35000    pub category: Option<
35001        IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory,
35002    >,
35003    /// Description of the line item.
35004    #[serde(skip_serializing_if = "Option::is_none")]
35005    pub description: Option<String>,
35006    /// The Stripe account ID of the connected account that sells the item.
35007    #[serde(skip_serializing_if = "Option::is_none")]
35008    pub sold_by: Option<String>,
35009}
35010impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
35011    pub fn new() -> Self {
35012        Self { category: None, description: None, sold_by: None }
35013    }
35014}
35015impl Default
35016    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal
35017{
35018    fn default() -> Self {
35019        Self::new()
35020    }
35021}
35022/// Type of the line item.
35023#[derive(Copy, Clone, Eq, PartialEq)]
35024pub enum IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35025{
35026    DigitalGoods,
35027    Donation,
35028    PhysicalGoods,
35029}
35030impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
35031    pub fn as_str(self) -> &'static str {
35032        use IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
35033        match self {
35034            DigitalGoods => "digital_goods",
35035            Donation => "donation",
35036            PhysicalGoods => "physical_goods",
35037        }
35038    }
35039}
35040
35041impl std::str::FromStr
35042    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35043{
35044    type Err = stripe_types::StripeParseError;
35045    fn from_str(s: &str) -> Result<Self, Self::Err> {
35046        use IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
35047        match s {
35048            "digital_goods" => Ok(DigitalGoods),
35049            "donation" => Ok(Donation),
35050            "physical_goods" => Ok(PhysicalGoods),
35051            _ => Err(stripe_types::StripeParseError),
35052        }
35053    }
35054}
35055impl std::fmt::Display
35056    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35057{
35058    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35059        f.write_str(self.as_str())
35060    }
35061}
35062
35063impl std::fmt::Debug
35064    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35065{
35066    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35067        f.write_str(self.as_str())
35068    }
35069}
35070impl serde::Serialize
35071    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35072{
35073    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35074    where
35075        S: serde::Serializer,
35076    {
35077        serializer.serialize_str(self.as_str())
35078    }
35079}
35080#[cfg(feature = "deserialize")]
35081impl<'de> serde::Deserialize<'de>
35082    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
35083{
35084    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35085        use std::str::FromStr;
35086        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35087        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"))
35088    }
35089}
35090/// Provides industry-specific information about the charge.
35091#[derive(Clone, Debug, serde::Serialize)]
35092pub struct IncrementAuthorizationPaymentIntentPaymentDetails {
35093    /// A unique value to identify the customer. This field is available only for card payments.
35094    ///
35095    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
35096    #[serde(skip_serializing_if = "Option::is_none")]
35097    pub customer_reference: Option<String>,
35098    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
35099    ///
35100    /// 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`.
35101    ///
35102    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
35103    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
35104    #[serde(skip_serializing_if = "Option::is_none")]
35105    pub order_reference: Option<String>,
35106}
35107impl IncrementAuthorizationPaymentIntentPaymentDetails {
35108    pub fn new() -> Self {
35109        Self { customer_reference: None, order_reference: None }
35110    }
35111}
35112impl Default for IncrementAuthorizationPaymentIntentPaymentDetails {
35113    fn default() -> Self {
35114        Self::new()
35115    }
35116}
35117/// The parameters used to automatically create a transfer after the payment is captured.
35118/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
35119#[derive(Copy, Clone, Debug, serde::Serialize)]
35120pub struct IncrementAuthorizationPaymentIntentTransferData {
35121    /// The amount that will be transferred automatically when a charge succeeds.
35122    #[serde(skip_serializing_if = "Option::is_none")]
35123    pub amount: Option<i64>,
35124}
35125impl IncrementAuthorizationPaymentIntentTransferData {
35126    pub fn new() -> Self {
35127        Self { amount: None }
35128    }
35129}
35130impl Default for IncrementAuthorizationPaymentIntentTransferData {
35131    fn default() -> Self {
35132        Self::new()
35133    }
35134}
35135/// Perform an incremental authorization on an eligible
35136/// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
35137/// PaymentIntent’s status must be `requires_capture` and
35138/// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported).
35139/// must be `true`.
35140///
35141/// Incremental authorizations attempt to increase the authorized amount on
35142/// your customer’s card to the new, higher `amount` provided. Similar to the
35143/// initial authorization, incremental authorizations can be declined. A
35144/// single PaymentIntent can call this endpoint multiple times to further
35145/// increase the authorized amount.
35146///
35147/// If the incremental authorization succeeds, the PaymentIntent object
35148/// returns with the updated
35149/// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
35150/// If the incremental authorization fails, a
35151/// [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
35152/// fields on the PaymentIntent or Charge update. The PaymentIntent
35153/// object remains capturable for the previously authorized amount.
35154///
35155/// Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
35156/// After it’s captured, a PaymentIntent can no longer be incremented.
35157///
35158/// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
35159#[derive(Clone, Debug, serde::Serialize)]
35160pub struct IncrementAuthorizationPaymentIntent {
35161    inner: IncrementAuthorizationPaymentIntentBuilder,
35162    intent: stripe_shared::PaymentIntentId,
35163}
35164impl IncrementAuthorizationPaymentIntent {
35165    /// Construct a new `IncrementAuthorizationPaymentIntent`.
35166    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>, amount: impl Into<i64>) -> Self {
35167        Self {
35168            intent: intent.into(),
35169            inner: IncrementAuthorizationPaymentIntentBuilder::new(amount.into()),
35170        }
35171    }
35172    /// Provides industry-specific information about the amount.
35173    pub fn amount_details(
35174        mut self,
35175        amount_details: impl Into<IncrementAuthorizationPaymentIntentAmountDetails>,
35176    ) -> Self {
35177        self.inner.amount_details = Some(amount_details.into());
35178        self
35179    }
35180    /// 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.
35181    /// The amount of the application fee collected will be capped at the total amount captured.
35182    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
35183    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
35184        self.inner.application_fee_amount = Some(application_fee_amount.into());
35185        self
35186    }
35187    /// An arbitrary string attached to the object. Often useful for displaying to users.
35188    pub fn description(mut self, description: impl Into<String>) -> Self {
35189        self.inner.description = Some(description.into());
35190        self
35191    }
35192    /// Specifies which fields in the response should be expanded.
35193    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
35194        self.inner.expand = Some(expand.into());
35195        self
35196    }
35197    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
35198    /// This can be useful for storing additional information about the object in a structured format.
35199    /// Individual keys can be unset by posting an empty value to them.
35200    /// All keys can be unset by posting an empty value to `metadata`.
35201    pub fn metadata(
35202        mut self,
35203        metadata: impl Into<std::collections::HashMap<String, String>>,
35204    ) -> Self {
35205        self.inner.metadata = Some(metadata.into());
35206        self
35207    }
35208    /// Provides industry-specific information about the charge.
35209    pub fn payment_details(
35210        mut self,
35211        payment_details: impl Into<IncrementAuthorizationPaymentIntentPaymentDetails>,
35212    ) -> Self {
35213        self.inner.payment_details = Some(payment_details.into());
35214        self
35215    }
35216    /// Text that appears on the customer's statement as the statement descriptor for a non-card or card charge.
35217    /// This value overrides the account's default statement descriptor.
35218    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
35219    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
35220        self.inner.statement_descriptor = Some(statement_descriptor.into());
35221        self
35222    }
35223    /// The parameters used to automatically create a transfer after the payment is captured.
35224    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
35225    pub fn transfer_data(
35226        mut self,
35227        transfer_data: impl Into<IncrementAuthorizationPaymentIntentTransferData>,
35228    ) -> Self {
35229        self.inner.transfer_data = Some(transfer_data.into());
35230        self
35231    }
35232}
35233impl IncrementAuthorizationPaymentIntent {
35234    /// Send the request and return the deserialized response.
35235    pub async fn send<C: StripeClient>(
35236        &self,
35237        client: &C,
35238    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35239        self.customize().send(client).await
35240    }
35241
35242    /// Send the request and return the deserialized response, blocking until completion.
35243    pub fn send_blocking<C: StripeBlockingClient>(
35244        &self,
35245        client: &C,
35246    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35247        self.customize().send_blocking(client)
35248    }
35249}
35250
35251impl StripeRequest for IncrementAuthorizationPaymentIntent {
35252    type Output = stripe_shared::PaymentIntent;
35253
35254    fn build(&self) -> RequestBuilder {
35255        let intent = &self.intent;
35256        RequestBuilder::new(
35257            StripeMethod::Post,
35258            format!("/payment_intents/{intent}/increment_authorization"),
35259        )
35260        .form(&self.inner)
35261    }
35262}
35263#[derive(Clone, Debug, serde::Serialize)]
35264struct VerifyMicrodepositsPaymentIntentBuilder {
35265    #[serde(skip_serializing_if = "Option::is_none")]
35266    amounts: Option<Vec<i64>>,
35267    #[serde(skip_serializing_if = "Option::is_none")]
35268    descriptor_code: Option<String>,
35269    #[serde(skip_serializing_if = "Option::is_none")]
35270    expand: Option<Vec<String>>,
35271}
35272impl VerifyMicrodepositsPaymentIntentBuilder {
35273    fn new() -> Self {
35274        Self { amounts: None, descriptor_code: None, expand: None }
35275    }
35276}
35277/// Verifies microdeposits on a PaymentIntent object.
35278#[derive(Clone, Debug, serde::Serialize)]
35279pub struct VerifyMicrodepositsPaymentIntent {
35280    inner: VerifyMicrodepositsPaymentIntentBuilder,
35281    intent: stripe_shared::PaymentIntentId,
35282}
35283impl VerifyMicrodepositsPaymentIntent {
35284    /// Construct a new `VerifyMicrodepositsPaymentIntent`.
35285    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
35286        Self { intent: intent.into(), inner: VerifyMicrodepositsPaymentIntentBuilder::new() }
35287    }
35288    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
35289    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
35290        self.inner.amounts = Some(amounts.into());
35291        self
35292    }
35293    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
35294    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
35295        self.inner.descriptor_code = Some(descriptor_code.into());
35296        self
35297    }
35298    /// Specifies which fields in the response should be expanded.
35299    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
35300        self.inner.expand = Some(expand.into());
35301        self
35302    }
35303}
35304impl VerifyMicrodepositsPaymentIntent {
35305    /// Send the request and return the deserialized response.
35306    pub async fn send<C: StripeClient>(
35307        &self,
35308        client: &C,
35309    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35310        self.customize().send(client).await
35311    }
35312
35313    /// Send the request and return the deserialized response, blocking until completion.
35314    pub fn send_blocking<C: StripeBlockingClient>(
35315        &self,
35316        client: &C,
35317    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
35318        self.customize().send_blocking(client)
35319    }
35320}
35321
35322impl StripeRequest for VerifyMicrodepositsPaymentIntent {
35323    type Output = stripe_shared::PaymentIntent;
35324
35325    fn build(&self) -> RequestBuilder {
35326        let intent = &self.intent;
35327        RequestBuilder::new(
35328            StripeMethod::Post,
35329            format!("/payment_intents/{intent}/verify_microdeposits"),
35330        )
35331        .form(&self.inner)
35332    }
35333}
35334
35335#[derive(Clone, Debug, serde::Serialize)]
35336pub struct PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
35337    /// URL to an image for the product. Max length, 4096 characters.
35338    #[serde(skip_serializing_if = "Option::is_none")]
35339    pub image_url: Option<String>,
35340    /// URL to the product page. Max length, 4096 characters.
35341    #[serde(skip_serializing_if = "Option::is_none")]
35342    pub product_url: Option<String>,
35343    /// Unique reference for this line item to correlate it with your system’s internal records.
35344    /// The field is displayed in the Klarna Consumer App if passed.
35345    #[serde(skip_serializing_if = "Option::is_none")]
35346    pub reference: Option<String>,
35347    /// Reference for the subscription this line item is for.
35348    #[serde(skip_serializing_if = "Option::is_none")]
35349    pub subscription_reference: Option<String>,
35350}
35351impl PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
35352    pub fn new() -> Self {
35353        Self { image_url: None, product_url: None, reference: None, subscription_reference: None }
35354    }
35355}
35356impl Default for PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
35357    fn default() -> Self {
35358        Self::new()
35359    }
35360}
35361#[derive(Copy, Clone, Debug, serde::Serialize)]
35362pub struct AmountDetailsLineItemTaxParam {
35363    /// The total amount of tax on a single line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35364    /// Required for L3 rates.
35365    /// An integer greater than or equal to 0.
35366    ///
35367    /// This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field.
35368    pub total_tax_amount: i64,
35369}
35370impl AmountDetailsLineItemTaxParam {
35371    pub fn new(total_tax_amount: impl Into<i64>) -> Self {
35372        Self { total_tax_amount: total_tax_amount.into() }
35373    }
35374}
35375#[derive(Clone, Debug, serde::Serialize)]
35376pub struct AmountDetailsShippingParam {
35377    /// If a physical good is being shipped, the cost of shipping represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35378    /// An integer greater than or equal to 0.
35379    #[serde(skip_serializing_if = "Option::is_none")]
35380    pub amount: Option<i64>,
35381    /// If a physical good is being shipped, the postal code of where it is being shipped from.
35382    /// At most 10 alphanumeric characters long, hyphens are allowed.
35383    #[serde(skip_serializing_if = "Option::is_none")]
35384    pub from_postal_code: Option<String>,
35385    /// If a physical good is being shipped, the postal code of where it is being shipped to.
35386    /// At most 10 alphanumeric characters long, hyphens are allowed.
35387    #[serde(skip_serializing_if = "Option::is_none")]
35388    pub to_postal_code: Option<String>,
35389}
35390impl AmountDetailsShippingParam {
35391    pub fn new() -> Self {
35392        Self { amount: None, from_postal_code: None, to_postal_code: None }
35393    }
35394}
35395impl Default for AmountDetailsShippingParam {
35396    fn default() -> Self {
35397        Self::new()
35398    }
35399}
35400#[derive(Copy, Clone, Debug, serde::Serialize)]
35401pub struct AmountDetailsTaxParam {
35402    /// The total amount of tax on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
35403    /// Required for L2 rates.
35404    /// An integer greater than or equal to 0.
35405    ///
35406    /// This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field.
35407    pub total_tax_amount: i64,
35408}
35409impl AmountDetailsTaxParam {
35410    pub fn new(total_tax_amount: impl Into<i64>) -> Self {
35411        Self { total_tax_amount: total_tax_amount.into() }
35412    }
35413}
35414#[derive(Clone, Debug, serde::Serialize)]
35415pub struct OnlineParam {
35416    /// The IP address from which the Mandate was accepted by the customer.
35417    pub ip_address: String,
35418    /// The user agent of the browser from which the Mandate was accepted by the customer.
35419    pub user_agent: String,
35420}
35421impl OnlineParam {
35422    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
35423        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
35424    }
35425}
35426#[derive(Clone, Debug, serde::Serialize)]
35427pub struct PaymentMethodParam {
35428    /// Customer's bank account number.
35429    pub account_number: String,
35430    /// Institution number of the customer's bank.
35431    pub institution_number: String,
35432    /// Transit number of the customer's bank.
35433    pub transit_number: String,
35434}
35435impl PaymentMethodParam {
35436    pub fn new(
35437        account_number: impl Into<String>,
35438        institution_number: impl Into<String>,
35439        transit_number: impl Into<String>,
35440    ) -> Self {
35441        Self {
35442            account_number: account_number.into(),
35443            institution_number: institution_number.into(),
35444            transit_number: transit_number.into(),
35445        }
35446    }
35447}
35448#[derive(Copy, Clone, Debug, serde::Serialize)]
35449pub struct DateOfBirth {
35450    /// The day of birth, between 1 and 31.
35451    pub day: i64,
35452    /// The month of birth, between 1 and 12.
35453    pub month: i64,
35454    /// The four-digit year of birth.
35455    pub year: i64,
35456}
35457impl DateOfBirth {
35458    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
35459        Self { day: day.into(), month: month.into(), year: year.into() }
35460    }
35461}
35462#[derive(Clone, Debug, serde::Serialize)]
35463pub struct PaymentMethodOptionsMandateOptionsParam {
35464    /// Prefix used to generate the Mandate reference.
35465    /// Must be at most 12 characters long.
35466    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
35467    /// Cannot begin with 'DDIC' or 'STRIPE'.
35468    #[serde(skip_serializing_if = "Option::is_none")]
35469    pub reference_prefix: Option<String>,
35470}
35471impl PaymentMethodOptionsMandateOptionsParam {
35472    pub fn new() -> Self {
35473        Self { reference_prefix: None }
35474    }
35475}
35476impl Default for PaymentMethodOptionsMandateOptionsParam {
35477    fn default() -> Self {
35478        Self::new()
35479    }
35480}
35481#[derive(Clone, Debug, serde::Serialize)]
35482pub struct EuBankTransferParams {
35483    /// The desired country code of the bank account information.
35484    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
35485    pub country: String,
35486}
35487impl EuBankTransferParams {
35488    pub fn new(country: impl Into<String>) -> Self {
35489        Self { country: country.into() }
35490    }
35491}
35492#[derive(Clone, Debug, serde::Serialize)]
35493pub struct SubscriptionNextBillingParam {
35494    /// The amount of the next charge for the subscription.
35495    pub amount: i64,
35496    /// The date of the next charge for the subscription in YYYY-MM-DD format.
35497    pub date: String,
35498}
35499impl SubscriptionNextBillingParam {
35500    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
35501        Self { amount: amount.into(), date: date.into() }
35502    }
35503}