stripe_core/payment_intent/
requests.rs

1use stripe_client_core::{
2    RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
3};
4
5#[derive(Clone, Debug, serde::Serialize)]
6struct ListPaymentIntentBuilder {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    created: Option<stripe_types::RangeQueryTs>,
9    #[serde(skip_serializing_if = "Option::is_none")]
10    customer: Option<String>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    ending_before: Option<String>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    expand: Option<Vec<String>>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    limit: Option<i64>,
17    #[serde(skip_serializing_if = "Option::is_none")]
18    starting_after: Option<String>,
19}
20impl ListPaymentIntentBuilder {
21    fn new() -> Self {
22        Self {
23            created: None,
24            customer: None,
25            ending_before: None,
26            expand: None,
27            limit: None,
28            starting_after: None,
29        }
30    }
31}
32/// Returns a list of PaymentIntents.
33#[derive(Clone, Debug, serde::Serialize)]
34pub struct ListPaymentIntent {
35    inner: ListPaymentIntentBuilder,
36}
37impl ListPaymentIntent {
38    /// Construct a new `ListPaymentIntent`.
39    pub fn new() -> Self {
40        Self { inner: ListPaymentIntentBuilder::new() }
41    }
42    /// A filter on the list, based on the object `created` field.
43    /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options.
44    pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
45        self.inner.created = Some(created.into());
46        self
47    }
48    /// Only return PaymentIntents for the customer that this customer ID specifies.
49    pub fn customer(mut self, customer: impl Into<String>) -> Self {
50        self.inner.customer = Some(customer.into());
51        self
52    }
53    /// A cursor for use in pagination.
54    /// `ending_before` is an object ID that defines your place in the list.
55    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
56    pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
57        self.inner.ending_before = Some(ending_before.into());
58        self
59    }
60    /// Specifies which fields in the response should be expanded.
61    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
62        self.inner.expand = Some(expand.into());
63        self
64    }
65    /// A limit on the number of objects to be returned.
66    /// Limit can range between 1 and 100, and the default is 10.
67    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
68        self.inner.limit = Some(limit.into());
69        self
70    }
71    /// A cursor for use in pagination.
72    /// `starting_after` is an object ID that defines your place in the list.
73    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
74    pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
75        self.inner.starting_after = Some(starting_after.into());
76        self
77    }
78}
79impl Default for ListPaymentIntent {
80    fn default() -> Self {
81        Self::new()
82    }
83}
84impl ListPaymentIntent {
85    /// Send the request and return the deserialized response.
86    pub async fn send<C: StripeClient>(
87        &self,
88        client: &C,
89    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
90        self.customize().send(client).await
91    }
92
93    /// Send the request and return the deserialized response, blocking until completion.
94    pub fn send_blocking<C: StripeBlockingClient>(
95        &self,
96        client: &C,
97    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
98        self.customize().send_blocking(client)
99    }
100
101    pub fn paginate(
102        &self,
103    ) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::PaymentIntent>> {
104        stripe_client_core::ListPaginator::new_list("/payment_intents", &self.inner)
105    }
106}
107
108impl StripeRequest for ListPaymentIntent {
109    type Output = stripe_types::List<stripe_shared::PaymentIntent>;
110
111    fn build(&self) -> RequestBuilder {
112        RequestBuilder::new(StripeMethod::Get, "/payment_intents").query(&self.inner)
113    }
114}
115#[derive(Clone, Debug, serde::Serialize)]
116struct RetrievePaymentIntentBuilder {
117    #[serde(skip_serializing_if = "Option::is_none")]
118    client_secret: Option<String>,
119    #[serde(skip_serializing_if = "Option::is_none")]
120    expand: Option<Vec<String>>,
121}
122impl RetrievePaymentIntentBuilder {
123    fn new() -> Self {
124        Self { client_secret: None, expand: None }
125    }
126}
127/// Retrieves the details of a PaymentIntent that has previously been created.
128///
129/// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string.
130///
131///
132/// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties.
133/// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details.
134#[derive(Clone, Debug, serde::Serialize)]
135pub struct RetrievePaymentIntent {
136    inner: RetrievePaymentIntentBuilder,
137    intent: stripe_shared::PaymentIntentId,
138}
139impl RetrievePaymentIntent {
140    /// Construct a new `RetrievePaymentIntent`.
141    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
142        Self { intent: intent.into(), inner: RetrievePaymentIntentBuilder::new() }
143    }
144    /// The client secret of the PaymentIntent.
145    /// We require it if you use a publishable key to retrieve the source.
146    pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
147        self.inner.client_secret = Some(client_secret.into());
148        self
149    }
150    /// Specifies which fields in the response should be expanded.
151    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
152        self.inner.expand = Some(expand.into());
153        self
154    }
155}
156impl RetrievePaymentIntent {
157    /// Send the request and return the deserialized response.
158    pub async fn send<C: StripeClient>(
159        &self,
160        client: &C,
161    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
162        self.customize().send(client).await
163    }
164
165    /// Send the request and return the deserialized response, blocking until completion.
166    pub fn send_blocking<C: StripeBlockingClient>(
167        &self,
168        client: &C,
169    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
170        self.customize().send_blocking(client)
171    }
172}
173
174impl StripeRequest for RetrievePaymentIntent {
175    type Output = stripe_shared::PaymentIntent;
176
177    fn build(&self) -> RequestBuilder {
178        let intent = &self.intent;
179        RequestBuilder::new(StripeMethod::Get, format!("/payment_intents/{intent}"))
180            .query(&self.inner)
181    }
182}
183#[derive(Clone, Debug, serde::Serialize)]
184struct SearchPaymentIntentBuilder {
185    #[serde(skip_serializing_if = "Option::is_none")]
186    expand: Option<Vec<String>>,
187    #[serde(skip_serializing_if = "Option::is_none")]
188    limit: Option<i64>,
189    #[serde(skip_serializing_if = "Option::is_none")]
190    page: Option<String>,
191    query: String,
192}
193impl SearchPaymentIntentBuilder {
194    fn new(query: impl Into<String>) -> Self {
195        Self { expand: None, limit: None, page: None, query: query.into() }
196    }
197}
198/// Search for PaymentIntents you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language).
199/// Don’t use search in read-after-write flows where strict consistency is necessary.
200/// Under normal operating.
201/// conditions, data is searchable in less than a minute.
202/// Occasionally, propagation of new or updated data can be up.
203/// to an hour behind during outages. Search functionality is not available to merchants in India.
204#[derive(Clone, Debug, serde::Serialize)]
205pub struct SearchPaymentIntent {
206    inner: SearchPaymentIntentBuilder,
207}
208impl SearchPaymentIntent {
209    /// Construct a new `SearchPaymentIntent`.
210    pub fn new(query: impl Into<String>) -> Self {
211        Self { inner: SearchPaymentIntentBuilder::new(query.into()) }
212    }
213    /// Specifies which fields in the response should be expanded.
214    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
215        self.inner.expand = Some(expand.into());
216        self
217    }
218    /// A limit on the number of objects to be returned.
219    /// Limit can range between 1 and 100, and the default is 10.
220    pub fn limit(mut self, limit: impl Into<i64>) -> Self {
221        self.inner.limit = Some(limit.into());
222        self
223    }
224    /// A cursor for pagination across multiple pages of results.
225    /// Don't include this parameter on the first call.
226    /// Use the next_page value returned in a previous response to request subsequent results.
227    pub fn page(mut self, page: impl Into<String>) -> Self {
228        self.inner.page = Some(page.into());
229        self
230    }
231}
232impl SearchPaymentIntent {
233    /// Send the request and return the deserialized response.
234    pub async fn send<C: StripeClient>(
235        &self,
236        client: &C,
237    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
238        self.customize().send(client).await
239    }
240
241    /// Send the request and return the deserialized response, blocking until completion.
242    pub fn send_blocking<C: StripeBlockingClient>(
243        &self,
244        client: &C,
245    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
246        self.customize().send_blocking(client)
247    }
248
249    pub fn paginate(
250        &self,
251    ) -> stripe_client_core::ListPaginator<stripe_types::SearchList<stripe_shared::PaymentIntent>>
252    {
253        stripe_client_core::ListPaginator::new_search_list("/payment_intents/search", &self.inner)
254    }
255}
256
257impl StripeRequest for SearchPaymentIntent {
258    type Output = stripe_types::SearchList<stripe_shared::PaymentIntent>;
259
260    fn build(&self) -> RequestBuilder {
261        RequestBuilder::new(StripeMethod::Get, "/payment_intents/search").query(&self.inner)
262    }
263}
264#[derive(Clone, Debug, serde::Serialize)]
265struct CreatePaymentIntentBuilder {
266    amount: i64,
267    #[serde(skip_serializing_if = "Option::is_none")]
268    amount_details: Option<CreatePaymentIntentAmountDetails>,
269    #[serde(skip_serializing_if = "Option::is_none")]
270    application_fee_amount: Option<i64>,
271    #[serde(skip_serializing_if = "Option::is_none")]
272    automatic_payment_methods: Option<CreatePaymentIntentAutomaticPaymentMethods>,
273    #[serde(skip_serializing_if = "Option::is_none")]
274    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
275    #[serde(skip_serializing_if = "Option::is_none")]
276    confirm: Option<bool>,
277    #[serde(skip_serializing_if = "Option::is_none")]
278    confirmation_method: Option<stripe_shared::PaymentIntentConfirmationMethod>,
279    #[serde(skip_serializing_if = "Option::is_none")]
280    confirmation_token: Option<String>,
281    currency: stripe_types::Currency,
282    #[serde(skip_serializing_if = "Option::is_none")]
283    customer: Option<String>,
284    #[serde(skip_serializing_if = "Option::is_none")]
285    description: Option<String>,
286    #[serde(skip_serializing_if = "Option::is_none")]
287    error_on_requires_action: Option<bool>,
288    #[serde(skip_serializing_if = "Option::is_none")]
289    excluded_payment_method_types:
290        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
291    #[serde(skip_serializing_if = "Option::is_none")]
292    expand: Option<Vec<String>>,
293    #[serde(skip_serializing_if = "Option::is_none")]
294    hooks: Option<AsyncWorkflowsParam>,
295    #[serde(skip_serializing_if = "Option::is_none")]
296    mandate: Option<String>,
297    #[serde(skip_serializing_if = "Option::is_none")]
298    mandate_data: Option<CreatePaymentIntentMandateData>,
299    #[serde(skip_serializing_if = "Option::is_none")]
300    metadata: Option<std::collections::HashMap<String, String>>,
301    #[serde(skip_serializing_if = "Option::is_none")]
302    off_session: Option<CreatePaymentIntentOffSession>,
303    #[serde(skip_serializing_if = "Option::is_none")]
304    on_behalf_of: Option<String>,
305    #[serde(skip_serializing_if = "Option::is_none")]
306    payment_details: Option<CreatePaymentIntentPaymentDetails>,
307    #[serde(skip_serializing_if = "Option::is_none")]
308    payment_method: Option<String>,
309    #[serde(skip_serializing_if = "Option::is_none")]
310    payment_method_configuration: Option<String>,
311    #[serde(skip_serializing_if = "Option::is_none")]
312    payment_method_data: Option<CreatePaymentIntentPaymentMethodData>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    payment_method_options: Option<CreatePaymentIntentPaymentMethodOptions>,
315    #[serde(skip_serializing_if = "Option::is_none")]
316    payment_method_types: Option<Vec<String>>,
317    #[serde(skip_serializing_if = "Option::is_none")]
318    radar_options: Option<CreatePaymentIntentRadarOptions>,
319    #[serde(skip_serializing_if = "Option::is_none")]
320    receipt_email: Option<String>,
321    #[serde(skip_serializing_if = "Option::is_none")]
322    return_url: Option<String>,
323    #[serde(skip_serializing_if = "Option::is_none")]
324    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
325    #[serde(skip_serializing_if = "Option::is_none")]
326    shipping: Option<CreatePaymentIntentShipping>,
327    #[serde(skip_serializing_if = "Option::is_none")]
328    statement_descriptor: Option<String>,
329    #[serde(skip_serializing_if = "Option::is_none")]
330    statement_descriptor_suffix: Option<String>,
331    #[serde(skip_serializing_if = "Option::is_none")]
332    transfer_data: Option<CreatePaymentIntentTransferData>,
333    #[serde(skip_serializing_if = "Option::is_none")]
334    transfer_group: Option<String>,
335    #[serde(skip_serializing_if = "Option::is_none")]
336    use_stripe_sdk: Option<bool>,
337}
338impl CreatePaymentIntentBuilder {
339    fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
340        Self {
341            amount: amount.into(),
342            amount_details: None,
343            application_fee_amount: None,
344            automatic_payment_methods: None,
345            capture_method: None,
346            confirm: None,
347            confirmation_method: None,
348            confirmation_token: None,
349            currency: currency.into(),
350            customer: None,
351            description: None,
352            error_on_requires_action: None,
353            excluded_payment_method_types: None,
354            expand: None,
355            hooks: None,
356            mandate: None,
357            mandate_data: None,
358            metadata: None,
359            off_session: None,
360            on_behalf_of: None,
361            payment_details: None,
362            payment_method: None,
363            payment_method_configuration: None,
364            payment_method_data: None,
365            payment_method_options: None,
366            payment_method_types: None,
367            radar_options: None,
368            receipt_email: None,
369            return_url: None,
370            setup_future_usage: None,
371            shipping: None,
372            statement_descriptor: None,
373            statement_descriptor_suffix: None,
374            transfer_data: None,
375            transfer_group: None,
376            use_stripe_sdk: None,
377        }
378    }
379}
380/// Provides industry-specific information about the amount.
381#[derive(Clone, Debug, serde::Serialize)]
382pub struct CreatePaymentIntentAmountDetails {
383    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
384    /// An integer greater than 0.
385    ///
386    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
387    #[serde(skip_serializing_if = "Option::is_none")]
388    pub discount_amount: Option<i64>,
389    /// A list of line items, each containing information about a product in the PaymentIntent.
390    /// There is a maximum of 100 line items.
391    #[serde(skip_serializing_if = "Option::is_none")]
392    pub line_items: Option<Vec<CreatePaymentIntentAmountDetailsLineItems>>,
393    /// Contains information about the shipping portion of the amount.
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub shipping: Option<AmountDetailsShippingParam>,
396    /// Contains information about the tax portion of the amount.
397    #[serde(skip_serializing_if = "Option::is_none")]
398    pub tax: Option<AmountDetailsTaxParam>,
399}
400impl CreatePaymentIntentAmountDetails {
401    pub fn new() -> Self {
402        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
403    }
404}
405impl Default for CreatePaymentIntentAmountDetails {
406    fn default() -> Self {
407        Self::new()
408    }
409}
410/// A list of line items, each containing information about a product in the PaymentIntent.
411/// There is a maximum of 100 line items.
412#[derive(Clone, Debug, serde::Serialize)]
413pub struct CreatePaymentIntentAmountDetailsLineItems {
414    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
415    /// An integer greater than 0.
416    ///
417    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
418    #[serde(skip_serializing_if = "Option::is_none")]
419    pub discount_amount: Option<i64>,
420    /// Payment method-specific information for line items.
421    #[serde(skip_serializing_if = "Option::is_none")]
422    pub payment_method_options:
423        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
424    /// The product code of the line item, such as an SKU.
425    /// Required for L3 rates.
426    /// At most 12 characters long.
427    #[serde(skip_serializing_if = "Option::is_none")]
428    pub product_code: Option<String>,
429    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
430    ///
431    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
432    /// For Paypal, this field is truncated to 127 characters.
433    pub product_name: String,
434    /// The quantity of items. Required for L3 rates. An integer greater than 0.
435    pub quantity: u64,
436    /// Contains information about the tax on the item.
437    #[serde(skip_serializing_if = "Option::is_none")]
438    pub tax: Option<AmountDetailsLineItemTaxParam>,
439    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
440    /// Required for L3 rates.
441    /// An integer greater than or equal to 0.
442    pub unit_cost: i64,
443    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub unit_of_measure: Option<String>,
446}
447impl CreatePaymentIntentAmountDetailsLineItems {
448    pub fn new(
449        product_name: impl Into<String>,
450        quantity: impl Into<u64>,
451        unit_cost: impl Into<i64>,
452    ) -> Self {
453        Self {
454            discount_amount: None,
455            payment_method_options: None,
456            product_code: None,
457            product_name: product_name.into(),
458            quantity: quantity.into(),
459            tax: None,
460            unit_cost: unit_cost.into(),
461            unit_of_measure: None,
462        }
463    }
464}
465/// Payment method-specific information for line items.
466#[derive(Clone, Debug, serde::Serialize)]
467pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
468    /// This sub-hash contains line item details that are specific to `card` payment method."
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub card: Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
471    /// This sub-hash contains line item details that are specific to `card_present` payment method."
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub card_present:
474        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
475    /// This sub-hash contains line item details that are specific to `klarna` payment method."
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
478    /// This sub-hash contains line item details that are specific to `paypal` payment method."
479    #[serde(skip_serializing_if = "Option::is_none")]
480    pub paypal: Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
481}
482impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
483    pub fn new() -> Self {
484        Self { card: None, card_present: None, klarna: None, paypal: None }
485    }
486}
487impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
488    fn default() -> Self {
489        Self::new()
490    }
491}
492/// This sub-hash contains line item details that are specific to `card` payment method."
493#[derive(Clone, Debug, serde::Serialize)]
494pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
495    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub commodity_code: Option<String>,
498}
499impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
500    pub fn new() -> Self {
501        Self { commodity_code: None }
502    }
503}
504impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
505    fn default() -> Self {
506        Self::new()
507    }
508}
509/// This sub-hash contains line item details that are specific to `card_present` payment method."
510#[derive(Clone, Debug, serde::Serialize)]
511pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
512    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
513    #[serde(skip_serializing_if = "Option::is_none")]
514    pub commodity_code: Option<String>,
515}
516impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
517    pub fn new() -> Self {
518        Self { commodity_code: None }
519    }
520}
521impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
522    fn default() -> Self {
523        Self::new()
524    }
525}
526/// This sub-hash contains line item details that are specific to `paypal` payment method."
527#[derive(Clone, Debug, serde::Serialize)]
528pub struct CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
529    /// Type of the line item.
530    #[serde(skip_serializing_if = "Option::is_none")]
531    pub category:
532        Option<CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
533    /// Description of the line item.
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub description: Option<String>,
536    /// The Stripe account ID of the connected account that sells the item.
537    #[serde(skip_serializing_if = "Option::is_none")]
538    pub sold_by: Option<String>,
539}
540impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
541    pub fn new() -> Self {
542        Self { category: None, description: None, sold_by: None }
543    }
544}
545impl Default for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
546    fn default() -> Self {
547        Self::new()
548    }
549}
550/// Type of the line item.
551#[derive(Clone, Eq, PartialEq)]
552#[non_exhaustive]
553pub enum CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
554    DigitalGoods,
555    Donation,
556    PhysicalGoods,
557    /// An unrecognized value from Stripe. Should not be used as a request parameter.
558    Unknown(String),
559}
560impl CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
561    pub fn as_str(&self) -> &str {
562        use CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
563        match self {
564            DigitalGoods => "digital_goods",
565            Donation => "donation",
566            PhysicalGoods => "physical_goods",
567            Unknown(v) => v,
568        }
569    }
570}
571
572impl std::str::FromStr
573    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
574{
575    type Err = std::convert::Infallible;
576    fn from_str(s: &str) -> Result<Self, Self::Err> {
577        use CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
578        match s {
579            "digital_goods" => Ok(DigitalGoods),
580            "donation" => Ok(Donation),
581            "physical_goods" => Ok(PhysicalGoods),
582            v => {
583                tracing::warn!(
584                    "Unknown value '{}' for enum '{}'",
585                    v,
586                    "CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"
587                );
588                Ok(Unknown(v.to_owned()))
589            }
590        }
591    }
592}
593impl std::fmt::Display
594    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
595{
596    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
597        f.write_str(self.as_str())
598    }
599}
600
601impl std::fmt::Debug
602    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
603{
604    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
605        f.write_str(self.as_str())
606    }
607}
608impl serde::Serialize
609    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
610{
611    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
612    where
613        S: serde::Serializer,
614    {
615        serializer.serialize_str(self.as_str())
616    }
617}
618#[cfg(feature = "deserialize")]
619impl<'de> serde::Deserialize<'de>
620    for CreatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
621{
622    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
623        use std::str::FromStr;
624        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
625        Ok(Self::from_str(&s).expect("infallible"))
626    }
627}
628/// 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.
629#[derive(Clone, Debug, serde::Serialize)]
630pub struct CreatePaymentIntentAutomaticPaymentMethods {
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    #[serde(skip_serializing_if = "Option::is_none")]
636    pub allow_redirects: Option<CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects>,
637    /// Whether this feature is enabled.
638    pub enabled: bool,
639}
640impl CreatePaymentIntentAutomaticPaymentMethods {
641    pub fn new(enabled: impl Into<bool>) -> Self {
642        Self { allow_redirects: None, enabled: enabled.into() }
643    }
644}
645/// Controls whether this PaymentIntent will accept redirect-based payment methods.
646///
647/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps.
648/// 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.
649#[derive(Clone, Eq, PartialEq)]
650#[non_exhaustive]
651pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
652    Always,
653    Never,
654    /// An unrecognized value from Stripe. Should not be used as a request parameter.
655    Unknown(String),
656}
657impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
658    pub fn as_str(&self) -> &str {
659        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
660        match self {
661            Always => "always",
662            Never => "never",
663            Unknown(v) => v,
664        }
665    }
666}
667
668impl std::str::FromStr for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
669    type Err = std::convert::Infallible;
670    fn from_str(s: &str) -> Result<Self, Self::Err> {
671        use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*;
672        match s {
673            "always" => Ok(Always),
674            "never" => Ok(Never),
675            v => {
676                tracing::warn!(
677                    "Unknown value '{}' for enum '{}'",
678                    v,
679                    "CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects"
680                );
681                Ok(Unknown(v.to_owned()))
682            }
683        }
684    }
685}
686impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
687    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
688        f.write_str(self.as_str())
689    }
690}
691
692impl std::fmt::Debug for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
693    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
694        f.write_str(self.as_str())
695    }
696}
697impl serde::Serialize for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
698    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
699    where
700        S: serde::Serializer,
701    {
702        serializer.serialize_str(self.as_str())
703    }
704}
705#[cfg(feature = "deserialize")]
706impl<'de> serde::Deserialize<'de> for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects {
707    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
708        use std::str::FromStr;
709        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
710        Ok(Self::from_str(&s).expect("infallible"))
711    }
712}
713/// This hash contains details about the Mandate to create.
714/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
715#[derive(Clone, Debug, serde::Serialize)]
716pub struct CreatePaymentIntentMandateData {
717    /// This hash contains details about the customer acceptance of the Mandate.
718    pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance,
719}
720impl CreatePaymentIntentMandateData {
721    pub fn new(
722        customer_acceptance: impl Into<CreatePaymentIntentMandateDataCustomerAcceptance>,
723    ) -> Self {
724        Self { customer_acceptance: customer_acceptance.into() }
725    }
726}
727/// This hash contains details about the customer acceptance of the Mandate.
728#[derive(Clone, Debug, serde::Serialize)]
729pub struct CreatePaymentIntentMandateDataCustomerAcceptance {
730    /// The time at which the customer accepted the Mandate.
731    #[serde(skip_serializing_if = "Option::is_none")]
732    pub accepted_at: Option<stripe_types::Timestamp>,
733    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
734    #[serde(skip_serializing_if = "Option::is_none")]
735    #[serde(with = "stripe_types::with_serde_json_opt")]
736    pub offline: Option<miniserde::json::Value>,
737    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
738    #[serde(skip_serializing_if = "Option::is_none")]
739    pub online: Option<OnlineParam>,
740    /// The type of customer acceptance information included with the Mandate.
741    /// One of `online` or `offline`.
742    #[serde(rename = "type")]
743    pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType,
744}
745impl CreatePaymentIntentMandateDataCustomerAcceptance {
746    pub fn new(type_: impl Into<CreatePaymentIntentMandateDataCustomerAcceptanceType>) -> Self {
747        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
748    }
749}
750/// The type of customer acceptance information included with the Mandate.
751/// One of `online` or `offline`.
752#[derive(Clone, Eq, PartialEq)]
753#[non_exhaustive]
754pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType {
755    Offline,
756    Online,
757    /// An unrecognized value from Stripe. Should not be used as a request parameter.
758    Unknown(String),
759}
760impl CreatePaymentIntentMandateDataCustomerAcceptanceType {
761    pub fn as_str(&self) -> &str {
762        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
763        match self {
764            Offline => "offline",
765            Online => "online",
766            Unknown(v) => v,
767        }
768    }
769}
770
771impl std::str::FromStr for CreatePaymentIntentMandateDataCustomerAcceptanceType {
772    type Err = std::convert::Infallible;
773    fn from_str(s: &str) -> Result<Self, Self::Err> {
774        use CreatePaymentIntentMandateDataCustomerAcceptanceType::*;
775        match s {
776            "offline" => Ok(Offline),
777            "online" => Ok(Online),
778            v => {
779                tracing::warn!(
780                    "Unknown value '{}' for enum '{}'",
781                    v,
782                    "CreatePaymentIntentMandateDataCustomerAcceptanceType"
783                );
784                Ok(Unknown(v.to_owned()))
785            }
786        }
787    }
788}
789impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType {
790    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
791        f.write_str(self.as_str())
792    }
793}
794
795impl std::fmt::Debug for CreatePaymentIntentMandateDataCustomerAcceptanceType {
796    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
797        f.write_str(self.as_str())
798    }
799}
800impl serde::Serialize for CreatePaymentIntentMandateDataCustomerAcceptanceType {
801    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
802    where
803        S: serde::Serializer,
804    {
805        serializer.serialize_str(self.as_str())
806    }
807}
808#[cfg(feature = "deserialize")]
809impl<'de> serde::Deserialize<'de> for CreatePaymentIntentMandateDataCustomerAcceptanceType {
810    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
811        use std::str::FromStr;
812        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
813        Ok(Self::from_str(&s).expect("infallible"))
814    }
815}
816/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
817/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
818/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
819#[derive(Copy, Clone, Debug, serde::Serialize)]
820#[serde(rename_all = "snake_case")]
821pub enum CreatePaymentIntentOffSession {
822    OneOff,
823    Recurring,
824    #[serde(untagged)]
825    Bool(bool),
826}
827/// Provides industry-specific information about the charge.
828#[derive(Clone, Debug, serde::Serialize)]
829pub struct CreatePaymentIntentPaymentDetails {
830    /// A unique value to identify the customer. This field is available only for card payments.
831    ///
832    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
833    #[serde(skip_serializing_if = "Option::is_none")]
834    pub customer_reference: Option<String>,
835    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
836    ///
837    /// 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`.
838    ///
839    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
840    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
841    #[serde(skip_serializing_if = "Option::is_none")]
842    pub order_reference: Option<String>,
843}
844impl CreatePaymentIntentPaymentDetails {
845    pub fn new() -> Self {
846        Self { customer_reference: None, order_reference: None }
847    }
848}
849impl Default for CreatePaymentIntentPaymentDetails {
850    fn default() -> Self {
851        Self::new()
852    }
853}
854/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
855/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
856/// property on the PaymentIntent.
857#[derive(Clone, Debug, serde::Serialize)]
858pub struct CreatePaymentIntentPaymentMethodData {
859    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
860    #[serde(skip_serializing_if = "Option::is_none")]
861    pub acss_debit: Option<PaymentMethodParam>,
862    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
863    #[serde(skip_serializing_if = "Option::is_none")]
864    #[serde(with = "stripe_types::with_serde_json_opt")]
865    pub affirm: Option<miniserde::json::Value>,
866    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
867    #[serde(skip_serializing_if = "Option::is_none")]
868    #[serde(with = "stripe_types::with_serde_json_opt")]
869    pub afterpay_clearpay: Option<miniserde::json::Value>,
870    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
871    #[serde(skip_serializing_if = "Option::is_none")]
872    #[serde(with = "stripe_types::with_serde_json_opt")]
873    pub alipay: Option<miniserde::json::Value>,
874    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
875    /// 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.
876    /// The field defaults to `unspecified`.
877    #[serde(skip_serializing_if = "Option::is_none")]
878    pub allow_redisplay: Option<CreatePaymentIntentPaymentMethodDataAllowRedisplay>,
879    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
880    #[serde(skip_serializing_if = "Option::is_none")]
881    #[serde(with = "stripe_types::with_serde_json_opt")]
882    pub alma: Option<miniserde::json::Value>,
883    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
884    #[serde(skip_serializing_if = "Option::is_none")]
885    #[serde(with = "stripe_types::with_serde_json_opt")]
886    pub amazon_pay: Option<miniserde::json::Value>,
887    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
888    #[serde(skip_serializing_if = "Option::is_none")]
889    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodDataAuBecsDebit>,
890    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
891    #[serde(skip_serializing_if = "Option::is_none")]
892    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodDataBacsDebit>,
893    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
894    #[serde(skip_serializing_if = "Option::is_none")]
895    #[serde(with = "stripe_types::with_serde_json_opt")]
896    pub bancontact: Option<miniserde::json::Value>,
897    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
898    #[serde(skip_serializing_if = "Option::is_none")]
899    #[serde(with = "stripe_types::with_serde_json_opt")]
900    pub billie: Option<miniserde::json::Value>,
901    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
902    #[serde(skip_serializing_if = "Option::is_none")]
903    pub billing_details: Option<CreatePaymentIntentPaymentMethodDataBillingDetails>,
904    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
905    #[serde(skip_serializing_if = "Option::is_none")]
906    #[serde(with = "stripe_types::with_serde_json_opt")]
907    pub blik: Option<miniserde::json::Value>,
908    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
909    #[serde(skip_serializing_if = "Option::is_none")]
910    pub boleto: Option<CreatePaymentIntentPaymentMethodDataBoleto>,
911    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
912    #[serde(skip_serializing_if = "Option::is_none")]
913    #[serde(with = "stripe_types::with_serde_json_opt")]
914    pub cashapp: Option<miniserde::json::Value>,
915    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
916    #[serde(skip_serializing_if = "Option::is_none")]
917    #[serde(with = "stripe_types::with_serde_json_opt")]
918    pub crypto: Option<miniserde::json::Value>,
919    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
920    #[serde(skip_serializing_if = "Option::is_none")]
921    #[serde(with = "stripe_types::with_serde_json_opt")]
922    pub customer_balance: Option<miniserde::json::Value>,
923    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
924    #[serde(skip_serializing_if = "Option::is_none")]
925    pub eps: Option<CreatePaymentIntentPaymentMethodDataEps>,
926    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
927    #[serde(skip_serializing_if = "Option::is_none")]
928    pub fpx: Option<CreatePaymentIntentPaymentMethodDataFpx>,
929    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
930    #[serde(skip_serializing_if = "Option::is_none")]
931    #[serde(with = "stripe_types::with_serde_json_opt")]
932    pub giropay: Option<miniserde::json::Value>,
933    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
934    #[serde(skip_serializing_if = "Option::is_none")]
935    #[serde(with = "stripe_types::with_serde_json_opt")]
936    pub grabpay: Option<miniserde::json::Value>,
937    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
938    #[serde(skip_serializing_if = "Option::is_none")]
939    pub ideal: Option<CreatePaymentIntentPaymentMethodDataIdeal>,
940    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
941    #[serde(skip_serializing_if = "Option::is_none")]
942    #[serde(with = "stripe_types::with_serde_json_opt")]
943    pub interac_present: Option<miniserde::json::Value>,
944    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
945    #[serde(skip_serializing_if = "Option::is_none")]
946    #[serde(with = "stripe_types::with_serde_json_opt")]
947    pub kakao_pay: Option<miniserde::json::Value>,
948    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
949    #[serde(skip_serializing_if = "Option::is_none")]
950    pub klarna: Option<CreatePaymentIntentPaymentMethodDataKlarna>,
951    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
952    #[serde(skip_serializing_if = "Option::is_none")]
953    #[serde(with = "stripe_types::with_serde_json_opt")]
954    pub konbini: Option<miniserde::json::Value>,
955    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
956    #[serde(skip_serializing_if = "Option::is_none")]
957    #[serde(with = "stripe_types::with_serde_json_opt")]
958    pub kr_card: Option<miniserde::json::Value>,
959    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
960    #[serde(skip_serializing_if = "Option::is_none")]
961    #[serde(with = "stripe_types::with_serde_json_opt")]
962    pub link: Option<miniserde::json::Value>,
963    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
964    #[serde(skip_serializing_if = "Option::is_none")]
965    #[serde(with = "stripe_types::with_serde_json_opt")]
966    pub mb_way: Option<miniserde::json::Value>,
967    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
968    /// This can be useful for storing additional information about the object in a structured format.
969    /// Individual keys can be unset by posting an empty value to them.
970    /// All keys can be unset by posting an empty value to `metadata`.
971    #[serde(skip_serializing_if = "Option::is_none")]
972    pub metadata: Option<std::collections::HashMap<String, String>>,
973    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
974    #[serde(skip_serializing_if = "Option::is_none")]
975    #[serde(with = "stripe_types::with_serde_json_opt")]
976    pub mobilepay: Option<miniserde::json::Value>,
977    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
978    #[serde(skip_serializing_if = "Option::is_none")]
979    #[serde(with = "stripe_types::with_serde_json_opt")]
980    pub multibanco: Option<miniserde::json::Value>,
981    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
982    #[serde(skip_serializing_if = "Option::is_none")]
983    pub naver_pay: Option<CreatePaymentIntentPaymentMethodDataNaverPay>,
984    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
985    #[serde(skip_serializing_if = "Option::is_none")]
986    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodDataNzBankAccount>,
987    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
988    #[serde(skip_serializing_if = "Option::is_none")]
989    #[serde(with = "stripe_types::with_serde_json_opt")]
990    pub oxxo: Option<miniserde::json::Value>,
991    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
992    #[serde(skip_serializing_if = "Option::is_none")]
993    pub p24: Option<CreatePaymentIntentPaymentMethodDataP24>,
994    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
995    #[serde(skip_serializing_if = "Option::is_none")]
996    #[serde(with = "stripe_types::with_serde_json_opt")]
997    pub pay_by_bank: Option<miniserde::json::Value>,
998    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
999    #[serde(skip_serializing_if = "Option::is_none")]
1000    #[serde(with = "stripe_types::with_serde_json_opt")]
1001    pub payco: Option<miniserde::json::Value>,
1002    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
1003    #[serde(skip_serializing_if = "Option::is_none")]
1004    #[serde(with = "stripe_types::with_serde_json_opt")]
1005    pub paynow: Option<miniserde::json::Value>,
1006    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    #[serde(with = "stripe_types::with_serde_json_opt")]
1009    pub paypal: Option<miniserde::json::Value>,
1010    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
1011    #[serde(skip_serializing_if = "Option::is_none")]
1012    #[serde(with = "stripe_types::with_serde_json_opt")]
1013    pub pix: Option<miniserde::json::Value>,
1014    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
1015    #[serde(skip_serializing_if = "Option::is_none")]
1016    #[serde(with = "stripe_types::with_serde_json_opt")]
1017    pub promptpay: Option<miniserde::json::Value>,
1018    /// Options to configure Radar.
1019    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
1020    #[serde(skip_serializing_if = "Option::is_none")]
1021    pub radar_options: Option<CreatePaymentIntentPaymentMethodDataRadarOptions>,
1022    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
1023    #[serde(skip_serializing_if = "Option::is_none")]
1024    #[serde(with = "stripe_types::with_serde_json_opt")]
1025    pub revolut_pay: Option<miniserde::json::Value>,
1026    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
1027    #[serde(skip_serializing_if = "Option::is_none")]
1028    #[serde(with = "stripe_types::with_serde_json_opt")]
1029    pub samsung_pay: Option<miniserde::json::Value>,
1030    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
1031    #[serde(skip_serializing_if = "Option::is_none")]
1032    #[serde(with = "stripe_types::with_serde_json_opt")]
1033    pub satispay: Option<miniserde::json::Value>,
1034    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
1035    #[serde(skip_serializing_if = "Option::is_none")]
1036    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodDataSepaDebit>,
1037    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
1038    #[serde(skip_serializing_if = "Option::is_none")]
1039    pub sofort: Option<CreatePaymentIntentPaymentMethodDataSofort>,
1040    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
1041    #[serde(skip_serializing_if = "Option::is_none")]
1042    #[serde(with = "stripe_types::with_serde_json_opt")]
1043    pub swish: Option<miniserde::json::Value>,
1044    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
1045    #[serde(skip_serializing_if = "Option::is_none")]
1046    #[serde(with = "stripe_types::with_serde_json_opt")]
1047    pub twint: Option<miniserde::json::Value>,
1048    /// The type of the PaymentMethod.
1049    /// An additional hash is included on the PaymentMethod with a name matching this value.
1050    /// It contains additional information specific to the PaymentMethod type.
1051    #[serde(rename = "type")]
1052    pub type_: CreatePaymentIntentPaymentMethodDataType,
1053    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1054    #[serde(skip_serializing_if = "Option::is_none")]
1055    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodDataUsBankAccount>,
1056    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
1057    #[serde(skip_serializing_if = "Option::is_none")]
1058    #[serde(with = "stripe_types::with_serde_json_opt")]
1059    pub wechat_pay: Option<miniserde::json::Value>,
1060    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
1061    #[serde(skip_serializing_if = "Option::is_none")]
1062    #[serde(with = "stripe_types::with_serde_json_opt")]
1063    pub zip: Option<miniserde::json::Value>,
1064}
1065impl CreatePaymentIntentPaymentMethodData {
1066    pub fn new(type_: impl Into<CreatePaymentIntentPaymentMethodDataType>) -> Self {
1067        Self {
1068            acss_debit: None,
1069            affirm: None,
1070            afterpay_clearpay: None,
1071            alipay: None,
1072            allow_redisplay: None,
1073            alma: None,
1074            amazon_pay: None,
1075            au_becs_debit: None,
1076            bacs_debit: None,
1077            bancontact: None,
1078            billie: None,
1079            billing_details: None,
1080            blik: None,
1081            boleto: None,
1082            cashapp: None,
1083            crypto: None,
1084            customer_balance: None,
1085            eps: None,
1086            fpx: None,
1087            giropay: None,
1088            grabpay: None,
1089            ideal: None,
1090            interac_present: None,
1091            kakao_pay: None,
1092            klarna: None,
1093            konbini: None,
1094            kr_card: None,
1095            link: None,
1096            mb_way: None,
1097            metadata: None,
1098            mobilepay: None,
1099            multibanco: None,
1100            naver_pay: None,
1101            nz_bank_account: None,
1102            oxxo: None,
1103            p24: None,
1104            pay_by_bank: None,
1105            payco: None,
1106            paynow: None,
1107            paypal: None,
1108            pix: None,
1109            promptpay: None,
1110            radar_options: None,
1111            revolut_pay: None,
1112            samsung_pay: None,
1113            satispay: None,
1114            sepa_debit: None,
1115            sofort: None,
1116            swish: None,
1117            twint: None,
1118            type_: type_.into(),
1119            us_bank_account: None,
1120            wechat_pay: None,
1121            zip: None,
1122        }
1123    }
1124}
1125/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
1126/// 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.
1127/// The field defaults to `unspecified`.
1128#[derive(Clone, Eq, PartialEq)]
1129#[non_exhaustive]
1130pub enum CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1131    Always,
1132    Limited,
1133    Unspecified,
1134    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1135    Unknown(String),
1136}
1137impl CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1138    pub fn as_str(&self) -> &str {
1139        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
1140        match self {
1141            Always => "always",
1142            Limited => "limited",
1143            Unspecified => "unspecified",
1144            Unknown(v) => v,
1145        }
1146    }
1147}
1148
1149impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1150    type Err = std::convert::Infallible;
1151    fn from_str(s: &str) -> Result<Self, Self::Err> {
1152        use CreatePaymentIntentPaymentMethodDataAllowRedisplay::*;
1153        match s {
1154            "always" => Ok(Always),
1155            "limited" => Ok(Limited),
1156            "unspecified" => Ok(Unspecified),
1157            v => {
1158                tracing::warn!(
1159                    "Unknown value '{}' for enum '{}'",
1160                    v,
1161                    "CreatePaymentIntentPaymentMethodDataAllowRedisplay"
1162                );
1163                Ok(Unknown(v.to_owned()))
1164            }
1165        }
1166    }
1167}
1168impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1169    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1170        f.write_str(self.as_str())
1171    }
1172}
1173
1174impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1175    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1176        f.write_str(self.as_str())
1177    }
1178}
1179impl serde::Serialize for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1180    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1181    where
1182        S: serde::Serializer,
1183    {
1184        serializer.serialize_str(self.as_str())
1185    }
1186}
1187#[cfg(feature = "deserialize")]
1188impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataAllowRedisplay {
1189    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1190        use std::str::FromStr;
1191        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1192        Ok(Self::from_str(&s).expect("infallible"))
1193    }
1194}
1195/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
1196#[derive(Clone, Debug, serde::Serialize)]
1197pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit {
1198    /// The account number for the bank account.
1199    pub account_number: String,
1200    /// Bank-State-Branch number of the bank account.
1201    pub bsb_number: String,
1202}
1203impl CreatePaymentIntentPaymentMethodDataAuBecsDebit {
1204    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
1205        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
1206    }
1207}
1208/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
1209#[derive(Clone, Debug, serde::Serialize)]
1210pub struct CreatePaymentIntentPaymentMethodDataBacsDebit {
1211    /// Account number of the bank account that the funds will be debited from.
1212    #[serde(skip_serializing_if = "Option::is_none")]
1213    pub account_number: Option<String>,
1214    /// Sort code of the bank account. (e.g., `10-20-30`)
1215    #[serde(skip_serializing_if = "Option::is_none")]
1216    pub sort_code: Option<String>,
1217}
1218impl CreatePaymentIntentPaymentMethodDataBacsDebit {
1219    pub fn new() -> Self {
1220        Self { account_number: None, sort_code: None }
1221    }
1222}
1223impl Default for CreatePaymentIntentPaymentMethodDataBacsDebit {
1224    fn default() -> Self {
1225        Self::new()
1226    }
1227}
1228/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
1229#[derive(Clone, Debug, serde::Serialize)]
1230pub struct CreatePaymentIntentPaymentMethodDataBillingDetails {
1231    /// Billing address.
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub address: Option<CreatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
1234    /// Email address.
1235    #[serde(skip_serializing_if = "Option::is_none")]
1236    pub email: Option<String>,
1237    /// Full name.
1238    #[serde(skip_serializing_if = "Option::is_none")]
1239    pub name: Option<String>,
1240    /// Billing phone number (including extension).
1241    #[serde(skip_serializing_if = "Option::is_none")]
1242    pub phone: Option<String>,
1243    /// Taxpayer identification number.
1244    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
1245    #[serde(skip_serializing_if = "Option::is_none")]
1246    pub tax_id: Option<String>,
1247}
1248impl CreatePaymentIntentPaymentMethodDataBillingDetails {
1249    pub fn new() -> Self {
1250        Self { address: None, email: None, name: None, phone: None, tax_id: None }
1251    }
1252}
1253impl Default for CreatePaymentIntentPaymentMethodDataBillingDetails {
1254    fn default() -> Self {
1255        Self::new()
1256    }
1257}
1258/// Billing address.
1259#[derive(Clone, Debug, serde::Serialize)]
1260pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1261    /// City, district, suburb, town, or village.
1262    #[serde(skip_serializing_if = "Option::is_none")]
1263    pub city: Option<String>,
1264    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1265    #[serde(skip_serializing_if = "Option::is_none")]
1266    pub country: Option<String>,
1267    /// Address line 1, such as the street, PO Box, or company name.
1268    #[serde(skip_serializing_if = "Option::is_none")]
1269    pub line1: Option<String>,
1270    /// Address line 2, such as the apartment, suite, unit, or building.
1271    #[serde(skip_serializing_if = "Option::is_none")]
1272    pub line2: Option<String>,
1273    /// ZIP or postal code.
1274    #[serde(skip_serializing_if = "Option::is_none")]
1275    pub postal_code: Option<String>,
1276    /// State, county, province, or region.
1277    #[serde(skip_serializing_if = "Option::is_none")]
1278    pub state: Option<String>,
1279}
1280impl CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1281    pub fn new() -> Self {
1282        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
1283    }
1284}
1285impl Default for CreatePaymentIntentPaymentMethodDataBillingDetailsAddress {
1286    fn default() -> Self {
1287        Self::new()
1288    }
1289}
1290/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
1291#[derive(Clone, Debug, serde::Serialize)]
1292pub struct CreatePaymentIntentPaymentMethodDataBoleto {
1293    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
1294    pub tax_id: String,
1295}
1296impl CreatePaymentIntentPaymentMethodDataBoleto {
1297    pub fn new(tax_id: impl Into<String>) -> Self {
1298        Self { tax_id: tax_id.into() }
1299    }
1300}
1301/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
1302#[derive(Clone, Debug, serde::Serialize)]
1303pub struct CreatePaymentIntentPaymentMethodDataEps {
1304    /// The customer's bank.
1305    #[serde(skip_serializing_if = "Option::is_none")]
1306    pub bank: Option<CreatePaymentIntentPaymentMethodDataEpsBank>,
1307}
1308impl CreatePaymentIntentPaymentMethodDataEps {
1309    pub fn new() -> Self {
1310        Self { bank: None }
1311    }
1312}
1313impl Default for CreatePaymentIntentPaymentMethodDataEps {
1314    fn default() -> Self {
1315        Self::new()
1316    }
1317}
1318/// The customer's bank.
1319#[derive(Clone, Eq, PartialEq)]
1320#[non_exhaustive]
1321pub enum CreatePaymentIntentPaymentMethodDataEpsBank {
1322    ArzteUndApothekerBank,
1323    AustrianAnadiBankAg,
1324    BankAustria,
1325    BankhausCarlSpangler,
1326    BankhausSchelhammerUndSchatteraAg,
1327    BawagPskAg,
1328    BksBankAg,
1329    BrullKallmusBankAg,
1330    BtvVierLanderBank,
1331    CapitalBankGraweGruppeAg,
1332    DeutscheBankAg,
1333    Dolomitenbank,
1334    EasybankAg,
1335    ErsteBankUndSparkassen,
1336    HypoAlpeadriabankInternationalAg,
1337    HypoBankBurgenlandAktiengesellschaft,
1338    HypoNoeLbFurNiederosterreichUWien,
1339    HypoOberosterreichSalzburgSteiermark,
1340    HypoTirolBankAg,
1341    HypoVorarlbergBankAg,
1342    MarchfelderBank,
1343    OberbankAg,
1344    RaiffeisenBankengruppeOsterreich,
1345    SchoellerbankAg,
1346    SpardaBankWien,
1347    VolksbankGruppe,
1348    VolkskreditbankAg,
1349    VrBankBraunau,
1350    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1351    Unknown(String),
1352}
1353impl CreatePaymentIntentPaymentMethodDataEpsBank {
1354    pub fn as_str(&self) -> &str {
1355        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1356        match self {
1357            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1358            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1359            BankAustria => "bank_austria",
1360            BankhausCarlSpangler => "bankhaus_carl_spangler",
1361            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
1362            BawagPskAg => "bawag_psk_ag",
1363            BksBankAg => "bks_bank_ag",
1364            BrullKallmusBankAg => "brull_kallmus_bank_ag",
1365            BtvVierLanderBank => "btv_vier_lander_bank",
1366            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1367            DeutscheBankAg => "deutsche_bank_ag",
1368            Dolomitenbank => "dolomitenbank",
1369            EasybankAg => "easybank_ag",
1370            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1371            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
1372            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
1373            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
1374            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
1375            HypoTirolBankAg => "hypo_tirol_bank_ag",
1376            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1377            MarchfelderBank => "marchfelder_bank",
1378            OberbankAg => "oberbank_ag",
1379            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
1380            SchoellerbankAg => "schoellerbank_ag",
1381            SpardaBankWien => "sparda_bank_wien",
1382            VolksbankGruppe => "volksbank_gruppe",
1383            VolkskreditbankAg => "volkskreditbank_ag",
1384            VrBankBraunau => "vr_bank_braunau",
1385            Unknown(v) => v,
1386        }
1387    }
1388}
1389
1390impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataEpsBank {
1391    type Err = std::convert::Infallible;
1392    fn from_str(s: &str) -> Result<Self, Self::Err> {
1393        use CreatePaymentIntentPaymentMethodDataEpsBank::*;
1394        match s {
1395            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
1396            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
1397            "bank_austria" => Ok(BankAustria),
1398            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
1399            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
1400            "bawag_psk_ag" => Ok(BawagPskAg),
1401            "bks_bank_ag" => Ok(BksBankAg),
1402            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
1403            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
1404            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
1405            "deutsche_bank_ag" => Ok(DeutscheBankAg),
1406            "dolomitenbank" => Ok(Dolomitenbank),
1407            "easybank_ag" => Ok(EasybankAg),
1408            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
1409            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
1410            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
1411            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
1412            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
1413            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
1414            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
1415            "marchfelder_bank" => Ok(MarchfelderBank),
1416            "oberbank_ag" => Ok(OberbankAg),
1417            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
1418            "schoellerbank_ag" => Ok(SchoellerbankAg),
1419            "sparda_bank_wien" => Ok(SpardaBankWien),
1420            "volksbank_gruppe" => Ok(VolksbankGruppe),
1421            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
1422            "vr_bank_braunau" => Ok(VrBankBraunau),
1423            v => {
1424                tracing::warn!(
1425                    "Unknown value '{}' for enum '{}'",
1426                    v,
1427                    "CreatePaymentIntentPaymentMethodDataEpsBank"
1428                );
1429                Ok(Unknown(v.to_owned()))
1430            }
1431        }
1432    }
1433}
1434impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank {
1435    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1436        f.write_str(self.as_str())
1437    }
1438}
1439
1440impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataEpsBank {
1441    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1442        f.write_str(self.as_str())
1443    }
1444}
1445impl serde::Serialize for CreatePaymentIntentPaymentMethodDataEpsBank {
1446    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1447    where
1448        S: serde::Serializer,
1449    {
1450        serializer.serialize_str(self.as_str())
1451    }
1452}
1453#[cfg(feature = "deserialize")]
1454impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataEpsBank {
1455    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1456        use std::str::FromStr;
1457        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1458        Ok(Self::from_str(&s).expect("infallible"))
1459    }
1460}
1461/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
1462#[derive(Clone, Debug, serde::Serialize)]
1463pub struct CreatePaymentIntentPaymentMethodDataFpx {
1464    /// Account holder type for FPX transaction
1465    #[serde(skip_serializing_if = "Option::is_none")]
1466    pub account_holder_type: Option<CreatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
1467    /// The customer's bank.
1468    pub bank: CreatePaymentIntentPaymentMethodDataFpxBank,
1469}
1470impl CreatePaymentIntentPaymentMethodDataFpx {
1471    pub fn new(bank: impl Into<CreatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
1472        Self { account_holder_type: None, bank: bank.into() }
1473    }
1474}
1475/// Account holder type for FPX transaction
1476#[derive(Clone, Eq, PartialEq)]
1477#[non_exhaustive]
1478pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1479    Company,
1480    Individual,
1481    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1482    Unknown(String),
1483}
1484impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1485    pub fn as_str(&self) -> &str {
1486        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1487        match self {
1488            Company => "company",
1489            Individual => "individual",
1490            Unknown(v) => v,
1491        }
1492    }
1493}
1494
1495impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1496    type Err = std::convert::Infallible;
1497    fn from_str(s: &str) -> Result<Self, Self::Err> {
1498        use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
1499        match s {
1500            "company" => Ok(Company),
1501            "individual" => Ok(Individual),
1502            v => {
1503                tracing::warn!(
1504                    "Unknown value '{}' for enum '{}'",
1505                    v,
1506                    "CreatePaymentIntentPaymentMethodDataFpxAccountHolderType"
1507                );
1508                Ok(Unknown(v.to_owned()))
1509            }
1510        }
1511    }
1512}
1513impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1514    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1515        f.write_str(self.as_str())
1516    }
1517}
1518
1519impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1520    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1521        f.write_str(self.as_str())
1522    }
1523}
1524impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1525    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1526    where
1527        S: serde::Serializer,
1528    {
1529        serializer.serialize_str(self.as_str())
1530    }
1531}
1532#[cfg(feature = "deserialize")]
1533impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType {
1534    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1535        use std::str::FromStr;
1536        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1537        Ok(Self::from_str(&s).expect("infallible"))
1538    }
1539}
1540/// The customer's bank.
1541#[derive(Clone, Eq, PartialEq)]
1542#[non_exhaustive]
1543pub enum CreatePaymentIntentPaymentMethodDataFpxBank {
1544    AffinBank,
1545    Agrobank,
1546    AllianceBank,
1547    Ambank,
1548    BankIslam,
1549    BankMuamalat,
1550    BankOfChina,
1551    BankRakyat,
1552    Bsn,
1553    Cimb,
1554    DeutscheBank,
1555    HongLeongBank,
1556    Hsbc,
1557    Kfh,
1558    Maybank2e,
1559    Maybank2u,
1560    Ocbc,
1561    PbEnterprise,
1562    PublicBank,
1563    Rhb,
1564    StandardChartered,
1565    Uob,
1566    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1567    Unknown(String),
1568}
1569impl CreatePaymentIntentPaymentMethodDataFpxBank {
1570    pub fn as_str(&self) -> &str {
1571        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1572        match self {
1573            AffinBank => "affin_bank",
1574            Agrobank => "agrobank",
1575            AllianceBank => "alliance_bank",
1576            Ambank => "ambank",
1577            BankIslam => "bank_islam",
1578            BankMuamalat => "bank_muamalat",
1579            BankOfChina => "bank_of_china",
1580            BankRakyat => "bank_rakyat",
1581            Bsn => "bsn",
1582            Cimb => "cimb",
1583            DeutscheBank => "deutsche_bank",
1584            HongLeongBank => "hong_leong_bank",
1585            Hsbc => "hsbc",
1586            Kfh => "kfh",
1587            Maybank2e => "maybank2e",
1588            Maybank2u => "maybank2u",
1589            Ocbc => "ocbc",
1590            PbEnterprise => "pb_enterprise",
1591            PublicBank => "public_bank",
1592            Rhb => "rhb",
1593            StandardChartered => "standard_chartered",
1594            Uob => "uob",
1595            Unknown(v) => v,
1596        }
1597    }
1598}
1599
1600impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxBank {
1601    type Err = std::convert::Infallible;
1602    fn from_str(s: &str) -> Result<Self, Self::Err> {
1603        use CreatePaymentIntentPaymentMethodDataFpxBank::*;
1604        match s {
1605            "affin_bank" => Ok(AffinBank),
1606            "agrobank" => Ok(Agrobank),
1607            "alliance_bank" => Ok(AllianceBank),
1608            "ambank" => Ok(Ambank),
1609            "bank_islam" => Ok(BankIslam),
1610            "bank_muamalat" => Ok(BankMuamalat),
1611            "bank_of_china" => Ok(BankOfChina),
1612            "bank_rakyat" => Ok(BankRakyat),
1613            "bsn" => Ok(Bsn),
1614            "cimb" => Ok(Cimb),
1615            "deutsche_bank" => Ok(DeutscheBank),
1616            "hong_leong_bank" => Ok(HongLeongBank),
1617            "hsbc" => Ok(Hsbc),
1618            "kfh" => Ok(Kfh),
1619            "maybank2e" => Ok(Maybank2e),
1620            "maybank2u" => Ok(Maybank2u),
1621            "ocbc" => Ok(Ocbc),
1622            "pb_enterprise" => Ok(PbEnterprise),
1623            "public_bank" => Ok(PublicBank),
1624            "rhb" => Ok(Rhb),
1625            "standard_chartered" => Ok(StandardChartered),
1626            "uob" => Ok(Uob),
1627            v => {
1628                tracing::warn!(
1629                    "Unknown value '{}' for enum '{}'",
1630                    v,
1631                    "CreatePaymentIntentPaymentMethodDataFpxBank"
1632                );
1633                Ok(Unknown(v.to_owned()))
1634            }
1635        }
1636    }
1637}
1638impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank {
1639    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1640        f.write_str(self.as_str())
1641    }
1642}
1643
1644impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxBank {
1645    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1646        f.write_str(self.as_str())
1647    }
1648}
1649impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxBank {
1650    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1651    where
1652        S: serde::Serializer,
1653    {
1654        serializer.serialize_str(self.as_str())
1655    }
1656}
1657#[cfg(feature = "deserialize")]
1658impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataFpxBank {
1659    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1660        use std::str::FromStr;
1661        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1662        Ok(Self::from_str(&s).expect("infallible"))
1663    }
1664}
1665/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
1666#[derive(Clone, Debug, serde::Serialize)]
1667pub struct CreatePaymentIntentPaymentMethodDataIdeal {
1668    /// The customer's bank.
1669    /// Only use this parameter for existing customers.
1670    /// Don't use it for new customers.
1671    #[serde(skip_serializing_if = "Option::is_none")]
1672    pub bank: Option<CreatePaymentIntentPaymentMethodDataIdealBank>,
1673}
1674impl CreatePaymentIntentPaymentMethodDataIdeal {
1675    pub fn new() -> Self {
1676        Self { bank: None }
1677    }
1678}
1679impl Default for CreatePaymentIntentPaymentMethodDataIdeal {
1680    fn default() -> Self {
1681        Self::new()
1682    }
1683}
1684/// The customer's bank.
1685/// Only use this parameter for existing customers.
1686/// Don't use it for new customers.
1687#[derive(Clone, Eq, PartialEq)]
1688#[non_exhaustive]
1689pub enum CreatePaymentIntentPaymentMethodDataIdealBank {
1690    AbnAmro,
1691    AsnBank,
1692    Bunq,
1693    Buut,
1694    Finom,
1695    Handelsbanken,
1696    Ing,
1697    Knab,
1698    Moneyou,
1699    N26,
1700    Nn,
1701    Rabobank,
1702    Regiobank,
1703    Revolut,
1704    SnsBank,
1705    TriodosBank,
1706    VanLanschot,
1707    Yoursafe,
1708    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1709    Unknown(String),
1710}
1711impl CreatePaymentIntentPaymentMethodDataIdealBank {
1712    pub fn as_str(&self) -> &str {
1713        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1714        match self {
1715            AbnAmro => "abn_amro",
1716            AsnBank => "asn_bank",
1717            Bunq => "bunq",
1718            Buut => "buut",
1719            Finom => "finom",
1720            Handelsbanken => "handelsbanken",
1721            Ing => "ing",
1722            Knab => "knab",
1723            Moneyou => "moneyou",
1724            N26 => "n26",
1725            Nn => "nn",
1726            Rabobank => "rabobank",
1727            Regiobank => "regiobank",
1728            Revolut => "revolut",
1729            SnsBank => "sns_bank",
1730            TriodosBank => "triodos_bank",
1731            VanLanschot => "van_lanschot",
1732            Yoursafe => "yoursafe",
1733            Unknown(v) => v,
1734        }
1735    }
1736}
1737
1738impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataIdealBank {
1739    type Err = std::convert::Infallible;
1740    fn from_str(s: &str) -> Result<Self, Self::Err> {
1741        use CreatePaymentIntentPaymentMethodDataIdealBank::*;
1742        match s {
1743            "abn_amro" => Ok(AbnAmro),
1744            "asn_bank" => Ok(AsnBank),
1745            "bunq" => Ok(Bunq),
1746            "buut" => Ok(Buut),
1747            "finom" => Ok(Finom),
1748            "handelsbanken" => Ok(Handelsbanken),
1749            "ing" => Ok(Ing),
1750            "knab" => Ok(Knab),
1751            "moneyou" => Ok(Moneyou),
1752            "n26" => Ok(N26),
1753            "nn" => Ok(Nn),
1754            "rabobank" => Ok(Rabobank),
1755            "regiobank" => Ok(Regiobank),
1756            "revolut" => Ok(Revolut),
1757            "sns_bank" => Ok(SnsBank),
1758            "triodos_bank" => Ok(TriodosBank),
1759            "van_lanschot" => Ok(VanLanschot),
1760            "yoursafe" => Ok(Yoursafe),
1761            v => {
1762                tracing::warn!(
1763                    "Unknown value '{}' for enum '{}'",
1764                    v,
1765                    "CreatePaymentIntentPaymentMethodDataIdealBank"
1766                );
1767                Ok(Unknown(v.to_owned()))
1768            }
1769        }
1770    }
1771}
1772impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank {
1773    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1774        f.write_str(self.as_str())
1775    }
1776}
1777
1778impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataIdealBank {
1779    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1780        f.write_str(self.as_str())
1781    }
1782}
1783impl serde::Serialize for CreatePaymentIntentPaymentMethodDataIdealBank {
1784    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1785    where
1786        S: serde::Serializer,
1787    {
1788        serializer.serialize_str(self.as_str())
1789    }
1790}
1791#[cfg(feature = "deserialize")]
1792impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataIdealBank {
1793    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1794        use std::str::FromStr;
1795        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1796        Ok(Self::from_str(&s).expect("infallible"))
1797    }
1798}
1799/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
1800#[derive(Copy, Clone, Debug, serde::Serialize)]
1801pub struct CreatePaymentIntentPaymentMethodDataKlarna {
1802    /// Customer's date of birth
1803    #[serde(skip_serializing_if = "Option::is_none")]
1804    pub dob: Option<DateOfBirth>,
1805}
1806impl CreatePaymentIntentPaymentMethodDataKlarna {
1807    pub fn new() -> Self {
1808        Self { dob: None }
1809    }
1810}
1811impl Default for CreatePaymentIntentPaymentMethodDataKlarna {
1812    fn default() -> Self {
1813        Self::new()
1814    }
1815}
1816/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
1817#[derive(Clone, Debug, serde::Serialize)]
1818pub struct CreatePaymentIntentPaymentMethodDataNaverPay {
1819    /// Whether to use Naver Pay points or a card to fund this transaction.
1820    /// If not provided, this defaults to `card`.
1821    #[serde(skip_serializing_if = "Option::is_none")]
1822    pub funding: Option<CreatePaymentIntentPaymentMethodDataNaverPayFunding>,
1823}
1824impl CreatePaymentIntentPaymentMethodDataNaverPay {
1825    pub fn new() -> Self {
1826        Self { funding: None }
1827    }
1828}
1829impl Default for CreatePaymentIntentPaymentMethodDataNaverPay {
1830    fn default() -> Self {
1831        Self::new()
1832    }
1833}
1834/// Whether to use Naver Pay points or a card to fund this transaction.
1835/// If not provided, this defaults to `card`.
1836#[derive(Clone, Eq, PartialEq)]
1837#[non_exhaustive]
1838pub enum CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1839    Card,
1840    Points,
1841    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1842    Unknown(String),
1843}
1844impl CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1845    pub fn as_str(&self) -> &str {
1846        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1847        match self {
1848            Card => "card",
1849            Points => "points",
1850            Unknown(v) => v,
1851        }
1852    }
1853}
1854
1855impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1856    type Err = std::convert::Infallible;
1857    fn from_str(s: &str) -> Result<Self, Self::Err> {
1858        use CreatePaymentIntentPaymentMethodDataNaverPayFunding::*;
1859        match s {
1860            "card" => Ok(Card),
1861            "points" => Ok(Points),
1862            v => {
1863                tracing::warn!(
1864                    "Unknown value '{}' for enum '{}'",
1865                    v,
1866                    "CreatePaymentIntentPaymentMethodDataNaverPayFunding"
1867                );
1868                Ok(Unknown(v.to_owned()))
1869            }
1870        }
1871    }
1872}
1873impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1874    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1875        f.write_str(self.as_str())
1876    }
1877}
1878
1879impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1880    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1881        f.write_str(self.as_str())
1882    }
1883}
1884impl serde::Serialize for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1885    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1886    where
1887        S: serde::Serializer,
1888    {
1889        serializer.serialize_str(self.as_str())
1890    }
1891}
1892#[cfg(feature = "deserialize")]
1893impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataNaverPayFunding {
1894    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1895        use std::str::FromStr;
1896        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
1897        Ok(Self::from_str(&s).expect("infallible"))
1898    }
1899}
1900/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
1901#[derive(Clone, Debug, serde::Serialize)]
1902pub struct CreatePaymentIntentPaymentMethodDataNzBankAccount {
1903    /// The name on the bank account.
1904    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
1905    #[serde(skip_serializing_if = "Option::is_none")]
1906    pub account_holder_name: Option<String>,
1907    /// The account number for the bank account.
1908    pub account_number: String,
1909    /// The numeric code for the bank account's bank.
1910    pub bank_code: String,
1911    /// The numeric code for the bank account's bank branch.
1912    pub branch_code: String,
1913    #[serde(skip_serializing_if = "Option::is_none")]
1914    pub reference: Option<String>,
1915    /// The suffix of the bank account number.
1916    pub suffix: String,
1917}
1918impl CreatePaymentIntentPaymentMethodDataNzBankAccount {
1919    pub fn new(
1920        account_number: impl Into<String>,
1921        bank_code: impl Into<String>,
1922        branch_code: impl Into<String>,
1923        suffix: impl Into<String>,
1924    ) -> Self {
1925        Self {
1926            account_holder_name: None,
1927            account_number: account_number.into(),
1928            bank_code: bank_code.into(),
1929            branch_code: branch_code.into(),
1930            reference: None,
1931            suffix: suffix.into(),
1932        }
1933    }
1934}
1935/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
1936#[derive(Clone, Debug, serde::Serialize)]
1937pub struct CreatePaymentIntentPaymentMethodDataP24 {
1938    /// The customer's bank.
1939    #[serde(skip_serializing_if = "Option::is_none")]
1940    pub bank: Option<CreatePaymentIntentPaymentMethodDataP24Bank>,
1941}
1942impl CreatePaymentIntentPaymentMethodDataP24 {
1943    pub fn new() -> Self {
1944        Self { bank: None }
1945    }
1946}
1947impl Default for CreatePaymentIntentPaymentMethodDataP24 {
1948    fn default() -> Self {
1949        Self::new()
1950    }
1951}
1952/// The customer's bank.
1953#[derive(Clone, Eq, PartialEq)]
1954#[non_exhaustive]
1955pub enum CreatePaymentIntentPaymentMethodDataP24Bank {
1956    AliorBank,
1957    BankMillennium,
1958    BankNowyBfgSa,
1959    BankPekaoSa,
1960    BankiSpbdzielcze,
1961    Blik,
1962    BnpParibas,
1963    Boz,
1964    CitiHandlowy,
1965    CreditAgricole,
1966    Envelobank,
1967    EtransferPocztowy24,
1968    GetinBank,
1969    Ideabank,
1970    Ing,
1971    Inteligo,
1972    MbankMtransfer,
1973    NestPrzelew,
1974    NoblePay,
1975    PbacZIpko,
1976    PlusBank,
1977    SantanderPrzelew24,
1978    TmobileUsbugiBankowe,
1979    ToyotaBank,
1980    Velobank,
1981    VolkswagenBank,
1982    /// An unrecognized value from Stripe. Should not be used as a request parameter.
1983    Unknown(String),
1984}
1985impl CreatePaymentIntentPaymentMethodDataP24Bank {
1986    pub fn as_str(&self) -> &str {
1987        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
1988        match self {
1989            AliorBank => "alior_bank",
1990            BankMillennium => "bank_millennium",
1991            BankNowyBfgSa => "bank_nowy_bfg_sa",
1992            BankPekaoSa => "bank_pekao_sa",
1993            BankiSpbdzielcze => "banki_spbdzielcze",
1994            Blik => "blik",
1995            BnpParibas => "bnp_paribas",
1996            Boz => "boz",
1997            CitiHandlowy => "citi_handlowy",
1998            CreditAgricole => "credit_agricole",
1999            Envelobank => "envelobank",
2000            EtransferPocztowy24 => "etransfer_pocztowy24",
2001            GetinBank => "getin_bank",
2002            Ideabank => "ideabank",
2003            Ing => "ing",
2004            Inteligo => "inteligo",
2005            MbankMtransfer => "mbank_mtransfer",
2006            NestPrzelew => "nest_przelew",
2007            NoblePay => "noble_pay",
2008            PbacZIpko => "pbac_z_ipko",
2009            PlusBank => "plus_bank",
2010            SantanderPrzelew24 => "santander_przelew24",
2011            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
2012            ToyotaBank => "toyota_bank",
2013            Velobank => "velobank",
2014            VolkswagenBank => "volkswagen_bank",
2015            Unknown(v) => v,
2016        }
2017    }
2018}
2019
2020impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataP24Bank {
2021    type Err = std::convert::Infallible;
2022    fn from_str(s: &str) -> Result<Self, Self::Err> {
2023        use CreatePaymentIntentPaymentMethodDataP24Bank::*;
2024        match s {
2025            "alior_bank" => Ok(AliorBank),
2026            "bank_millennium" => Ok(BankMillennium),
2027            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
2028            "bank_pekao_sa" => Ok(BankPekaoSa),
2029            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
2030            "blik" => Ok(Blik),
2031            "bnp_paribas" => Ok(BnpParibas),
2032            "boz" => Ok(Boz),
2033            "citi_handlowy" => Ok(CitiHandlowy),
2034            "credit_agricole" => Ok(CreditAgricole),
2035            "envelobank" => Ok(Envelobank),
2036            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
2037            "getin_bank" => Ok(GetinBank),
2038            "ideabank" => Ok(Ideabank),
2039            "ing" => Ok(Ing),
2040            "inteligo" => Ok(Inteligo),
2041            "mbank_mtransfer" => Ok(MbankMtransfer),
2042            "nest_przelew" => Ok(NestPrzelew),
2043            "noble_pay" => Ok(NoblePay),
2044            "pbac_z_ipko" => Ok(PbacZIpko),
2045            "plus_bank" => Ok(PlusBank),
2046            "santander_przelew24" => Ok(SantanderPrzelew24),
2047            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
2048            "toyota_bank" => Ok(ToyotaBank),
2049            "velobank" => Ok(Velobank),
2050            "volkswagen_bank" => Ok(VolkswagenBank),
2051            v => {
2052                tracing::warn!(
2053                    "Unknown value '{}' for enum '{}'",
2054                    v,
2055                    "CreatePaymentIntentPaymentMethodDataP24Bank"
2056                );
2057                Ok(Unknown(v.to_owned()))
2058            }
2059        }
2060    }
2061}
2062impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank {
2063    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2064        f.write_str(self.as_str())
2065    }
2066}
2067
2068impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataP24Bank {
2069    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2070        f.write_str(self.as_str())
2071    }
2072}
2073impl serde::Serialize for CreatePaymentIntentPaymentMethodDataP24Bank {
2074    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2075    where
2076        S: serde::Serializer,
2077    {
2078        serializer.serialize_str(self.as_str())
2079    }
2080}
2081#[cfg(feature = "deserialize")]
2082impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataP24Bank {
2083    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2084        use std::str::FromStr;
2085        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2086        Ok(Self::from_str(&s).expect("infallible"))
2087    }
2088}
2089/// Options to configure Radar.
2090/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
2091#[derive(Clone, Debug, serde::Serialize)]
2092pub struct CreatePaymentIntentPaymentMethodDataRadarOptions {
2093    /// 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.
2094    #[serde(skip_serializing_if = "Option::is_none")]
2095    pub session: Option<String>,
2096}
2097impl CreatePaymentIntentPaymentMethodDataRadarOptions {
2098    pub fn new() -> Self {
2099        Self { session: None }
2100    }
2101}
2102impl Default for CreatePaymentIntentPaymentMethodDataRadarOptions {
2103    fn default() -> Self {
2104        Self::new()
2105    }
2106}
2107/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
2108#[derive(Clone, Debug, serde::Serialize)]
2109pub struct CreatePaymentIntentPaymentMethodDataSepaDebit {
2110    /// IBAN of the bank account.
2111    pub iban: String,
2112}
2113impl CreatePaymentIntentPaymentMethodDataSepaDebit {
2114    pub fn new(iban: impl Into<String>) -> Self {
2115        Self { iban: iban.into() }
2116    }
2117}
2118/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
2119#[derive(Clone, Debug, serde::Serialize)]
2120pub struct CreatePaymentIntentPaymentMethodDataSofort {
2121    /// Two-letter ISO code representing the country the bank account is located in.
2122    pub country: CreatePaymentIntentPaymentMethodDataSofortCountry,
2123}
2124impl CreatePaymentIntentPaymentMethodDataSofort {
2125    pub fn new(country: impl Into<CreatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
2126        Self { country: country.into() }
2127    }
2128}
2129/// Two-letter ISO code representing the country the bank account is located in.
2130#[derive(Clone, Eq, PartialEq)]
2131#[non_exhaustive]
2132pub enum CreatePaymentIntentPaymentMethodDataSofortCountry {
2133    At,
2134    Be,
2135    De,
2136    Es,
2137    It,
2138    Nl,
2139    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2140    Unknown(String),
2141}
2142impl CreatePaymentIntentPaymentMethodDataSofortCountry {
2143    pub fn as_str(&self) -> &str {
2144        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
2145        match self {
2146            At => "AT",
2147            Be => "BE",
2148            De => "DE",
2149            Es => "ES",
2150            It => "IT",
2151            Nl => "NL",
2152            Unknown(v) => v,
2153        }
2154    }
2155}
2156
2157impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataSofortCountry {
2158    type Err = std::convert::Infallible;
2159    fn from_str(s: &str) -> Result<Self, Self::Err> {
2160        use CreatePaymentIntentPaymentMethodDataSofortCountry::*;
2161        match s {
2162            "AT" => Ok(At),
2163            "BE" => Ok(Be),
2164            "DE" => Ok(De),
2165            "ES" => Ok(Es),
2166            "IT" => Ok(It),
2167            "NL" => Ok(Nl),
2168            v => {
2169                tracing::warn!(
2170                    "Unknown value '{}' for enum '{}'",
2171                    v,
2172                    "CreatePaymentIntentPaymentMethodDataSofortCountry"
2173                );
2174                Ok(Unknown(v.to_owned()))
2175            }
2176        }
2177    }
2178}
2179impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry {
2180    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2181        f.write_str(self.as_str())
2182    }
2183}
2184
2185impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataSofortCountry {
2186    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2187        f.write_str(self.as_str())
2188    }
2189}
2190impl serde::Serialize for CreatePaymentIntentPaymentMethodDataSofortCountry {
2191    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2192    where
2193        S: serde::Serializer,
2194    {
2195        serializer.serialize_str(self.as_str())
2196    }
2197}
2198#[cfg(feature = "deserialize")]
2199impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataSofortCountry {
2200    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2201        use std::str::FromStr;
2202        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2203        Ok(Self::from_str(&s).expect("infallible"))
2204    }
2205}
2206/// The type of the PaymentMethod.
2207/// An additional hash is included on the PaymentMethod with a name matching this value.
2208/// It contains additional information specific to the PaymentMethod type.
2209#[derive(Clone, Eq, PartialEq)]
2210#[non_exhaustive]
2211pub enum CreatePaymentIntentPaymentMethodDataType {
2212    AcssDebit,
2213    Affirm,
2214    AfterpayClearpay,
2215    Alipay,
2216    Alma,
2217    AmazonPay,
2218    AuBecsDebit,
2219    BacsDebit,
2220    Bancontact,
2221    Billie,
2222    Blik,
2223    Boleto,
2224    Cashapp,
2225    Crypto,
2226    CustomerBalance,
2227    Eps,
2228    Fpx,
2229    Giropay,
2230    Grabpay,
2231    Ideal,
2232    KakaoPay,
2233    Klarna,
2234    Konbini,
2235    KrCard,
2236    Link,
2237    MbWay,
2238    Mobilepay,
2239    Multibanco,
2240    NaverPay,
2241    NzBankAccount,
2242    Oxxo,
2243    P24,
2244    PayByBank,
2245    Payco,
2246    Paynow,
2247    Paypal,
2248    Pix,
2249    Promptpay,
2250    RevolutPay,
2251    SamsungPay,
2252    Satispay,
2253    SepaDebit,
2254    Sofort,
2255    Swish,
2256    Twint,
2257    UsBankAccount,
2258    WechatPay,
2259    Zip,
2260    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2261    Unknown(String),
2262}
2263impl CreatePaymentIntentPaymentMethodDataType {
2264    pub fn as_str(&self) -> &str {
2265        use CreatePaymentIntentPaymentMethodDataType::*;
2266        match self {
2267            AcssDebit => "acss_debit",
2268            Affirm => "affirm",
2269            AfterpayClearpay => "afterpay_clearpay",
2270            Alipay => "alipay",
2271            Alma => "alma",
2272            AmazonPay => "amazon_pay",
2273            AuBecsDebit => "au_becs_debit",
2274            BacsDebit => "bacs_debit",
2275            Bancontact => "bancontact",
2276            Billie => "billie",
2277            Blik => "blik",
2278            Boleto => "boleto",
2279            Cashapp => "cashapp",
2280            Crypto => "crypto",
2281            CustomerBalance => "customer_balance",
2282            Eps => "eps",
2283            Fpx => "fpx",
2284            Giropay => "giropay",
2285            Grabpay => "grabpay",
2286            Ideal => "ideal",
2287            KakaoPay => "kakao_pay",
2288            Klarna => "klarna",
2289            Konbini => "konbini",
2290            KrCard => "kr_card",
2291            Link => "link",
2292            MbWay => "mb_way",
2293            Mobilepay => "mobilepay",
2294            Multibanco => "multibanco",
2295            NaverPay => "naver_pay",
2296            NzBankAccount => "nz_bank_account",
2297            Oxxo => "oxxo",
2298            P24 => "p24",
2299            PayByBank => "pay_by_bank",
2300            Payco => "payco",
2301            Paynow => "paynow",
2302            Paypal => "paypal",
2303            Pix => "pix",
2304            Promptpay => "promptpay",
2305            RevolutPay => "revolut_pay",
2306            SamsungPay => "samsung_pay",
2307            Satispay => "satispay",
2308            SepaDebit => "sepa_debit",
2309            Sofort => "sofort",
2310            Swish => "swish",
2311            Twint => "twint",
2312            UsBankAccount => "us_bank_account",
2313            WechatPay => "wechat_pay",
2314            Zip => "zip",
2315            Unknown(v) => v,
2316        }
2317    }
2318}
2319
2320impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataType {
2321    type Err = std::convert::Infallible;
2322    fn from_str(s: &str) -> Result<Self, Self::Err> {
2323        use CreatePaymentIntentPaymentMethodDataType::*;
2324        match s {
2325            "acss_debit" => Ok(AcssDebit),
2326            "affirm" => Ok(Affirm),
2327            "afterpay_clearpay" => Ok(AfterpayClearpay),
2328            "alipay" => Ok(Alipay),
2329            "alma" => Ok(Alma),
2330            "amazon_pay" => Ok(AmazonPay),
2331            "au_becs_debit" => Ok(AuBecsDebit),
2332            "bacs_debit" => Ok(BacsDebit),
2333            "bancontact" => Ok(Bancontact),
2334            "billie" => Ok(Billie),
2335            "blik" => Ok(Blik),
2336            "boleto" => Ok(Boleto),
2337            "cashapp" => Ok(Cashapp),
2338            "crypto" => Ok(Crypto),
2339            "customer_balance" => Ok(CustomerBalance),
2340            "eps" => Ok(Eps),
2341            "fpx" => Ok(Fpx),
2342            "giropay" => Ok(Giropay),
2343            "grabpay" => Ok(Grabpay),
2344            "ideal" => Ok(Ideal),
2345            "kakao_pay" => Ok(KakaoPay),
2346            "klarna" => Ok(Klarna),
2347            "konbini" => Ok(Konbini),
2348            "kr_card" => Ok(KrCard),
2349            "link" => Ok(Link),
2350            "mb_way" => Ok(MbWay),
2351            "mobilepay" => Ok(Mobilepay),
2352            "multibanco" => Ok(Multibanco),
2353            "naver_pay" => Ok(NaverPay),
2354            "nz_bank_account" => Ok(NzBankAccount),
2355            "oxxo" => Ok(Oxxo),
2356            "p24" => Ok(P24),
2357            "pay_by_bank" => Ok(PayByBank),
2358            "payco" => Ok(Payco),
2359            "paynow" => Ok(Paynow),
2360            "paypal" => Ok(Paypal),
2361            "pix" => Ok(Pix),
2362            "promptpay" => Ok(Promptpay),
2363            "revolut_pay" => Ok(RevolutPay),
2364            "samsung_pay" => Ok(SamsungPay),
2365            "satispay" => Ok(Satispay),
2366            "sepa_debit" => Ok(SepaDebit),
2367            "sofort" => Ok(Sofort),
2368            "swish" => Ok(Swish),
2369            "twint" => Ok(Twint),
2370            "us_bank_account" => Ok(UsBankAccount),
2371            "wechat_pay" => Ok(WechatPay),
2372            "zip" => Ok(Zip),
2373            v => {
2374                tracing::warn!(
2375                    "Unknown value '{}' for enum '{}'",
2376                    v,
2377                    "CreatePaymentIntentPaymentMethodDataType"
2378                );
2379                Ok(Unknown(v.to_owned()))
2380            }
2381        }
2382    }
2383}
2384impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType {
2385    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2386        f.write_str(self.as_str())
2387    }
2388}
2389
2390impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataType {
2391    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2392        f.write_str(self.as_str())
2393    }
2394}
2395impl serde::Serialize for CreatePaymentIntentPaymentMethodDataType {
2396    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2397    where
2398        S: serde::Serializer,
2399    {
2400        serializer.serialize_str(self.as_str())
2401    }
2402}
2403#[cfg(feature = "deserialize")]
2404impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataType {
2405    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2406        use std::str::FromStr;
2407        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2408        Ok(Self::from_str(&s).expect("infallible"))
2409    }
2410}
2411/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
2412#[derive(Clone, Debug, serde::Serialize)]
2413pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount {
2414    /// Account holder type: individual or company.
2415    #[serde(skip_serializing_if = "Option::is_none")]
2416    pub account_holder_type:
2417        Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
2418    /// Account number of the bank account.
2419    #[serde(skip_serializing_if = "Option::is_none")]
2420    pub account_number: Option<String>,
2421    /// Account type: checkings or savings. Defaults to checking if omitted.
2422    #[serde(skip_serializing_if = "Option::is_none")]
2423    pub account_type: Option<CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
2424    /// The ID of a Financial Connections Account to use as a payment method.
2425    #[serde(skip_serializing_if = "Option::is_none")]
2426    pub financial_connections_account: Option<String>,
2427    /// Routing number of the bank account.
2428    #[serde(skip_serializing_if = "Option::is_none")]
2429    pub routing_number: Option<String>,
2430}
2431impl CreatePaymentIntentPaymentMethodDataUsBankAccount {
2432    pub fn new() -> Self {
2433        Self {
2434            account_holder_type: None,
2435            account_number: None,
2436            account_type: None,
2437            financial_connections_account: None,
2438            routing_number: None,
2439        }
2440    }
2441}
2442impl Default for CreatePaymentIntentPaymentMethodDataUsBankAccount {
2443    fn default() -> Self {
2444        Self::new()
2445    }
2446}
2447/// Account holder type: individual or company.
2448#[derive(Clone, Eq, PartialEq)]
2449#[non_exhaustive]
2450pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2451    Company,
2452    Individual,
2453    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2454    Unknown(String),
2455}
2456impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2457    pub fn as_str(&self) -> &str {
2458        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2459        match self {
2460            Company => "company",
2461            Individual => "individual",
2462            Unknown(v) => v,
2463        }
2464    }
2465}
2466
2467impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2468    type Err = std::convert::Infallible;
2469    fn from_str(s: &str) -> Result<Self, Self::Err> {
2470        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
2471        match s {
2472            "company" => Ok(Company),
2473            "individual" => Ok(Individual),
2474            v => {
2475                tracing::warn!(
2476                    "Unknown value '{}' for enum '{}'",
2477                    v,
2478                    "CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"
2479                );
2480                Ok(Unknown(v.to_owned()))
2481            }
2482        }
2483    }
2484}
2485impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2486    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2487        f.write_str(self.as_str())
2488    }
2489}
2490
2491impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2493        f.write_str(self.as_str())
2494    }
2495}
2496impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
2497    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2498    where
2499        S: serde::Serializer,
2500    {
2501        serializer.serialize_str(self.as_str())
2502    }
2503}
2504#[cfg(feature = "deserialize")]
2505impl<'de> serde::Deserialize<'de>
2506    for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
2507{
2508    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2509        use std::str::FromStr;
2510        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2511        Ok(Self::from_str(&s).expect("infallible"))
2512    }
2513}
2514/// Account type: checkings or savings. Defaults to checking if omitted.
2515#[derive(Clone, Eq, PartialEq)]
2516#[non_exhaustive]
2517pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2518    Checking,
2519    Savings,
2520    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2521    Unknown(String),
2522}
2523impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2524    pub fn as_str(&self) -> &str {
2525        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2526        match self {
2527            Checking => "checking",
2528            Savings => "savings",
2529            Unknown(v) => v,
2530        }
2531    }
2532}
2533
2534impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2535    type Err = std::convert::Infallible;
2536    fn from_str(s: &str) -> Result<Self, Self::Err> {
2537        use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
2538        match s {
2539            "checking" => Ok(Checking),
2540            "savings" => Ok(Savings),
2541            v => {
2542                tracing::warn!(
2543                    "Unknown value '{}' for enum '{}'",
2544                    v,
2545                    "CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType"
2546                );
2547                Ok(Unknown(v.to_owned()))
2548            }
2549        }
2550    }
2551}
2552impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2553    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2554        f.write_str(self.as_str())
2555    }
2556}
2557
2558impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2559    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2560        f.write_str(self.as_str())
2561    }
2562}
2563impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2564    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2565    where
2566        S: serde::Serializer,
2567    {
2568        serializer.serialize_str(self.as_str())
2569    }
2570}
2571#[cfg(feature = "deserialize")]
2572impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
2573    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2574        use std::str::FromStr;
2575        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2576        Ok(Self::from_str(&s).expect("infallible"))
2577    }
2578}
2579/// Payment method-specific configuration for this PaymentIntent.
2580#[derive(Clone, Debug, serde::Serialize)]
2581pub struct CreatePaymentIntentPaymentMethodOptions {
2582    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2583    #[serde(skip_serializing_if = "Option::is_none")]
2584    pub acss_debit: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebit>,
2585    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
2586    #[serde(skip_serializing_if = "Option::is_none")]
2587    pub affirm: Option<CreatePaymentIntentPaymentMethodOptionsAffirm>,
2588    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
2589    #[serde(skip_serializing_if = "Option::is_none")]
2590    pub afterpay_clearpay: Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
2591    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
2592    #[serde(skip_serializing_if = "Option::is_none")]
2593    pub alipay: Option<CreatePaymentIntentPaymentMethodOptionsAlipay>,
2594    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
2595    #[serde(skip_serializing_if = "Option::is_none")]
2596    pub alma: Option<CreatePaymentIntentPaymentMethodOptionsAlma>,
2597    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
2598    #[serde(skip_serializing_if = "Option::is_none")]
2599    pub amazon_pay: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPay>,
2600    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
2601    #[serde(skip_serializing_if = "Option::is_none")]
2602    pub au_becs_debit: Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
2603    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
2604    #[serde(skip_serializing_if = "Option::is_none")]
2605    pub bacs_debit: Option<CreatePaymentIntentPaymentMethodOptionsBacsDebit>,
2606    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
2607    #[serde(skip_serializing_if = "Option::is_none")]
2608    pub bancontact: Option<CreatePaymentIntentPaymentMethodOptionsBancontact>,
2609    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
2610    #[serde(skip_serializing_if = "Option::is_none")]
2611    pub billie: Option<CreatePaymentIntentPaymentMethodOptionsBillie>,
2612    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
2613    #[serde(skip_serializing_if = "Option::is_none")]
2614    pub blik: Option<CreatePaymentIntentPaymentMethodOptionsBlik>,
2615    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
2616    #[serde(skip_serializing_if = "Option::is_none")]
2617    pub boleto: Option<CreatePaymentIntentPaymentMethodOptionsBoleto>,
2618    /// Configuration for any card payments attempted on this PaymentIntent.
2619    #[serde(skip_serializing_if = "Option::is_none")]
2620    pub card: Option<CreatePaymentIntentPaymentMethodOptionsCard>,
2621    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2622    #[serde(skip_serializing_if = "Option::is_none")]
2623    pub card_present: Option<CreatePaymentIntentPaymentMethodOptionsCardPresent>,
2624    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
2625    #[serde(skip_serializing_if = "Option::is_none")]
2626    pub cashapp: Option<CreatePaymentIntentPaymentMethodOptionsCashapp>,
2627    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
2628    #[serde(skip_serializing_if = "Option::is_none")]
2629    pub crypto: Option<CreatePaymentIntentPaymentMethodOptionsCrypto>,
2630    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
2631    #[serde(skip_serializing_if = "Option::is_none")]
2632    pub customer_balance: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalance>,
2633    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
2634    #[serde(skip_serializing_if = "Option::is_none")]
2635    pub eps: Option<CreatePaymentIntentPaymentMethodOptionsEps>,
2636    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
2637    #[serde(skip_serializing_if = "Option::is_none")]
2638    pub fpx: Option<CreatePaymentIntentPaymentMethodOptionsFpx>,
2639    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
2640    #[serde(skip_serializing_if = "Option::is_none")]
2641    pub giropay: Option<CreatePaymentIntentPaymentMethodOptionsGiropay>,
2642    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
2643    #[serde(skip_serializing_if = "Option::is_none")]
2644    pub grabpay: Option<CreatePaymentIntentPaymentMethodOptionsGrabpay>,
2645    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
2646    #[serde(skip_serializing_if = "Option::is_none")]
2647    pub ideal: Option<CreatePaymentIntentPaymentMethodOptionsIdeal>,
2648    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
2649    #[serde(skip_serializing_if = "Option::is_none")]
2650    #[serde(with = "stripe_types::with_serde_json_opt")]
2651    pub interac_present: Option<miniserde::json::Value>,
2652    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
2653    #[serde(skip_serializing_if = "Option::is_none")]
2654    pub kakao_pay: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPay>,
2655    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
2656    #[serde(skip_serializing_if = "Option::is_none")]
2657    pub klarna: Option<CreatePaymentIntentPaymentMethodOptionsKlarna>,
2658    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
2659    #[serde(skip_serializing_if = "Option::is_none")]
2660    pub konbini: Option<CreatePaymentIntentPaymentMethodOptionsKonbini>,
2661    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
2662    #[serde(skip_serializing_if = "Option::is_none")]
2663    pub kr_card: Option<CreatePaymentIntentPaymentMethodOptionsKrCard>,
2664    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2665    #[serde(skip_serializing_if = "Option::is_none")]
2666    pub link: Option<CreatePaymentIntentPaymentMethodOptionsLink>,
2667    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
2668    #[serde(skip_serializing_if = "Option::is_none")]
2669    pub mb_way: Option<CreatePaymentIntentPaymentMethodOptionsMbWay>,
2670    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
2671    #[serde(skip_serializing_if = "Option::is_none")]
2672    pub mobilepay: Option<CreatePaymentIntentPaymentMethodOptionsMobilepay>,
2673    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
2674    #[serde(skip_serializing_if = "Option::is_none")]
2675    pub multibanco: Option<CreatePaymentIntentPaymentMethodOptionsMultibanco>,
2676    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
2677    #[serde(skip_serializing_if = "Option::is_none")]
2678    pub naver_pay: Option<CreatePaymentIntentPaymentMethodOptionsNaverPay>,
2679    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
2680    #[serde(skip_serializing_if = "Option::is_none")]
2681    pub nz_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccount>,
2682    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
2683    #[serde(skip_serializing_if = "Option::is_none")]
2684    pub oxxo: Option<CreatePaymentIntentPaymentMethodOptionsOxxo>,
2685    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
2686    #[serde(skip_serializing_if = "Option::is_none")]
2687    pub p24: Option<CreatePaymentIntentPaymentMethodOptionsP24>,
2688    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
2689    #[serde(skip_serializing_if = "Option::is_none")]
2690    #[serde(with = "stripe_types::with_serde_json_opt")]
2691    pub pay_by_bank: Option<miniserde::json::Value>,
2692    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
2693    #[serde(skip_serializing_if = "Option::is_none")]
2694    pub payco: Option<CreatePaymentIntentPaymentMethodOptionsPayco>,
2695    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
2696    #[serde(skip_serializing_if = "Option::is_none")]
2697    pub paynow: Option<CreatePaymentIntentPaymentMethodOptionsPaynow>,
2698    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
2699    #[serde(skip_serializing_if = "Option::is_none")]
2700    pub paypal: Option<CreatePaymentIntentPaymentMethodOptionsPaypal>,
2701    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
2702    #[serde(skip_serializing_if = "Option::is_none")]
2703    pub pix: Option<CreatePaymentIntentPaymentMethodOptionsPix>,
2704    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
2705    #[serde(skip_serializing_if = "Option::is_none")]
2706    pub promptpay: Option<CreatePaymentIntentPaymentMethodOptionsPromptpay>,
2707    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
2708    #[serde(skip_serializing_if = "Option::is_none")]
2709    pub revolut_pay: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPay>,
2710    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
2711    #[serde(skip_serializing_if = "Option::is_none")]
2712    pub samsung_pay: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPay>,
2713    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
2714    #[serde(skip_serializing_if = "Option::is_none")]
2715    pub satispay: Option<CreatePaymentIntentPaymentMethodOptionsSatispay>,
2716    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
2717    #[serde(skip_serializing_if = "Option::is_none")]
2718    pub sepa_debit: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebit>,
2719    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
2720    #[serde(skip_serializing_if = "Option::is_none")]
2721    pub sofort: Option<CreatePaymentIntentPaymentMethodOptionsSofort>,
2722    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
2723    #[serde(skip_serializing_if = "Option::is_none")]
2724    pub swish: Option<CreatePaymentIntentPaymentMethodOptionsSwish>,
2725    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
2726    #[serde(skip_serializing_if = "Option::is_none")]
2727    pub twint: Option<CreatePaymentIntentPaymentMethodOptionsTwint>,
2728    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
2729    #[serde(skip_serializing_if = "Option::is_none")]
2730    pub us_bank_account: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccount>,
2731    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
2732    #[serde(skip_serializing_if = "Option::is_none")]
2733    pub wechat_pay: Option<CreatePaymentIntentPaymentMethodOptionsWechatPay>,
2734    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
2735    #[serde(skip_serializing_if = "Option::is_none")]
2736    pub zip: Option<CreatePaymentIntentPaymentMethodOptionsZip>,
2737}
2738impl CreatePaymentIntentPaymentMethodOptions {
2739    pub fn new() -> Self {
2740        Self {
2741            acss_debit: None,
2742            affirm: None,
2743            afterpay_clearpay: None,
2744            alipay: None,
2745            alma: None,
2746            amazon_pay: None,
2747            au_becs_debit: None,
2748            bacs_debit: None,
2749            bancontact: None,
2750            billie: None,
2751            blik: None,
2752            boleto: None,
2753            card: None,
2754            card_present: None,
2755            cashapp: None,
2756            crypto: None,
2757            customer_balance: None,
2758            eps: None,
2759            fpx: None,
2760            giropay: None,
2761            grabpay: None,
2762            ideal: None,
2763            interac_present: None,
2764            kakao_pay: None,
2765            klarna: None,
2766            konbini: None,
2767            kr_card: None,
2768            link: None,
2769            mb_way: None,
2770            mobilepay: None,
2771            multibanco: None,
2772            naver_pay: None,
2773            nz_bank_account: None,
2774            oxxo: None,
2775            p24: None,
2776            pay_by_bank: None,
2777            payco: None,
2778            paynow: None,
2779            paypal: None,
2780            pix: None,
2781            promptpay: None,
2782            revolut_pay: None,
2783            samsung_pay: None,
2784            satispay: None,
2785            sepa_debit: None,
2786            sofort: None,
2787            swish: None,
2788            twint: None,
2789            us_bank_account: None,
2790            wechat_pay: None,
2791            zip: None,
2792        }
2793    }
2794}
2795impl Default for CreatePaymentIntentPaymentMethodOptions {
2796    fn default() -> Self {
2797        Self::new()
2798    }
2799}
2800/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
2801#[derive(Clone, Debug, serde::Serialize)]
2802pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2803    /// Additional fields for Mandate creation
2804    #[serde(skip_serializing_if = "Option::is_none")]
2805    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
2806    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
2807    ///
2808    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
2809    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
2810    ///
2811    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
2812    ///
2813    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
2814    ///
2815    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2816    #[serde(skip_serializing_if = "Option::is_none")]
2817    pub setup_future_usage:
2818        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
2819    /// Controls when Stripe will attempt to debit the funds from the customer's account.
2820    /// The date must be a string in YYYY-MM-DD format.
2821    /// The date must be in the future and between 3 and 15 calendar days from now.
2822    #[serde(skip_serializing_if = "Option::is_none")]
2823    pub target_date: Option<String>,
2824    /// Bank account verification method.
2825    #[serde(skip_serializing_if = "Option::is_none")]
2826    pub verification_method:
2827        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
2828}
2829impl CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2830    pub fn new() -> Self {
2831        Self {
2832            mandate_options: None,
2833            setup_future_usage: None,
2834            target_date: None,
2835            verification_method: None,
2836        }
2837    }
2838}
2839impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebit {
2840    fn default() -> Self {
2841        Self::new()
2842    }
2843}
2844/// Additional fields for Mandate creation
2845#[derive(Clone, Debug, serde::Serialize)]
2846pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2847    /// A URL for custom mandate text to render during confirmation step.
2848    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
2849    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
2850    #[serde(skip_serializing_if = "Option::is_none")]
2851    pub custom_mandate_url: Option<String>,
2852    /// Description of the mandate interval.
2853    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
2854    #[serde(skip_serializing_if = "Option::is_none")]
2855    pub interval_description: Option<String>,
2856    /// Payment schedule for the mandate.
2857    #[serde(skip_serializing_if = "Option::is_none")]
2858    pub payment_schedule:
2859        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
2860    /// Transaction type of the mandate.
2861    #[serde(skip_serializing_if = "Option::is_none")]
2862    pub transaction_type:
2863        Option<CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
2864}
2865impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2866    pub fn new() -> Self {
2867        Self {
2868            custom_mandate_url: None,
2869            interval_description: None,
2870            payment_schedule: None,
2871            transaction_type: None,
2872        }
2873    }
2874}
2875impl Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
2876    fn default() -> Self {
2877        Self::new()
2878    }
2879}
2880/// Payment schedule for the mandate.
2881#[derive(Clone, Eq, PartialEq)]
2882#[non_exhaustive]
2883pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2884    Combined,
2885    Interval,
2886    Sporadic,
2887    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2888    Unknown(String),
2889}
2890impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
2891    pub fn as_str(&self) -> &str {
2892        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2893        match self {
2894            Combined => "combined",
2895            Interval => "interval",
2896            Sporadic => "sporadic",
2897            Unknown(v) => v,
2898        }
2899    }
2900}
2901
2902impl std::str::FromStr
2903    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2904{
2905    type Err = std::convert::Infallible;
2906    fn from_str(s: &str) -> Result<Self, Self::Err> {
2907        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
2908        match s {
2909            "combined" => Ok(Combined),
2910            "interval" => Ok(Interval),
2911            "sporadic" => Ok(Sporadic),
2912            v => {
2913                tracing::warn!(
2914                    "Unknown value '{}' for enum '{}'",
2915                    v,
2916                    "CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
2917                );
2918                Ok(Unknown(v.to_owned()))
2919            }
2920        }
2921    }
2922}
2923impl std::fmt::Display
2924    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2925{
2926    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2927        f.write_str(self.as_str())
2928    }
2929}
2930
2931impl std::fmt::Debug
2932    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2933{
2934    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2935        f.write_str(self.as_str())
2936    }
2937}
2938impl serde::Serialize
2939    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2940{
2941    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2942    where
2943        S: serde::Serializer,
2944    {
2945        serializer.serialize_str(self.as_str())
2946    }
2947}
2948#[cfg(feature = "deserialize")]
2949impl<'de> serde::Deserialize<'de>
2950    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
2951{
2952    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
2953        use std::str::FromStr;
2954        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
2955        Ok(Self::from_str(&s).expect("infallible"))
2956    }
2957}
2958/// Transaction type of the mandate.
2959#[derive(Clone, Eq, PartialEq)]
2960#[non_exhaustive]
2961pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2962    Business,
2963    Personal,
2964    /// An unrecognized value from Stripe. Should not be used as a request parameter.
2965    Unknown(String),
2966}
2967impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2968    pub fn as_str(&self) -> &str {
2969        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2970        match self {
2971            Business => "business",
2972            Personal => "personal",
2973            Unknown(v) => v,
2974        }
2975    }
2976}
2977
2978impl std::str::FromStr
2979    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2980{
2981    type Err = std::convert::Infallible;
2982    fn from_str(s: &str) -> Result<Self, Self::Err> {
2983        use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
2984        match s {
2985            "business" => Ok(Business),
2986            "personal" => Ok(Personal),
2987            v => {
2988                tracing::warn!(
2989                    "Unknown value '{}' for enum '{}'",
2990                    v,
2991                    "CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
2992                );
2993                Ok(Unknown(v.to_owned()))
2994            }
2995        }
2996    }
2997}
2998impl std::fmt::Display
2999    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3000{
3001    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3002        f.write_str(self.as_str())
3003    }
3004}
3005
3006impl std::fmt::Debug
3007    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3008{
3009    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3010        f.write_str(self.as_str())
3011    }
3012}
3013impl serde::Serialize
3014    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3015{
3016    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3017    where
3018        S: serde::Serializer,
3019    {
3020        serializer.serialize_str(self.as_str())
3021    }
3022}
3023#[cfg(feature = "deserialize")]
3024impl<'de> serde::Deserialize<'de>
3025    for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3026{
3027    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3028        use std::str::FromStr;
3029        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3030        Ok(Self::from_str(&s).expect("infallible"))
3031    }
3032}
3033/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3034///
3035/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3036/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3037///
3038/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3039///
3040/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3041///
3042/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3043#[derive(Clone, Eq, PartialEq)]
3044#[non_exhaustive]
3045pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
3046    None,
3047    OffSession,
3048    OnSession,
3049    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3050    Unknown(String),
3051}
3052impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
3053    pub fn as_str(&self) -> &str {
3054        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
3055        match self {
3056            None => "none",
3057            OffSession => "off_session",
3058            OnSession => "on_session",
3059            Unknown(v) => v,
3060        }
3061    }
3062}
3063
3064impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
3065    type Err = std::convert::Infallible;
3066    fn from_str(s: &str) -> Result<Self, Self::Err> {
3067        use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
3068        match s {
3069            "none" => Ok(None),
3070            "off_session" => Ok(OffSession),
3071            "on_session" => Ok(OnSession),
3072            v => {
3073                tracing::warn!(
3074                    "Unknown value '{}' for enum '{}'",
3075                    v,
3076                    "CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"
3077                );
3078                Ok(Unknown(v.to_owned()))
3079            }
3080        }
3081    }
3082}
3083impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
3084    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3085        f.write_str(self.as_str())
3086    }
3087}
3088
3089impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
3090    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3091        f.write_str(self.as_str())
3092    }
3093}
3094impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
3095    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3096    where
3097        S: serde::Serializer,
3098    {
3099        serializer.serialize_str(self.as_str())
3100    }
3101}
3102#[cfg(feature = "deserialize")]
3103impl<'de> serde::Deserialize<'de>
3104    for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
3105{
3106    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3107        use std::str::FromStr;
3108        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3109        Ok(Self::from_str(&s).expect("infallible"))
3110    }
3111}
3112/// Bank account verification method.
3113#[derive(Clone, Eq, PartialEq)]
3114#[non_exhaustive]
3115pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3116    Automatic,
3117    Instant,
3118    Microdeposits,
3119    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3120    Unknown(String),
3121}
3122impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3123    pub fn as_str(&self) -> &str {
3124        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
3125        match self {
3126            Automatic => "automatic",
3127            Instant => "instant",
3128            Microdeposits => "microdeposits",
3129            Unknown(v) => v,
3130        }
3131    }
3132}
3133
3134impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3135    type Err = std::convert::Infallible;
3136    fn from_str(s: &str) -> Result<Self, Self::Err> {
3137        use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
3138        match s {
3139            "automatic" => Ok(Automatic),
3140            "instant" => Ok(Instant),
3141            "microdeposits" => Ok(Microdeposits),
3142            v => {
3143                tracing::warn!(
3144                    "Unknown value '{}' for enum '{}'",
3145                    v,
3146                    "CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"
3147                );
3148                Ok(Unknown(v.to_owned()))
3149            }
3150        }
3151    }
3152}
3153impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3155        f.write_str(self.as_str())
3156    }
3157}
3158
3159impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3160    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3161        f.write_str(self.as_str())
3162    }
3163}
3164impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
3165    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3166    where
3167        S: serde::Serializer,
3168    {
3169        serializer.serialize_str(self.as_str())
3170    }
3171}
3172#[cfg(feature = "deserialize")]
3173impl<'de> serde::Deserialize<'de>
3174    for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
3175{
3176    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3177        use std::str::FromStr;
3178        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3179        Ok(Self::from_str(&s).expect("infallible"))
3180    }
3181}
3182/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
3183#[derive(Clone, Debug, serde::Serialize)]
3184pub struct CreatePaymentIntentPaymentMethodOptionsAffirm {
3185    /// Controls when the funds are captured from the customer's account.
3186    ///
3187    /// 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.
3188    ///
3189    /// 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.
3190    #[serde(skip_serializing_if = "Option::is_none")]
3191    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
3192    /// Preferred language of the Affirm authorization page that the customer is redirected to.
3193    #[serde(skip_serializing_if = "Option::is_none")]
3194    pub preferred_locale: Option<String>,
3195    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3196    ///
3197    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3198    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3199    ///
3200    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3201    ///
3202    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3203    ///
3204    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3205    #[serde(skip_serializing_if = "Option::is_none")]
3206    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
3207}
3208impl CreatePaymentIntentPaymentMethodOptionsAffirm {
3209    pub fn new() -> Self {
3210        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
3211    }
3212}
3213impl Default for CreatePaymentIntentPaymentMethodOptionsAffirm {
3214    fn default() -> Self {
3215        Self::new()
3216    }
3217}
3218/// Controls when the funds are captured from the customer's account.
3219///
3220/// 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.
3221///
3222/// 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.
3223#[derive(Clone, Eq, PartialEq)]
3224#[non_exhaustive]
3225pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3226    Manual,
3227    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3228    Unknown(String),
3229}
3230impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3231    pub fn as_str(&self) -> &str {
3232        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
3233        match self {
3234            Manual => "manual",
3235            Unknown(v) => v,
3236        }
3237    }
3238}
3239
3240impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3241    type Err = std::convert::Infallible;
3242    fn from_str(s: &str) -> Result<Self, Self::Err> {
3243        use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
3244        match s {
3245            "manual" => Ok(Manual),
3246            v => {
3247                tracing::warn!(
3248                    "Unknown value '{}' for enum '{}'",
3249                    v,
3250                    "CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod"
3251                );
3252                Ok(Unknown(v.to_owned()))
3253            }
3254        }
3255    }
3256}
3257impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3258    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3259        f.write_str(self.as_str())
3260    }
3261}
3262
3263impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3264    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3265        f.write_str(self.as_str())
3266    }
3267}
3268impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
3269    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3270    where
3271        S: serde::Serializer,
3272    {
3273        serializer.serialize_str(self.as_str())
3274    }
3275}
3276#[cfg(feature = "deserialize")]
3277impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
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        Ok(Self::from_str(&s).expect("infallible"))
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(Clone, Eq, PartialEq)]
3295#[non_exhaustive]
3296pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3297    None,
3298    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3299    Unknown(String),
3300}
3301impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3302    pub fn as_str(&self) -> &str {
3303        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
3304        match self {
3305            None => "none",
3306            Unknown(v) => v,
3307        }
3308    }
3309}
3310
3311impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3312    type Err = std::convert::Infallible;
3313    fn from_str(s: &str) -> Result<Self, Self::Err> {
3314        use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
3315        match s {
3316            "none" => Ok(None),
3317            v => {
3318                tracing::warn!(
3319                    "Unknown value '{}' for enum '{}'",
3320                    v,
3321                    "CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage"
3322                );
3323                Ok(Unknown(v.to_owned()))
3324            }
3325        }
3326    }
3327}
3328impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3329    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3330        f.write_str(self.as_str())
3331    }
3332}
3333
3334impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3335    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3336        f.write_str(self.as_str())
3337    }
3338}
3339impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
3340    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3341    where
3342        S: serde::Serializer,
3343    {
3344        serializer.serialize_str(self.as_str())
3345    }
3346}
3347#[cfg(feature = "deserialize")]
3348impl<'de> serde::Deserialize<'de>
3349    for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
3350{
3351    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3352        use std::str::FromStr;
3353        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3354        Ok(Self::from_str(&s).expect("infallible"))
3355    }
3356}
3357/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
3358#[derive(Clone, Debug, serde::Serialize)]
3359pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3360    /// Controls when the funds are captured from the customer's account.
3361    ///
3362    /// 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.
3363    ///
3364    /// 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.
3365    #[serde(skip_serializing_if = "Option::is_none")]
3366    pub capture_method:
3367        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
3368    /// An internal identifier or reference that this payment corresponds to.
3369    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
3370    /// This field differs from the statement descriptor and item name.
3371    #[serde(skip_serializing_if = "Option::is_none")]
3372    pub reference: Option<String>,
3373    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3374    ///
3375    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3376    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3377    ///
3378    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3379    ///
3380    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3381    ///
3382    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3383    #[serde(skip_serializing_if = "Option::is_none")]
3384    pub setup_future_usage:
3385        Option<CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
3386}
3387impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3388    pub fn new() -> Self {
3389        Self { capture_method: None, reference: None, setup_future_usage: None }
3390    }
3391}
3392impl Default for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
3393    fn default() -> Self {
3394        Self::new()
3395    }
3396}
3397/// Controls when the funds are captured from the customer's account.
3398///
3399/// 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.
3400///
3401/// 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.
3402#[derive(Clone, Eq, PartialEq)]
3403#[non_exhaustive]
3404pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3405    Manual,
3406    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3407    Unknown(String),
3408}
3409impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3410    pub fn as_str(&self) -> &str {
3411        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
3412        match self {
3413            Manual => "manual",
3414            Unknown(v) => v,
3415        }
3416    }
3417}
3418
3419impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3420    type Err = std::convert::Infallible;
3421    fn from_str(s: &str) -> Result<Self, Self::Err> {
3422        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
3423        match s {
3424            "manual" => Ok(Manual),
3425            v => {
3426                tracing::warn!(
3427                    "Unknown value '{}' for enum '{}'",
3428                    v,
3429                    "CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"
3430                );
3431                Ok(Unknown(v.to_owned()))
3432            }
3433        }
3434    }
3435}
3436impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3438        f.write_str(self.as_str())
3439    }
3440}
3441
3442impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3444        f.write_str(self.as_str())
3445    }
3446}
3447impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
3448    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3449    where
3450        S: serde::Serializer,
3451    {
3452        serializer.serialize_str(self.as_str())
3453    }
3454}
3455#[cfg(feature = "deserialize")]
3456impl<'de> serde::Deserialize<'de>
3457    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
3458{
3459    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3460        use std::str::FromStr;
3461        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3462        Ok(Self::from_str(&s).expect("infallible"))
3463    }
3464}
3465/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3466///
3467/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3468/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3469///
3470/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3471///
3472/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3473///
3474/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3475#[derive(Clone, Eq, PartialEq)]
3476#[non_exhaustive]
3477pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3478    None,
3479    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3480    Unknown(String),
3481}
3482impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3483    pub fn as_str(&self) -> &str {
3484        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3485        match self {
3486            None => "none",
3487            Unknown(v) => v,
3488        }
3489    }
3490}
3491
3492impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3493    type Err = std::convert::Infallible;
3494    fn from_str(s: &str) -> Result<Self, Self::Err> {
3495        use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
3496        match s {
3497            "none" => Ok(None),
3498            v => {
3499                tracing::warn!(
3500                    "Unknown value '{}' for enum '{}'",
3501                    v,
3502                    "CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"
3503                );
3504                Ok(Unknown(v.to_owned()))
3505            }
3506        }
3507    }
3508}
3509impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3510    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3511        f.write_str(self.as_str())
3512    }
3513}
3514
3515impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3516    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3517        f.write_str(self.as_str())
3518    }
3519}
3520impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
3521    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3522    where
3523        S: serde::Serializer,
3524    {
3525        serializer.serialize_str(self.as_str())
3526    }
3527}
3528#[cfg(feature = "deserialize")]
3529impl<'de> serde::Deserialize<'de>
3530    for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
3531{
3532    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3533        use std::str::FromStr;
3534        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3535        Ok(Self::from_str(&s).expect("infallible"))
3536    }
3537}
3538/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
3539#[derive(Clone, Debug, serde::Serialize)]
3540pub struct CreatePaymentIntentPaymentMethodOptionsAlipay {
3541    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3542    ///
3543    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3544    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3545    ///
3546    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3547    ///
3548    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3549    ///
3550    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3551    #[serde(skip_serializing_if = "Option::is_none")]
3552    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
3553}
3554impl CreatePaymentIntentPaymentMethodOptionsAlipay {
3555    pub fn new() -> Self {
3556        Self { setup_future_usage: None }
3557    }
3558}
3559impl Default for CreatePaymentIntentPaymentMethodOptionsAlipay {
3560    fn default() -> Self {
3561        Self::new()
3562    }
3563}
3564/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3565///
3566/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3567/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3568///
3569/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3570///
3571/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3572///
3573/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3574#[derive(Clone, Eq, PartialEq)]
3575#[non_exhaustive]
3576pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3577    None,
3578    OffSession,
3579    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3580    Unknown(String),
3581}
3582impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3583    pub fn as_str(&self) -> &str {
3584        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3585        match self {
3586            None => "none",
3587            OffSession => "off_session",
3588            Unknown(v) => v,
3589        }
3590    }
3591}
3592
3593impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3594    type Err = std::convert::Infallible;
3595    fn from_str(s: &str) -> Result<Self, Self::Err> {
3596        use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
3597        match s {
3598            "none" => Ok(None),
3599            "off_session" => Ok(OffSession),
3600            v => {
3601                tracing::warn!(
3602                    "Unknown value '{}' for enum '{}'",
3603                    v,
3604                    "CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage"
3605                );
3606                Ok(Unknown(v.to_owned()))
3607            }
3608        }
3609    }
3610}
3611impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3612    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3613        f.write_str(self.as_str())
3614    }
3615}
3616
3617impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3618    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3619        f.write_str(self.as_str())
3620    }
3621}
3622impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
3623    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3624    where
3625        S: serde::Serializer,
3626    {
3627        serializer.serialize_str(self.as_str())
3628    }
3629}
3630#[cfg(feature = "deserialize")]
3631impl<'de> serde::Deserialize<'de>
3632    for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
3633{
3634    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3635        use std::str::FromStr;
3636        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3637        Ok(Self::from_str(&s).expect("infallible"))
3638    }
3639}
3640/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
3641#[derive(Clone, Debug, serde::Serialize)]
3642pub struct CreatePaymentIntentPaymentMethodOptionsAlma {
3643    /// Controls when the funds are captured from the customer's account.
3644    ///
3645    /// 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.
3646    ///
3647    /// 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.
3648    #[serde(skip_serializing_if = "Option::is_none")]
3649    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
3650}
3651impl CreatePaymentIntentPaymentMethodOptionsAlma {
3652    pub fn new() -> Self {
3653        Self { capture_method: None }
3654    }
3655}
3656impl Default for CreatePaymentIntentPaymentMethodOptionsAlma {
3657    fn default() -> Self {
3658        Self::new()
3659    }
3660}
3661/// Controls when the funds are captured from the customer's account.
3662///
3663/// 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.
3664///
3665/// 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.
3666#[derive(Clone, Eq, PartialEq)]
3667#[non_exhaustive]
3668pub enum CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3669    Manual,
3670    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3671    Unknown(String),
3672}
3673impl CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3674    pub fn as_str(&self) -> &str {
3675        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3676        match self {
3677            Manual => "manual",
3678            Unknown(v) => v,
3679        }
3680    }
3681}
3682
3683impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3684    type Err = std::convert::Infallible;
3685    fn from_str(s: &str) -> Result<Self, Self::Err> {
3686        use CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
3687        match s {
3688            "manual" => Ok(Manual),
3689            v => {
3690                tracing::warn!(
3691                    "Unknown value '{}' for enum '{}'",
3692                    v,
3693                    "CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod"
3694                );
3695                Ok(Unknown(v.to_owned()))
3696            }
3697        }
3698    }
3699}
3700impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3702        f.write_str(self.as_str())
3703    }
3704}
3705
3706impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3708        f.write_str(self.as_str())
3709    }
3710}
3711impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3712    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3713    where
3714        S: serde::Serializer,
3715    {
3716        serializer.serialize_str(self.as_str())
3717    }
3718}
3719#[cfg(feature = "deserialize")]
3720impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
3721    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3722        use std::str::FromStr;
3723        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3724        Ok(Self::from_str(&s).expect("infallible"))
3725    }
3726}
3727/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
3728#[derive(Clone, Debug, serde::Serialize)]
3729pub struct CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3730    /// Controls when the funds are captured from the customer's account.
3731    ///
3732    /// 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.
3733    ///
3734    /// 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.
3735    #[serde(skip_serializing_if = "Option::is_none")]
3736    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
3737    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3738    ///
3739    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3740    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3741    ///
3742    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3743    ///
3744    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3745    #[serde(skip_serializing_if = "Option::is_none")]
3746    pub setup_future_usage:
3747        Option<CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
3748}
3749impl CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3750    pub fn new() -> Self {
3751        Self { capture_method: None, setup_future_usage: None }
3752    }
3753}
3754impl Default for CreatePaymentIntentPaymentMethodOptionsAmazonPay {
3755    fn default() -> Self {
3756        Self::new()
3757    }
3758}
3759/// Controls when the funds are captured from the customer's account.
3760///
3761/// 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.
3762///
3763/// 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.
3764#[derive(Clone, Eq, PartialEq)]
3765#[non_exhaustive]
3766pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3767    Manual,
3768    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3769    Unknown(String),
3770}
3771impl CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3772    pub fn as_str(&self) -> &str {
3773        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3774        match self {
3775            Manual => "manual",
3776            Unknown(v) => v,
3777        }
3778    }
3779}
3780
3781impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3782    type Err = std::convert::Infallible;
3783    fn from_str(s: &str) -> Result<Self, Self::Err> {
3784        use CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
3785        match s {
3786            "manual" => Ok(Manual),
3787            v => {
3788                tracing::warn!(
3789                    "Unknown value '{}' for enum '{}'",
3790                    v,
3791                    "CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod"
3792                );
3793                Ok(Unknown(v.to_owned()))
3794            }
3795        }
3796    }
3797}
3798impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3799    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3800        f.write_str(self.as_str())
3801    }
3802}
3803
3804impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3806        f.write_str(self.as_str())
3807    }
3808}
3809impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
3810    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3811    where
3812        S: serde::Serializer,
3813    {
3814        serializer.serialize_str(self.as_str())
3815    }
3816}
3817#[cfg(feature = "deserialize")]
3818impl<'de> serde::Deserialize<'de>
3819    for CreatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
3820{
3821    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3822        use std::str::FromStr;
3823        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3824        Ok(Self::from_str(&s).expect("infallible"))
3825    }
3826}
3827/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3828///
3829/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3830/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3831///
3832/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3833///
3834/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3835#[derive(Clone, Eq, PartialEq)]
3836#[non_exhaustive]
3837pub enum CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3838    None,
3839    OffSession,
3840    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3841    Unknown(String),
3842}
3843impl CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3844    pub fn as_str(&self) -> &str {
3845        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3846        match self {
3847            None => "none",
3848            OffSession => "off_session",
3849            Unknown(v) => v,
3850        }
3851    }
3852}
3853
3854impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3855    type Err = std::convert::Infallible;
3856    fn from_str(s: &str) -> Result<Self, Self::Err> {
3857        use CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
3858        match s {
3859            "none" => Ok(None),
3860            "off_session" => Ok(OffSession),
3861            v => {
3862                tracing::warn!(
3863                    "Unknown value '{}' for enum '{}'",
3864                    v,
3865                    "CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"
3866                );
3867                Ok(Unknown(v.to_owned()))
3868            }
3869        }
3870    }
3871}
3872impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3873    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3874        f.write_str(self.as_str())
3875    }
3876}
3877
3878impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3879    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3880        f.write_str(self.as_str())
3881    }
3882}
3883impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
3884    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3885    where
3886        S: serde::Serializer,
3887    {
3888        serializer.serialize_str(self.as_str())
3889    }
3890}
3891#[cfg(feature = "deserialize")]
3892impl<'de> serde::Deserialize<'de>
3893    for CreatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
3894{
3895    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3896        use std::str::FromStr;
3897        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
3898        Ok(Self::from_str(&s).expect("infallible"))
3899    }
3900}
3901/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
3902#[derive(Clone, Debug, serde::Serialize)]
3903pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3904    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3905    ///
3906    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3907    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3908    ///
3909    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3910    ///
3911    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3912    ///
3913    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3914    #[serde(skip_serializing_if = "Option::is_none")]
3915    pub setup_future_usage:
3916        Option<CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
3917    /// Controls when Stripe will attempt to debit the funds from the customer's account.
3918    /// The date must be a string in YYYY-MM-DD format.
3919    /// The date must be in the future and between 3 and 15 calendar days from now.
3920    #[serde(skip_serializing_if = "Option::is_none")]
3921    pub target_date: Option<String>,
3922}
3923impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3924    pub fn new() -> Self {
3925        Self { setup_future_usage: None, target_date: None }
3926    }
3927}
3928impl Default for CreatePaymentIntentPaymentMethodOptionsAuBecsDebit {
3929    fn default() -> Self {
3930        Self::new()
3931    }
3932}
3933/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
3934///
3935/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
3936/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3937///
3938/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3939///
3940/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3941///
3942/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3943#[derive(Clone, Eq, PartialEq)]
3944#[non_exhaustive]
3945pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3946    None,
3947    OffSession,
3948    OnSession,
3949    /// An unrecognized value from Stripe. Should not be used as a request parameter.
3950    Unknown(String),
3951}
3952impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3953    pub fn as_str(&self) -> &str {
3954        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3955        match self {
3956            None => "none",
3957            OffSession => "off_session",
3958            OnSession => "on_session",
3959            Unknown(v) => v,
3960        }
3961    }
3962}
3963
3964impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3965    type Err = std::convert::Infallible;
3966    fn from_str(s: &str) -> Result<Self, Self::Err> {
3967        use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
3968        match s {
3969            "none" => Ok(None),
3970            "off_session" => Ok(OffSession),
3971            "on_session" => Ok(OnSession),
3972            v => {
3973                tracing::warn!(
3974                    "Unknown value '{}' for enum '{}'",
3975                    v,
3976                    "CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"
3977                );
3978                Ok(Unknown(v.to_owned()))
3979            }
3980        }
3981    }
3982}
3983impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3984    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3985        f.write_str(self.as_str())
3986    }
3987}
3988
3989impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3990    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3991        f.write_str(self.as_str())
3992    }
3993}
3994impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
3995    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3996    where
3997        S: serde::Serializer,
3998    {
3999        serializer.serialize_str(self.as_str())
4000    }
4001}
4002#[cfg(feature = "deserialize")]
4003impl<'de> serde::Deserialize<'de>
4004    for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
4005{
4006    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4007        use std::str::FromStr;
4008        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4009        Ok(Self::from_str(&s).expect("infallible"))
4010    }
4011}
4012/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
4013#[derive(Clone, Debug, serde::Serialize)]
4014pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit {
4015    /// Additional fields for Mandate creation
4016    #[serde(skip_serializing_if = "Option::is_none")]
4017    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
4018    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4019    ///
4020    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4021    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4022    ///
4023    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4024    ///
4025    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4026    ///
4027    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4028    #[serde(skip_serializing_if = "Option::is_none")]
4029    pub setup_future_usage:
4030        Option<CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
4031    /// Controls when Stripe will attempt to debit the funds from the customer's account.
4032    /// The date must be a string in YYYY-MM-DD format.
4033    /// The date must be in the future and between 3 and 15 calendar days from now.
4034    #[serde(skip_serializing_if = "Option::is_none")]
4035    pub target_date: Option<String>,
4036}
4037impl CreatePaymentIntentPaymentMethodOptionsBacsDebit {
4038    pub fn new() -> Self {
4039        Self { mandate_options: None, setup_future_usage: None, target_date: None }
4040    }
4041}
4042impl Default for CreatePaymentIntentPaymentMethodOptionsBacsDebit {
4043    fn default() -> Self {
4044        Self::new()
4045    }
4046}
4047/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4048///
4049/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4050/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4051///
4052/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4053///
4054/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4055///
4056/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4057#[derive(Clone, Eq, PartialEq)]
4058#[non_exhaustive]
4059pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
4060    None,
4061    OffSession,
4062    OnSession,
4063    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4064    Unknown(String),
4065}
4066impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
4067    pub fn as_str(&self) -> &str {
4068        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
4069        match self {
4070            None => "none",
4071            OffSession => "off_session",
4072            OnSession => "on_session",
4073            Unknown(v) => v,
4074        }
4075    }
4076}
4077
4078impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
4079    type Err = std::convert::Infallible;
4080    fn from_str(s: &str) -> Result<Self, Self::Err> {
4081        use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
4082        match s {
4083            "none" => Ok(None),
4084            "off_session" => Ok(OffSession),
4085            "on_session" => Ok(OnSession),
4086            v => {
4087                tracing::warn!(
4088                    "Unknown value '{}' for enum '{}'",
4089                    v,
4090                    "CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"
4091                );
4092                Ok(Unknown(v.to_owned()))
4093            }
4094        }
4095    }
4096}
4097impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
4098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4099        f.write_str(self.as_str())
4100    }
4101}
4102
4103impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
4104    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4105        f.write_str(self.as_str())
4106    }
4107}
4108impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
4109    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4110    where
4111        S: serde::Serializer,
4112    {
4113        serializer.serialize_str(self.as_str())
4114    }
4115}
4116#[cfg(feature = "deserialize")]
4117impl<'de> serde::Deserialize<'de>
4118    for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
4119{
4120    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4121        use std::str::FromStr;
4122        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4123        Ok(Self::from_str(&s).expect("infallible"))
4124    }
4125}
4126/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
4127#[derive(Clone, Debug, serde::Serialize)]
4128pub struct CreatePaymentIntentPaymentMethodOptionsBancontact {
4129    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
4130    #[serde(skip_serializing_if = "Option::is_none")]
4131    pub preferred_language:
4132        Option<CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
4133    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4134    ///
4135    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4136    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4137    ///
4138    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4139    ///
4140    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4141    ///
4142    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4143    #[serde(skip_serializing_if = "Option::is_none")]
4144    pub setup_future_usage:
4145        Option<CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
4146}
4147impl CreatePaymentIntentPaymentMethodOptionsBancontact {
4148    pub fn new() -> Self {
4149        Self { preferred_language: None, setup_future_usage: None }
4150    }
4151}
4152impl Default for CreatePaymentIntentPaymentMethodOptionsBancontact {
4153    fn default() -> Self {
4154        Self::new()
4155    }
4156}
4157/// Preferred language of the Bancontact authorization page that the customer is redirected to.
4158#[derive(Clone, Eq, PartialEq)]
4159#[non_exhaustive]
4160pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
4161    De,
4162    En,
4163    Fr,
4164    Nl,
4165    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4166    Unknown(String),
4167}
4168impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
4169    pub fn as_str(&self) -> &str {
4170        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
4171        match self {
4172            De => "de",
4173            En => "en",
4174            Fr => "fr",
4175            Nl => "nl",
4176            Unknown(v) => v,
4177        }
4178    }
4179}
4180
4181impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
4182    type Err = std::convert::Infallible;
4183    fn from_str(s: &str) -> Result<Self, Self::Err> {
4184        use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
4185        match s {
4186            "de" => Ok(De),
4187            "en" => Ok(En),
4188            "fr" => Ok(Fr),
4189            "nl" => Ok(Nl),
4190            v => {
4191                tracing::warn!(
4192                    "Unknown value '{}' for enum '{}'",
4193                    v,
4194                    "CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"
4195                );
4196                Ok(Unknown(v.to_owned()))
4197            }
4198        }
4199    }
4200}
4201impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
4202    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4203        f.write_str(self.as_str())
4204    }
4205}
4206
4207impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
4208    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4209        f.write_str(self.as_str())
4210    }
4211}
4212impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
4213    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4214    where
4215        S: serde::Serializer,
4216    {
4217        serializer.serialize_str(self.as_str())
4218    }
4219}
4220#[cfg(feature = "deserialize")]
4221impl<'de> serde::Deserialize<'de>
4222    for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
4223{
4224    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4225        use std::str::FromStr;
4226        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4227        Ok(Self::from_str(&s).expect("infallible"))
4228    }
4229}
4230/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4231///
4232/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4233/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4234///
4235/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4236///
4237/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4238///
4239/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4240#[derive(Clone, Eq, PartialEq)]
4241#[non_exhaustive]
4242pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4243    None,
4244    OffSession,
4245    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4246    Unknown(String),
4247}
4248impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4249    pub fn as_str(&self) -> &str {
4250        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
4251        match self {
4252            None => "none",
4253            OffSession => "off_session",
4254            Unknown(v) => v,
4255        }
4256    }
4257}
4258
4259impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4260    type Err = std::convert::Infallible;
4261    fn from_str(s: &str) -> Result<Self, Self::Err> {
4262        use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
4263        match s {
4264            "none" => Ok(None),
4265            "off_session" => Ok(OffSession),
4266            v => {
4267                tracing::warn!(
4268                    "Unknown value '{}' for enum '{}'",
4269                    v,
4270                    "CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"
4271                );
4272                Ok(Unknown(v.to_owned()))
4273            }
4274        }
4275    }
4276}
4277impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4278    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4279        f.write_str(self.as_str())
4280    }
4281}
4282
4283impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4285        f.write_str(self.as_str())
4286    }
4287}
4288impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
4289    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4290    where
4291        S: serde::Serializer,
4292    {
4293        serializer.serialize_str(self.as_str())
4294    }
4295}
4296#[cfg(feature = "deserialize")]
4297impl<'de> serde::Deserialize<'de>
4298    for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
4299{
4300    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4301        use std::str::FromStr;
4302        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4303        Ok(Self::from_str(&s).expect("infallible"))
4304    }
4305}
4306/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
4307#[derive(Clone, Debug, serde::Serialize)]
4308pub struct CreatePaymentIntentPaymentMethodOptionsBillie {
4309    /// Controls when the funds are captured from the customer's account.
4310    ///
4311    /// 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.
4312    ///
4313    /// 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.
4314    #[serde(skip_serializing_if = "Option::is_none")]
4315    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
4316}
4317impl CreatePaymentIntentPaymentMethodOptionsBillie {
4318    pub fn new() -> Self {
4319        Self { capture_method: None }
4320    }
4321}
4322impl Default for CreatePaymentIntentPaymentMethodOptionsBillie {
4323    fn default() -> Self {
4324        Self::new()
4325    }
4326}
4327/// Controls when the funds are captured from the customer's account.
4328///
4329/// 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.
4330///
4331/// 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.
4332#[derive(Clone, Eq, PartialEq)]
4333#[non_exhaustive]
4334pub enum CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4335    Manual,
4336    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4337    Unknown(String),
4338}
4339impl CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4340    pub fn as_str(&self) -> &str {
4341        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
4342        match self {
4343            Manual => "manual",
4344            Unknown(v) => v,
4345        }
4346    }
4347}
4348
4349impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4350    type Err = std::convert::Infallible;
4351    fn from_str(s: &str) -> Result<Self, Self::Err> {
4352        use CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
4353        match s {
4354            "manual" => Ok(Manual),
4355            v => {
4356                tracing::warn!(
4357                    "Unknown value '{}' for enum '{}'",
4358                    v,
4359                    "CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod"
4360                );
4361                Ok(Unknown(v.to_owned()))
4362            }
4363        }
4364    }
4365}
4366impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4367    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4368        f.write_str(self.as_str())
4369    }
4370}
4371
4372impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4374        f.write_str(self.as_str())
4375    }
4376}
4377impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4378    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4379    where
4380        S: serde::Serializer,
4381    {
4382        serializer.serialize_str(self.as_str())
4383    }
4384}
4385#[cfg(feature = "deserialize")]
4386impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
4387    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4388        use std::str::FromStr;
4389        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4390        Ok(Self::from_str(&s).expect("infallible"))
4391    }
4392}
4393/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
4394#[derive(Clone, Debug, serde::Serialize)]
4395pub struct CreatePaymentIntentPaymentMethodOptionsBlik {
4396    /// The 6-digit BLIK code that a customer has generated using their banking application.
4397    /// Can only be set on confirmation.
4398    #[serde(skip_serializing_if = "Option::is_none")]
4399    pub code: Option<String>,
4400    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4401    ///
4402    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4403    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4404    ///
4405    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4406    ///
4407    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4408    ///
4409    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4410    #[serde(skip_serializing_if = "Option::is_none")]
4411    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
4412}
4413impl CreatePaymentIntentPaymentMethodOptionsBlik {
4414    pub fn new() -> Self {
4415        Self { code: None, setup_future_usage: None }
4416    }
4417}
4418impl Default for CreatePaymentIntentPaymentMethodOptionsBlik {
4419    fn default() -> Self {
4420        Self::new()
4421    }
4422}
4423/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4424///
4425/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4426/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4427///
4428/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4429///
4430/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4431///
4432/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4433#[derive(Clone, Eq, PartialEq)]
4434#[non_exhaustive]
4435pub enum CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4436    None,
4437    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4438    Unknown(String),
4439}
4440impl CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4441    pub fn as_str(&self) -> &str {
4442        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
4443        match self {
4444            None => "none",
4445            Unknown(v) => v,
4446        }
4447    }
4448}
4449
4450impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4451    type Err = std::convert::Infallible;
4452    fn from_str(s: &str) -> Result<Self, Self::Err> {
4453        use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
4454        match s {
4455            "none" => Ok(None),
4456            v => {
4457                tracing::warn!(
4458                    "Unknown value '{}' for enum '{}'",
4459                    v,
4460                    "CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage"
4461                );
4462                Ok(Unknown(v.to_owned()))
4463            }
4464        }
4465    }
4466}
4467impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4468    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4469        f.write_str(self.as_str())
4470    }
4471}
4472
4473impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4474    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4475        f.write_str(self.as_str())
4476    }
4477}
4478impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4479    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4480    where
4481        S: serde::Serializer,
4482    {
4483        serializer.serialize_str(self.as_str())
4484    }
4485}
4486#[cfg(feature = "deserialize")]
4487impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
4488    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4489        use std::str::FromStr;
4490        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4491        Ok(Self::from_str(&s).expect("infallible"))
4492    }
4493}
4494/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
4495#[derive(Clone, Debug, serde::Serialize)]
4496pub struct CreatePaymentIntentPaymentMethodOptionsBoleto {
4497    /// The number of calendar days before a Boleto voucher expires.
4498    /// 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.
4499    #[serde(skip_serializing_if = "Option::is_none")]
4500    pub expires_after_days: Option<u32>,
4501    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4502    ///
4503    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4504    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4505    ///
4506    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4507    ///
4508    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4509    ///
4510    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4511    #[serde(skip_serializing_if = "Option::is_none")]
4512    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
4513}
4514impl CreatePaymentIntentPaymentMethodOptionsBoleto {
4515    pub fn new() -> Self {
4516        Self { expires_after_days: None, setup_future_usage: None }
4517    }
4518}
4519impl Default for CreatePaymentIntentPaymentMethodOptionsBoleto {
4520    fn default() -> Self {
4521        Self::new()
4522    }
4523}
4524/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4525///
4526/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4527/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4528///
4529/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4530///
4531/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4532///
4533/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4534#[derive(Clone, Eq, PartialEq)]
4535#[non_exhaustive]
4536pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4537    None,
4538    OffSession,
4539    OnSession,
4540    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4541    Unknown(String),
4542}
4543impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4544    pub fn as_str(&self) -> &str {
4545        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
4546        match self {
4547            None => "none",
4548            OffSession => "off_session",
4549            OnSession => "on_session",
4550            Unknown(v) => v,
4551        }
4552    }
4553}
4554
4555impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4556    type Err = std::convert::Infallible;
4557    fn from_str(s: &str) -> Result<Self, Self::Err> {
4558        use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
4559        match s {
4560            "none" => Ok(None),
4561            "off_session" => Ok(OffSession),
4562            "on_session" => Ok(OnSession),
4563            v => {
4564                tracing::warn!(
4565                    "Unknown value '{}' for enum '{}'",
4566                    v,
4567                    "CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage"
4568                );
4569                Ok(Unknown(v.to_owned()))
4570            }
4571        }
4572    }
4573}
4574impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4575    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4576        f.write_str(self.as_str())
4577    }
4578}
4579
4580impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4581    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4582        f.write_str(self.as_str())
4583    }
4584}
4585impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
4586    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4587    where
4588        S: serde::Serializer,
4589    {
4590        serializer.serialize_str(self.as_str())
4591    }
4592}
4593#[cfg(feature = "deserialize")]
4594impl<'de> serde::Deserialize<'de>
4595    for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
4596{
4597    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4598        use std::str::FromStr;
4599        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4600        Ok(Self::from_str(&s).expect("infallible"))
4601    }
4602}
4603/// Configuration for any card payments attempted on this PaymentIntent.
4604#[derive(Clone, Debug, serde::Serialize)]
4605pub struct CreatePaymentIntentPaymentMethodOptionsCard {
4606    /// Controls when the funds are captured from the customer's account.
4607    ///
4608    /// 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.
4609    ///
4610    /// 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.
4611    #[serde(skip_serializing_if = "Option::is_none")]
4612    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
4613    /// A single-use `cvc_update` Token that represents a card CVC value.
4614    /// When provided, the CVC value will be verified during the card payment attempt.
4615    /// This parameter can only be provided during confirmation.
4616    #[serde(skip_serializing_if = "Option::is_none")]
4617    pub cvc_token: Option<String>,
4618    /// Installment configuration for payments attempted on this PaymentIntent.
4619    ///
4620    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4621    #[serde(skip_serializing_if = "Option::is_none")]
4622    pub installments: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallments>,
4623    /// Configuration options for setting up an eMandate for cards issued in India.
4624    #[serde(skip_serializing_if = "Option::is_none")]
4625    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
4626    /// When specified, this parameter indicates that a transaction will be marked
4627    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
4628    /// parameter can only be provided during confirmation.
4629    #[serde(skip_serializing_if = "Option::is_none")]
4630    pub moto: Option<bool>,
4631    /// Selected network to process this PaymentIntent on.
4632    /// Depends on the available networks of the card attached to the PaymentIntent.
4633    /// Can be only set confirm-time.
4634    #[serde(skip_serializing_if = "Option::is_none")]
4635    pub network: Option<CreatePaymentIntentPaymentMethodOptionsCardNetwork>,
4636    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
4637    #[serde(skip_serializing_if = "Option::is_none")]
4638    pub request_extended_authorization:
4639        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
4640    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
4641    #[serde(skip_serializing_if = "Option::is_none")]
4642    pub request_incremental_authorization:
4643        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
4644    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
4645    #[serde(skip_serializing_if = "Option::is_none")]
4646    pub request_multicapture:
4647        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
4648    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
4649    #[serde(skip_serializing_if = "Option::is_none")]
4650    pub request_overcapture: Option<CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
4651    /// 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).
4652    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
4653    /// If not provided, this value defaults to `automatic`.
4654    /// 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.
4655    #[serde(skip_serializing_if = "Option::is_none")]
4656    pub request_three_d_secure:
4657        Option<CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
4658    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
4659    /// using the cvc_token parameter).
4660    #[serde(skip_serializing_if = "Option::is_none")]
4661    pub require_cvc_recollection: Option<bool>,
4662    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
4663    ///
4664    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
4665    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
4666    ///
4667    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
4668    ///
4669    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
4670    ///
4671    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
4672    #[serde(skip_serializing_if = "Option::is_none")]
4673    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
4674    /// Provides information about a card payment that customers see on their statements.
4675    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
4676    /// Maximum 22 characters.
4677    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
4678    #[serde(skip_serializing_if = "Option::is_none")]
4679    pub statement_descriptor_suffix_kana: Option<String>,
4680    /// Provides information about a card payment that customers see on their statements.
4681    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
4682    /// Maximum 17 characters.
4683    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
4684    #[serde(skip_serializing_if = "Option::is_none")]
4685    pub statement_descriptor_suffix_kanji: Option<String>,
4686    /// If 3D Secure authentication was performed with a third-party provider,
4687    /// the authentication details to use for this payment.
4688    #[serde(skip_serializing_if = "Option::is_none")]
4689    pub three_d_secure: Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
4690}
4691impl CreatePaymentIntentPaymentMethodOptionsCard {
4692    pub fn new() -> Self {
4693        Self {
4694            capture_method: None,
4695            cvc_token: None,
4696            installments: None,
4697            mandate_options: None,
4698            moto: None,
4699            network: None,
4700            request_extended_authorization: None,
4701            request_incremental_authorization: None,
4702            request_multicapture: None,
4703            request_overcapture: None,
4704            request_three_d_secure: None,
4705            require_cvc_recollection: None,
4706            setup_future_usage: None,
4707            statement_descriptor_suffix_kana: None,
4708            statement_descriptor_suffix_kanji: None,
4709            three_d_secure: None,
4710        }
4711    }
4712}
4713impl Default for CreatePaymentIntentPaymentMethodOptionsCard {
4714    fn default() -> Self {
4715        Self::new()
4716    }
4717}
4718/// Controls when the funds are captured from the customer's account.
4719///
4720/// 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.
4721///
4722/// 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.
4723#[derive(Clone, Eq, PartialEq)]
4724#[non_exhaustive]
4725pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4726    Manual,
4727    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4728    Unknown(String),
4729}
4730impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4731    pub fn as_str(&self) -> &str {
4732        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4733        match self {
4734            Manual => "manual",
4735            Unknown(v) => v,
4736        }
4737    }
4738}
4739
4740impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4741    type Err = std::convert::Infallible;
4742    fn from_str(s: &str) -> Result<Self, Self::Err> {
4743        use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
4744        match s {
4745            "manual" => Ok(Manual),
4746            v => {
4747                tracing::warn!(
4748                    "Unknown value '{}' for enum '{}'",
4749                    v,
4750                    "CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod"
4751                );
4752                Ok(Unknown(v.to_owned()))
4753            }
4754        }
4755    }
4756}
4757impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4758    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4759        f.write_str(self.as_str())
4760    }
4761}
4762
4763impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4765        f.write_str(self.as_str())
4766    }
4767}
4768impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4769    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4770    where
4771        S: serde::Serializer,
4772    {
4773        serializer.serialize_str(self.as_str())
4774    }
4775}
4776#[cfg(feature = "deserialize")]
4777impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
4778    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4779        use std::str::FromStr;
4780        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4781        Ok(Self::from_str(&s).expect("infallible"))
4782    }
4783}
4784/// Installment configuration for payments attempted on this PaymentIntent.
4785///
4786/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
4787#[derive(Clone, Debug, serde::Serialize)]
4788pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4789    /// Setting to true enables installments for this PaymentIntent.
4790    /// This will cause the response to contain a list of available installment plans.
4791    /// Setting to false will prevent any selected plan from applying to a charge.
4792    #[serde(skip_serializing_if = "Option::is_none")]
4793    pub enabled: Option<bool>,
4794    /// The selected installment plan to use for this payment attempt.
4795    /// This parameter can only be provided during confirmation.
4796    #[serde(skip_serializing_if = "Option::is_none")]
4797    pub plan: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
4798}
4799impl CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4800    pub fn new() -> Self {
4801        Self { enabled: None, plan: None }
4802    }
4803}
4804impl Default for CreatePaymentIntentPaymentMethodOptionsCardInstallments {
4805    fn default() -> Self {
4806        Self::new()
4807    }
4808}
4809/// The selected installment plan to use for this payment attempt.
4810/// This parameter can only be provided during confirmation.
4811#[derive(Clone, Debug, serde::Serialize)]
4812pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4813    /// For `fixed_count` installment plans, this is required.
4814    /// It represents the number of installment payments your customer will make to their credit card.
4815    #[serde(skip_serializing_if = "Option::is_none")]
4816    pub count: Option<u64>,
4817    /// For `fixed_count` installment plans, this is required.
4818    /// It represents the interval between installment payments your customer will make to their credit card.
4819    /// One of `month`.
4820    #[serde(skip_serializing_if = "Option::is_none")]
4821    pub interval: Option<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
4822    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4823    #[serde(rename = "type")]
4824    pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
4825}
4826impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
4827    pub fn new(
4828        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
4829    ) -> Self {
4830        Self { count: None, interval: None, type_: type_.into() }
4831    }
4832}
4833/// For `fixed_count` installment plans, this is required.
4834/// It represents the interval between installment payments your customer will make to their credit card.
4835/// One of `month`.
4836#[derive(Clone, Eq, PartialEq)]
4837#[non_exhaustive]
4838pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4839    Month,
4840    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4841    Unknown(String),
4842}
4843impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4844    pub fn as_str(&self) -> &str {
4845        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4846        match self {
4847            Month => "month",
4848            Unknown(v) => v,
4849        }
4850    }
4851}
4852
4853impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4854    type Err = std::convert::Infallible;
4855    fn from_str(s: &str) -> Result<Self, Self::Err> {
4856        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
4857        match s {
4858            "month" => Ok(Month),
4859            v => {
4860                tracing::warn!(
4861                    "Unknown value '{}' for enum '{}'",
4862                    v,
4863                    "CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"
4864                );
4865                Ok(Unknown(v.to_owned()))
4866            }
4867        }
4868    }
4869}
4870impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4871    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4872        f.write_str(self.as_str())
4873    }
4874}
4875
4876impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4877    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4878        f.write_str(self.as_str())
4879    }
4880}
4881impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
4882    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4883    where
4884        S: serde::Serializer,
4885    {
4886        serializer.serialize_str(self.as_str())
4887    }
4888}
4889#[cfg(feature = "deserialize")]
4890impl<'de> serde::Deserialize<'de>
4891    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
4892{
4893    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4894        use std::str::FromStr;
4895        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4896        Ok(Self::from_str(&s).expect("infallible"))
4897    }
4898}
4899/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4900#[derive(Clone, Eq, PartialEq)]
4901#[non_exhaustive]
4902pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4903    Bonus,
4904    FixedCount,
4905    Revolving,
4906    /// An unrecognized value from Stripe. Should not be used as a request parameter.
4907    Unknown(String),
4908}
4909impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4910    pub fn as_str(&self) -> &str {
4911        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4912        match self {
4913            Bonus => "bonus",
4914            FixedCount => "fixed_count",
4915            Revolving => "revolving",
4916            Unknown(v) => v,
4917        }
4918    }
4919}
4920
4921impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4922    type Err = std::convert::Infallible;
4923    fn from_str(s: &str) -> Result<Self, Self::Err> {
4924        use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
4925        match s {
4926            "bonus" => Ok(Bonus),
4927            "fixed_count" => Ok(FixedCount),
4928            "revolving" => Ok(Revolving),
4929            v => {
4930                tracing::warn!(
4931                    "Unknown value '{}' for enum '{}'",
4932                    v,
4933                    "CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType"
4934                );
4935                Ok(Unknown(v.to_owned()))
4936            }
4937        }
4938    }
4939}
4940impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4941    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4942        f.write_str(self.as_str())
4943    }
4944}
4945
4946impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4947    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
4948        f.write_str(self.as_str())
4949    }
4950}
4951impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
4952    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
4953    where
4954        S: serde::Serializer,
4955    {
4956        serializer.serialize_str(self.as_str())
4957    }
4958}
4959#[cfg(feature = "deserialize")]
4960impl<'de> serde::Deserialize<'de>
4961    for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
4962{
4963    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4964        use std::str::FromStr;
4965        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
4966        Ok(Self::from_str(&s).expect("infallible"))
4967    }
4968}
4969/// Configuration options for setting up an eMandate for cards issued in India.
4970#[derive(Clone, Debug, serde::Serialize)]
4971pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
4972    /// Amount to be charged for future payments.
4973    pub amount: i64,
4974    /// One of `fixed` or `maximum`.
4975    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
4976    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
4977    pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
4978    /// A description of the mandate or subscription that is meant to be displayed to the customer.
4979    #[serde(skip_serializing_if = "Option::is_none")]
4980    pub description: Option<String>,
4981    /// End date of the mandate or subscription.
4982    /// If not provided, the mandate will be active until canceled.
4983    /// If provided, end date should be after start date.
4984    #[serde(skip_serializing_if = "Option::is_none")]
4985    pub end_date: Option<stripe_types::Timestamp>,
4986    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
4987    pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
4988    /// The number of intervals between payments.
4989    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
4990    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
4991    /// This parameter is optional when `interval=sporadic`.
4992    #[serde(skip_serializing_if = "Option::is_none")]
4993    pub interval_count: Option<u64>,
4994    /// Unique identifier for the mandate or subscription.
4995    pub reference: String,
4996    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
4997    pub start_date: stripe_types::Timestamp,
4998    /// Specifies the type of mandates supported. Possible values are `india`.
4999    #[serde(skip_serializing_if = "Option::is_none")]
5000    pub supported_types:
5001        Option<Vec<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
5002}
5003impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {
5004    pub fn new(
5005        amount: impl Into<i64>,
5006        amount_type: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
5007        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
5008        reference: impl Into<String>,
5009        start_date: impl Into<stripe_types::Timestamp>,
5010    ) -> Self {
5011        Self {
5012            amount: amount.into(),
5013            amount_type: amount_type.into(),
5014            description: None,
5015            end_date: None,
5016            interval: interval.into(),
5017            interval_count: None,
5018            reference: reference.into(),
5019            start_date: start_date.into(),
5020            supported_types: None,
5021        }
5022    }
5023}
5024/// One of `fixed` or `maximum`.
5025/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
5026/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
5027#[derive(Clone, Eq, PartialEq)]
5028#[non_exhaustive]
5029pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
5030    Fixed,
5031    Maximum,
5032    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5033    Unknown(String),
5034}
5035impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
5036    pub fn as_str(&self) -> &str {
5037        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
5038        match self {
5039            Fixed => "fixed",
5040            Maximum => "maximum",
5041            Unknown(v) => v,
5042        }
5043    }
5044}
5045
5046impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
5047    type Err = std::convert::Infallible;
5048    fn from_str(s: &str) -> Result<Self, Self::Err> {
5049        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
5050        match s {
5051            "fixed" => Ok(Fixed),
5052            "maximum" => Ok(Maximum),
5053            v => {
5054                tracing::warn!(
5055                    "Unknown value '{}' for enum '{}'",
5056                    v,
5057                    "CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"
5058                );
5059                Ok(Unknown(v.to_owned()))
5060            }
5061        }
5062    }
5063}
5064impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
5065    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5066        f.write_str(self.as_str())
5067    }
5068}
5069
5070impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
5071    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5072        f.write_str(self.as_str())
5073    }
5074}
5075impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
5076    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5077    where
5078        S: serde::Serializer,
5079    {
5080        serializer.serialize_str(self.as_str())
5081    }
5082}
5083#[cfg(feature = "deserialize")]
5084impl<'de> serde::Deserialize<'de>
5085    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
5086{
5087    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5088        use std::str::FromStr;
5089        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5090        Ok(Self::from_str(&s).expect("infallible"))
5091    }
5092}
5093/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
5094#[derive(Clone, Eq, PartialEq)]
5095#[non_exhaustive]
5096pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
5097    Day,
5098    Month,
5099    Sporadic,
5100    Week,
5101    Year,
5102    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5103    Unknown(String),
5104}
5105impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
5106    pub fn as_str(&self) -> &str {
5107        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
5108        match self {
5109            Day => "day",
5110            Month => "month",
5111            Sporadic => "sporadic",
5112            Week => "week",
5113            Year => "year",
5114            Unknown(v) => v,
5115        }
5116    }
5117}
5118
5119impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
5120    type Err = std::convert::Infallible;
5121    fn from_str(s: &str) -> Result<Self, Self::Err> {
5122        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
5123        match s {
5124            "day" => Ok(Day),
5125            "month" => Ok(Month),
5126            "sporadic" => Ok(Sporadic),
5127            "week" => Ok(Week),
5128            "year" => Ok(Year),
5129            v => {
5130                tracing::warn!(
5131                    "Unknown value '{}' for enum '{}'",
5132                    v,
5133                    "CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"
5134                );
5135                Ok(Unknown(v.to_owned()))
5136            }
5137        }
5138    }
5139}
5140impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
5141    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5142        f.write_str(self.as_str())
5143    }
5144}
5145
5146impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
5147    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5148        f.write_str(self.as_str())
5149    }
5150}
5151impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
5152    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5153    where
5154        S: serde::Serializer,
5155    {
5156        serializer.serialize_str(self.as_str())
5157    }
5158}
5159#[cfg(feature = "deserialize")]
5160impl<'de> serde::Deserialize<'de>
5161    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
5162{
5163    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5164        use std::str::FromStr;
5165        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5166        Ok(Self::from_str(&s).expect("infallible"))
5167    }
5168}
5169/// Specifies the type of mandates supported. Possible values are `india`.
5170#[derive(Clone, Eq, PartialEq)]
5171#[non_exhaustive]
5172pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
5173    India,
5174    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5175    Unknown(String),
5176}
5177impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
5178    pub fn as_str(&self) -> &str {
5179        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
5180        match self {
5181            India => "india",
5182            Unknown(v) => v,
5183        }
5184    }
5185}
5186
5187impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
5188    type Err = std::convert::Infallible;
5189    fn from_str(s: &str) -> Result<Self, Self::Err> {
5190        use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
5191        match s {
5192            "india" => Ok(India),
5193            v => {
5194                tracing::warn!(
5195                    "Unknown value '{}' for enum '{}'",
5196                    v,
5197                    "CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
5198                );
5199                Ok(Unknown(v.to_owned()))
5200            }
5201        }
5202    }
5203}
5204impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
5205    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5206        f.write_str(self.as_str())
5207    }
5208}
5209
5210impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
5211    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5212        f.write_str(self.as_str())
5213    }
5214}
5215impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
5216    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5217    where
5218        S: serde::Serializer,
5219    {
5220        serializer.serialize_str(self.as_str())
5221    }
5222}
5223#[cfg(feature = "deserialize")]
5224impl<'de> serde::Deserialize<'de>
5225    for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
5226{
5227    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5228        use std::str::FromStr;
5229        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5230        Ok(Self::from_str(&s).expect("infallible"))
5231    }
5232}
5233/// Selected network to process this PaymentIntent on.
5234/// Depends on the available networks of the card attached to the PaymentIntent.
5235/// Can be only set confirm-time.
5236#[derive(Clone, Eq, PartialEq)]
5237#[non_exhaustive]
5238pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5239    Amex,
5240    CartesBancaires,
5241    Diners,
5242    Discover,
5243    EftposAu,
5244    Girocard,
5245    Interac,
5246    Jcb,
5247    Link,
5248    Mastercard,
5249    Unionpay,
5250    Unknown,
5251    Visa,
5252    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5253    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
5254    _Unknown(String),
5255}
5256impl CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5257    pub fn as_str(&self) -> &str {
5258        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
5259        match self {
5260            Amex => "amex",
5261            CartesBancaires => "cartes_bancaires",
5262            Diners => "diners",
5263            Discover => "discover",
5264            EftposAu => "eftpos_au",
5265            Girocard => "girocard",
5266            Interac => "interac",
5267            Jcb => "jcb",
5268            Link => "link",
5269            Mastercard => "mastercard",
5270            Unionpay => "unionpay",
5271            Unknown => "unknown",
5272            Visa => "visa",
5273            _Unknown(v) => v,
5274        }
5275    }
5276}
5277
5278impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5279    type Err = std::convert::Infallible;
5280    fn from_str(s: &str) -> Result<Self, Self::Err> {
5281        use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*;
5282        match s {
5283            "amex" => Ok(Amex),
5284            "cartes_bancaires" => Ok(CartesBancaires),
5285            "diners" => Ok(Diners),
5286            "discover" => Ok(Discover),
5287            "eftpos_au" => Ok(EftposAu),
5288            "girocard" => Ok(Girocard),
5289            "interac" => Ok(Interac),
5290            "jcb" => Ok(Jcb),
5291            "link" => Ok(Link),
5292            "mastercard" => Ok(Mastercard),
5293            "unionpay" => Ok(Unionpay),
5294            "unknown" => Ok(Unknown),
5295            "visa" => Ok(Visa),
5296            v => {
5297                tracing::warn!(
5298                    "Unknown value '{}' for enum '{}'",
5299                    v,
5300                    "CreatePaymentIntentPaymentMethodOptionsCardNetwork"
5301                );
5302                Ok(_Unknown(v.to_owned()))
5303            }
5304        }
5305    }
5306}
5307impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5308    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5309        f.write_str(self.as_str())
5310    }
5311}
5312
5313impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5315        f.write_str(self.as_str())
5316    }
5317}
5318impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5319    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5320    where
5321        S: serde::Serializer,
5322    {
5323        serializer.serialize_str(self.as_str())
5324    }
5325}
5326#[cfg(feature = "deserialize")]
5327impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardNetwork {
5328    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5329        use std::str::FromStr;
5330        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5331        Ok(Self::from_str(&s).expect("infallible"))
5332    }
5333}
5334/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
5335#[derive(Clone, Eq, PartialEq)]
5336#[non_exhaustive]
5337pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5338    IfAvailable,
5339    Never,
5340    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5341    Unknown(String),
5342}
5343impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5344    pub fn as_str(&self) -> &str {
5345        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
5346        match self {
5347            IfAvailable => "if_available",
5348            Never => "never",
5349            Unknown(v) => v,
5350        }
5351    }
5352}
5353
5354impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5355    type Err = std::convert::Infallible;
5356    fn from_str(s: &str) -> Result<Self, Self::Err> {
5357        use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
5358        match s {
5359            "if_available" => Ok(IfAvailable),
5360            "never" => Ok(Never),
5361            v => {
5362                tracing::warn!(
5363                    "Unknown value '{}' for enum '{}'",
5364                    v,
5365                    "CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"
5366                );
5367                Ok(Unknown(v.to_owned()))
5368            }
5369        }
5370    }
5371}
5372impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5374        f.write_str(self.as_str())
5375    }
5376}
5377
5378impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5379    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5380        f.write_str(self.as_str())
5381    }
5382}
5383impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
5384    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5385    where
5386        S: serde::Serializer,
5387    {
5388        serializer.serialize_str(self.as_str())
5389    }
5390}
5391#[cfg(feature = "deserialize")]
5392impl<'de> serde::Deserialize<'de>
5393    for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
5394{
5395    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5396        use std::str::FromStr;
5397        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5398        Ok(Self::from_str(&s).expect("infallible"))
5399    }
5400}
5401/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
5402#[derive(Clone, Eq, PartialEq)]
5403#[non_exhaustive]
5404pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
5405    IfAvailable,
5406    Never,
5407    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5408    Unknown(String),
5409}
5410impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
5411    pub fn as_str(&self) -> &str {
5412        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
5413        match self {
5414            IfAvailable => "if_available",
5415            Never => "never",
5416            Unknown(v) => v,
5417        }
5418    }
5419}
5420
5421impl std::str::FromStr
5422    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5423{
5424    type Err = std::convert::Infallible;
5425    fn from_str(s: &str) -> Result<Self, Self::Err> {
5426        use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
5427        match s {
5428            "if_available" => Ok(IfAvailable),
5429            "never" => Ok(Never),
5430            v => {
5431                tracing::warn!(
5432                    "Unknown value '{}' for enum '{}'",
5433                    v,
5434                    "CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"
5435                );
5436                Ok(Unknown(v.to_owned()))
5437            }
5438        }
5439    }
5440}
5441impl std::fmt::Display
5442    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5443{
5444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5445        f.write_str(self.as_str())
5446    }
5447}
5448
5449impl std::fmt::Debug
5450    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5451{
5452    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5453        f.write_str(self.as_str())
5454    }
5455}
5456impl serde::Serialize
5457    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5458{
5459    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5460    where
5461        S: serde::Serializer,
5462    {
5463        serializer.serialize_str(self.as_str())
5464    }
5465}
5466#[cfg(feature = "deserialize")]
5467impl<'de> serde::Deserialize<'de>
5468    for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
5469{
5470    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5471        use std::str::FromStr;
5472        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5473        Ok(Self::from_str(&s).expect("infallible"))
5474    }
5475}
5476/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
5477#[derive(Clone, Eq, PartialEq)]
5478#[non_exhaustive]
5479pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5480    IfAvailable,
5481    Never,
5482    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5483    Unknown(String),
5484}
5485impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5486    pub fn as_str(&self) -> &str {
5487        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
5488        match self {
5489            IfAvailable => "if_available",
5490            Never => "never",
5491            Unknown(v) => v,
5492        }
5493    }
5494}
5495
5496impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5497    type Err = std::convert::Infallible;
5498    fn from_str(s: &str) -> Result<Self, Self::Err> {
5499        use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
5500        match s {
5501            "if_available" => Ok(IfAvailable),
5502            "never" => Ok(Never),
5503            v => {
5504                tracing::warn!(
5505                    "Unknown value '{}' for enum '{}'",
5506                    v,
5507                    "CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture"
5508                );
5509                Ok(Unknown(v.to_owned()))
5510            }
5511        }
5512    }
5513}
5514impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5515    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5516        f.write_str(self.as_str())
5517    }
5518}
5519
5520impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5521    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5522        f.write_str(self.as_str())
5523    }
5524}
5525impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
5526    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5527    where
5528        S: serde::Serializer,
5529    {
5530        serializer.serialize_str(self.as_str())
5531    }
5532}
5533#[cfg(feature = "deserialize")]
5534impl<'de> serde::Deserialize<'de>
5535    for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
5536{
5537    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5538        use std::str::FromStr;
5539        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5540        Ok(Self::from_str(&s).expect("infallible"))
5541    }
5542}
5543/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
5544#[derive(Clone, Eq, PartialEq)]
5545#[non_exhaustive]
5546pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5547    IfAvailable,
5548    Never,
5549    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5550    Unknown(String),
5551}
5552impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5553    pub fn as_str(&self) -> &str {
5554        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
5555        match self {
5556            IfAvailable => "if_available",
5557            Never => "never",
5558            Unknown(v) => v,
5559        }
5560    }
5561}
5562
5563impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5564    type Err = std::convert::Infallible;
5565    fn from_str(s: &str) -> Result<Self, Self::Err> {
5566        use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
5567        match s {
5568            "if_available" => Ok(IfAvailable),
5569            "never" => Ok(Never),
5570            v => {
5571                tracing::warn!(
5572                    "Unknown value '{}' for enum '{}'",
5573                    v,
5574                    "CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture"
5575                );
5576                Ok(Unknown(v.to_owned()))
5577            }
5578        }
5579    }
5580}
5581impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5582    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5583        f.write_str(self.as_str())
5584    }
5585}
5586
5587impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5588    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5589        f.write_str(self.as_str())
5590    }
5591}
5592impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
5593    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5594    where
5595        S: serde::Serializer,
5596    {
5597        serializer.serialize_str(self.as_str())
5598    }
5599}
5600#[cfg(feature = "deserialize")]
5601impl<'de> serde::Deserialize<'de>
5602    for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
5603{
5604    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5605        use std::str::FromStr;
5606        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5607        Ok(Self::from_str(&s).expect("infallible"))
5608    }
5609}
5610/// 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).
5611/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
5612/// If not provided, this value defaults to `automatic`.
5613/// 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.
5614#[derive(Clone, Eq, PartialEq)]
5615#[non_exhaustive]
5616pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5617    Any,
5618    Automatic,
5619    Challenge,
5620    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5621    Unknown(String),
5622}
5623impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5624    pub fn as_str(&self) -> &str {
5625        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
5626        match self {
5627            Any => "any",
5628            Automatic => "automatic",
5629            Challenge => "challenge",
5630            Unknown(v) => v,
5631        }
5632    }
5633}
5634
5635impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5636    type Err = std::convert::Infallible;
5637    fn from_str(s: &str) -> Result<Self, Self::Err> {
5638        use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
5639        match s {
5640            "any" => Ok(Any),
5641            "automatic" => Ok(Automatic),
5642            "challenge" => Ok(Challenge),
5643            v => {
5644                tracing::warn!(
5645                    "Unknown value '{}' for enum '{}'",
5646                    v,
5647                    "CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure"
5648                );
5649                Ok(Unknown(v.to_owned()))
5650            }
5651        }
5652    }
5653}
5654impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5656        f.write_str(self.as_str())
5657    }
5658}
5659
5660impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5662        f.write_str(self.as_str())
5663    }
5664}
5665impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
5666    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5667    where
5668        S: serde::Serializer,
5669    {
5670        serializer.serialize_str(self.as_str())
5671    }
5672}
5673#[cfg(feature = "deserialize")]
5674impl<'de> serde::Deserialize<'de>
5675    for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
5676{
5677    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5678        use std::str::FromStr;
5679        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5680        Ok(Self::from_str(&s).expect("infallible"))
5681    }
5682}
5683/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
5684///
5685/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
5686/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5687///
5688/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5689///
5690/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5691///
5692/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
5693#[derive(Clone, Eq, PartialEq)]
5694#[non_exhaustive]
5695pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5696    None,
5697    OffSession,
5698    OnSession,
5699    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5700    Unknown(String),
5701}
5702impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5703    pub fn as_str(&self) -> &str {
5704        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5705        match self {
5706            None => "none",
5707            OffSession => "off_session",
5708            OnSession => "on_session",
5709            Unknown(v) => v,
5710        }
5711    }
5712}
5713
5714impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5715    type Err = std::convert::Infallible;
5716    fn from_str(s: &str) -> Result<Self, Self::Err> {
5717        use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
5718        match s {
5719            "none" => Ok(None),
5720            "off_session" => Ok(OffSession),
5721            "on_session" => Ok(OnSession),
5722            v => {
5723                tracing::warn!(
5724                    "Unknown value '{}' for enum '{}'",
5725                    v,
5726                    "CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage"
5727                );
5728                Ok(Unknown(v.to_owned()))
5729            }
5730        }
5731    }
5732}
5733impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5734    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5735        f.write_str(self.as_str())
5736    }
5737}
5738
5739impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5741        f.write_str(self.as_str())
5742    }
5743}
5744impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5745    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5746    where
5747        S: serde::Serializer,
5748    {
5749        serializer.serialize_str(self.as_str())
5750    }
5751}
5752#[cfg(feature = "deserialize")]
5753impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
5754    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5755        use std::str::FromStr;
5756        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5757        Ok(Self::from_str(&s).expect("infallible"))
5758    }
5759}
5760/// If 3D Secure authentication was performed with a third-party provider,
5761/// the authentication details to use for this payment.
5762#[derive(Clone, Debug, serde::Serialize)]
5763pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5764    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5765    #[serde(skip_serializing_if = "Option::is_none")]
5766    pub ares_trans_status:
5767        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
5768    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
5769    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
5770    /// (Most 3D Secure providers will return the base64-encoded version, which
5771    /// is what you should specify here.)
5772    pub cryptogram: String,
5773    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5774    /// provider and indicates what degree of authentication was performed.
5775    #[serde(skip_serializing_if = "Option::is_none")]
5776    pub electronic_commerce_indicator:
5777        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
5778    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
5779    #[serde(skip_serializing_if = "Option::is_none")]
5780    pub exemption_indicator:
5781        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
5782    /// Network specific 3DS fields. Network specific arguments require an
5783    /// explicit card brand choice. The parameter `payment_method_options.card.network``
5784    /// must be populated accordingly
5785    #[serde(skip_serializing_if = "Option::is_none")]
5786    pub network_options:
5787        Option<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
5788    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
5789    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
5790    #[serde(skip_serializing_if = "Option::is_none")]
5791    pub requestor_challenge_indicator: Option<String>,
5792    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
5793    /// Transaction ID (dsTransID).
5794    pub transaction_id: String,
5795    /// The version of 3D Secure that was performed.
5796    pub version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
5797}
5798impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
5799    pub fn new(
5800        cryptogram: impl Into<String>,
5801        transaction_id: impl Into<String>,
5802        version: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
5803    ) -> Self {
5804        Self {
5805            ares_trans_status: None,
5806            cryptogram: cryptogram.into(),
5807            electronic_commerce_indicator: None,
5808            exemption_indicator: None,
5809            network_options: None,
5810            requestor_challenge_indicator: None,
5811            transaction_id: transaction_id.into(),
5812            version: version.into(),
5813        }
5814    }
5815}
5816/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
5817#[derive(Clone, Eq, PartialEq)]
5818#[non_exhaustive]
5819pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5820    A,
5821    C,
5822    I,
5823    N,
5824    R,
5825    U,
5826    Y,
5827    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5828    Unknown(String),
5829}
5830impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5831    pub fn as_str(&self) -> &str {
5832        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5833        match self {
5834            A => "A",
5835            C => "C",
5836            I => "I",
5837            N => "N",
5838            R => "R",
5839            U => "U",
5840            Y => "Y",
5841            Unknown(v) => v,
5842        }
5843    }
5844}
5845
5846impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5847    type Err = std::convert::Infallible;
5848    fn from_str(s: &str) -> Result<Self, Self::Err> {
5849        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
5850        match s {
5851            "A" => Ok(A),
5852            "C" => Ok(C),
5853            "I" => Ok(I),
5854            "N" => Ok(N),
5855            "R" => Ok(R),
5856            "U" => Ok(U),
5857            "Y" => Ok(Y),
5858            v => {
5859                tracing::warn!(
5860                    "Unknown value '{}' for enum '{}'",
5861                    v,
5862                    "CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
5863                );
5864                Ok(Unknown(v.to_owned()))
5865            }
5866        }
5867    }
5868}
5869impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5871        f.write_str(self.as_str())
5872    }
5873}
5874
5875impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5877        f.write_str(self.as_str())
5878    }
5879}
5880impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
5881    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5882    where
5883        S: serde::Serializer,
5884    {
5885        serializer.serialize_str(self.as_str())
5886    }
5887}
5888#[cfg(feature = "deserialize")]
5889impl<'de> serde::Deserialize<'de>
5890    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
5891{
5892    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5893        use std::str::FromStr;
5894        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5895        Ok(Self::from_str(&s).expect("infallible"))
5896    }
5897}
5898/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
5899/// provider and indicates what degree of authentication was performed.
5900#[derive(Clone, Eq, PartialEq)]
5901#[non_exhaustive]
5902pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5903    V01,
5904    V02,
5905    V05,
5906    V06,
5907    V07,
5908    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5909    Unknown(String),
5910}
5911impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
5912    pub fn as_str(&self) -> &str {
5913        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5914        match self {
5915            V01 => "01",
5916            V02 => "02",
5917            V05 => "05",
5918            V06 => "06",
5919            V07 => "07",
5920            Unknown(v) => v,
5921        }
5922    }
5923}
5924
5925impl std::str::FromStr
5926    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5927{
5928    type Err = std::convert::Infallible;
5929    fn from_str(s: &str) -> Result<Self, Self::Err> {
5930        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
5931        match s {
5932            "01" => Ok(V01),
5933            "02" => Ok(V02),
5934            "05" => Ok(V05),
5935            "06" => Ok(V06),
5936            "07" => Ok(V07),
5937            v => {
5938                tracing::warn!(
5939                    "Unknown value '{}' for enum '{}'",
5940                    v,
5941                    "CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
5942                );
5943                Ok(Unknown(v.to_owned()))
5944            }
5945        }
5946    }
5947}
5948impl std::fmt::Display
5949    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5950{
5951    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5952        f.write_str(self.as_str())
5953    }
5954}
5955
5956impl std::fmt::Debug
5957    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5958{
5959    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
5960        f.write_str(self.as_str())
5961    }
5962}
5963impl serde::Serialize
5964    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5965{
5966    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
5967    where
5968        S: serde::Serializer,
5969    {
5970        serializer.serialize_str(self.as_str())
5971    }
5972}
5973#[cfg(feature = "deserialize")]
5974impl<'de> serde::Deserialize<'de>
5975    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
5976{
5977    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5978        use std::str::FromStr;
5979        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
5980        Ok(Self::from_str(&s).expect("infallible"))
5981    }
5982}
5983/// The exemption requested via 3DS and accepted by the issuer at authentication time.
5984#[derive(Clone, Eq, PartialEq)]
5985#[non_exhaustive]
5986pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5987    LowRisk,
5988    None,
5989    /// An unrecognized value from Stripe. Should not be used as a request parameter.
5990    Unknown(String),
5991}
5992impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
5993    pub fn as_str(&self) -> &str {
5994        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
5995        match self {
5996            LowRisk => "low_risk",
5997            None => "none",
5998            Unknown(v) => v,
5999        }
6000    }
6001}
6002
6003impl std::str::FromStr
6004    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
6005{
6006    type Err = std::convert::Infallible;
6007    fn from_str(s: &str) -> Result<Self, Self::Err> {
6008        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
6009        match s {
6010            "low_risk" => Ok(LowRisk),
6011            "none" => Ok(None),
6012            v => {
6013                tracing::warn!(
6014                    "Unknown value '{}' for enum '{}'",
6015                    v,
6016                    "CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"
6017                );
6018                Ok(Unknown(v.to_owned()))
6019            }
6020        }
6021    }
6022}
6023impl std::fmt::Display
6024    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
6025{
6026    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6027        f.write_str(self.as_str())
6028    }
6029}
6030
6031impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
6032    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6033        f.write_str(self.as_str())
6034    }
6035}
6036impl serde::Serialize
6037    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
6038{
6039    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6040    where
6041        S: serde::Serializer,
6042    {
6043        serializer.serialize_str(self.as_str())
6044    }
6045}
6046#[cfg(feature = "deserialize")]
6047impl<'de> serde::Deserialize<'de>
6048    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
6049{
6050    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6051        use std::str::FromStr;
6052        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6053        Ok(Self::from_str(&s).expect("infallible"))
6054    }
6055}
6056/// Network specific 3DS fields. Network specific arguments require an
6057/// explicit card brand choice. The parameter `payment_method_options.card.network``
6058/// must be populated accordingly
6059#[derive(Clone, Debug, serde::Serialize)]
6060pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
6061    /// Cartes Bancaires-specific 3DS fields.
6062    #[serde(skip_serializing_if = "Option::is_none")]
6063    pub cartes_bancaires: Option<
6064        CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
6065    >,
6066}
6067impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
6068    pub fn new() -> Self {
6069        Self { cartes_bancaires: None }
6070    }
6071}
6072impl Default for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
6073    fn default() -> Self {
6074        Self::new()
6075    }
6076}
6077/// Cartes Bancaires-specific 3DS fields.
6078#[derive(Clone, Debug, serde::Serialize)]
6079pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
6080    /// The cryptogram calculation algorithm used by the card Issuer's ACS
6081    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
6082    /// messageExtension: CB-AVALGO
6083pub cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
6084    /// The exemption indicator returned from Cartes Bancaires in the ARes.
6085    /// message extension: CB-EXEMPTION; string (4 characters)
6086    /// This is a 3 byte bitmap (low significant byte first and most significant
6087    /// bit first) that has been Base64 encoded
6088#[serde(skip_serializing_if = "Option::is_none")]
6089pub cb_exemption: Option<String>,
6090    /// The risk score returned from Cartes Bancaires in the ARes.
6091    /// message extension: CB-SCORE; numeric value 0-99
6092#[serde(skip_serializing_if = "Option::is_none")]
6093pub cb_score: Option<i64>,
6094
6095}
6096impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
6097    pub fn new(
6098        cb_avalgo: impl Into<CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
6099    ) -> Self {
6100        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
6101    }
6102}
6103/// The cryptogram calculation algorithm used by the card Issuer's ACS
6104/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
6105/// messageExtension: CB-AVALGO
6106#[derive(Clone, Eq, PartialEq)]
6107#[non_exhaustive]
6108pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
6109{
6110    V0,
6111    V1,
6112    V2,
6113    V3,
6114    V4,
6115    A,
6116    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6117    Unknown(String),
6118}
6119impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
6120    pub fn as_str(&self) -> &str {
6121        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
6122        match self {
6123            V0 => "0",
6124            V1 => "1",
6125            V2 => "2",
6126            V3 => "3",
6127            V4 => "4",
6128            A => "A",
6129            Unknown(v) => v,
6130        }
6131    }
6132}
6133
6134impl std::str::FromStr
6135    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
6136{
6137    type Err = std::convert::Infallible;
6138    fn from_str(s: &str) -> Result<Self, Self::Err> {
6139        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
6140        match s {
6141            "0" => Ok(V0),
6142            "1" => Ok(V1),
6143            "2" => Ok(V2),
6144            "3" => Ok(V3),
6145            "4" => Ok(V4),
6146            "A" => Ok(A),
6147            v => {
6148                tracing::warn!(
6149                    "Unknown value '{}' for enum '{}'",
6150                    v,
6151                    "CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
6152                );
6153                Ok(Unknown(v.to_owned()))
6154            }
6155        }
6156    }
6157}
6158impl std::fmt::Display
6159    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
6160{
6161    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6162        f.write_str(self.as_str())
6163    }
6164}
6165
6166impl std::fmt::Debug
6167    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
6168{
6169    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6170        f.write_str(self.as_str())
6171    }
6172}
6173impl serde::Serialize
6174    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
6175{
6176    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6177    where
6178        S: serde::Serializer,
6179    {
6180        serializer.serialize_str(self.as_str())
6181    }
6182}
6183#[cfg(feature = "deserialize")]
6184impl<'de> serde::Deserialize<'de>
6185    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
6186{
6187    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6188        use std::str::FromStr;
6189        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6190        Ok(Self::from_str(&s).expect("infallible"))
6191    }
6192}
6193/// The version of 3D Secure that was performed.
6194#[derive(Clone, Eq, PartialEq)]
6195#[non_exhaustive]
6196pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
6197    V1_0_2,
6198    V2_1_0,
6199    V2_2_0,
6200    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6201    Unknown(String),
6202}
6203impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
6204    pub fn as_str(&self) -> &str {
6205        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
6206        match self {
6207            V1_0_2 => "1.0.2",
6208            V2_1_0 => "2.1.0",
6209            V2_2_0 => "2.2.0",
6210            Unknown(v) => v,
6211        }
6212    }
6213}
6214
6215impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
6216    type Err = std::convert::Infallible;
6217    fn from_str(s: &str) -> Result<Self, Self::Err> {
6218        use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
6219        match s {
6220            "1.0.2" => Ok(V1_0_2),
6221            "2.1.0" => Ok(V2_1_0),
6222            "2.2.0" => Ok(V2_2_0),
6223            v => {
6224                tracing::warn!(
6225                    "Unknown value '{}' for enum '{}'",
6226                    v,
6227                    "CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion"
6228                );
6229                Ok(Unknown(v.to_owned()))
6230            }
6231        }
6232    }
6233}
6234impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
6235    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6236        f.write_str(self.as_str())
6237    }
6238}
6239
6240impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
6241    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6242        f.write_str(self.as_str())
6243    }
6244}
6245impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
6246    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6247    where
6248        S: serde::Serializer,
6249    {
6250        serializer.serialize_str(self.as_str())
6251    }
6252}
6253#[cfg(feature = "deserialize")]
6254impl<'de> serde::Deserialize<'de>
6255    for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
6256{
6257    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6258        use std::str::FromStr;
6259        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6260        Ok(Self::from_str(&s).expect("infallible"))
6261    }
6262}
6263/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
6264#[derive(Clone, Debug, serde::Serialize)]
6265pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent {
6266    /// Controls when the funds are captured from the customer's account.
6267    ///
6268    /// 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.
6269    ///
6270    /// 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.
6271    #[serde(skip_serializing_if = "Option::is_none")]
6272    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod>,
6273    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
6274    #[serde(skip_serializing_if = "Option::is_none")]
6275    pub request_extended_authorization: Option<bool>,
6276    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
6277    /// 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.
6278    #[serde(skip_serializing_if = "Option::is_none")]
6279    pub request_incremental_authorization_support: Option<bool>,
6280    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
6281    #[serde(skip_serializing_if = "Option::is_none")]
6282    pub routing: Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
6283}
6284impl CreatePaymentIntentPaymentMethodOptionsCardPresent {
6285    pub fn new() -> Self {
6286        Self {
6287            capture_method: None,
6288            request_extended_authorization: None,
6289            request_incremental_authorization_support: None,
6290            routing: None,
6291        }
6292    }
6293}
6294impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresent {
6295    fn default() -> Self {
6296        Self::new()
6297    }
6298}
6299/// Controls when the funds are captured from the customer's account.
6300///
6301/// 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.
6302///
6303/// 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.
6304#[derive(Clone, Eq, PartialEq)]
6305#[non_exhaustive]
6306pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
6307    Manual,
6308    ManualPreferred,
6309    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6310    Unknown(String),
6311}
6312impl CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
6313    pub fn as_str(&self) -> &str {
6314        use CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
6315        match self {
6316            Manual => "manual",
6317            ManualPreferred => "manual_preferred",
6318            Unknown(v) => v,
6319        }
6320    }
6321}
6322
6323impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
6324    type Err = std::convert::Infallible;
6325    fn from_str(s: &str) -> Result<Self, Self::Err> {
6326        use CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
6327        match s {
6328            "manual" => Ok(Manual),
6329            "manual_preferred" => Ok(ManualPreferred),
6330            v => {
6331                tracing::warn!(
6332                    "Unknown value '{}' for enum '{}'",
6333                    v,
6334                    "CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod"
6335                );
6336                Ok(Unknown(v.to_owned()))
6337            }
6338        }
6339    }
6340}
6341impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
6342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6343        f.write_str(self.as_str())
6344    }
6345}
6346
6347impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
6348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6349        f.write_str(self.as_str())
6350    }
6351}
6352impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
6353    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6354    where
6355        S: serde::Serializer,
6356    {
6357        serializer.serialize_str(self.as_str())
6358    }
6359}
6360#[cfg(feature = "deserialize")]
6361impl<'de> serde::Deserialize<'de>
6362    for CreatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod
6363{
6364    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6365        use std::str::FromStr;
6366        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6367        Ok(Self::from_str(&s).expect("infallible"))
6368    }
6369}
6370/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
6371#[derive(Clone, Debug, serde::Serialize)]
6372pub struct CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
6373    /// Routing requested priority
6374    #[serde(skip_serializing_if = "Option::is_none")]
6375    pub requested_priority:
6376        Option<CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
6377}
6378impl CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
6379    pub fn new() -> Self {
6380        Self { requested_priority: None }
6381    }
6382}
6383impl Default for CreatePaymentIntentPaymentMethodOptionsCardPresentRouting {
6384    fn default() -> Self {
6385        Self::new()
6386    }
6387}
6388/// Routing requested priority
6389#[derive(Clone, Eq, PartialEq)]
6390#[non_exhaustive]
6391pub enum CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
6392    Domestic,
6393    International,
6394    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6395    Unknown(String),
6396}
6397impl CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
6398    pub fn as_str(&self) -> &str {
6399        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
6400        match self {
6401            Domestic => "domestic",
6402            International => "international",
6403            Unknown(v) => v,
6404        }
6405    }
6406}
6407
6408impl std::str::FromStr
6409    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
6410{
6411    type Err = std::convert::Infallible;
6412    fn from_str(s: &str) -> Result<Self, Self::Err> {
6413        use CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
6414        match s {
6415            "domestic" => Ok(Domestic),
6416            "international" => Ok(International),
6417            v => {
6418                tracing::warn!(
6419                    "Unknown value '{}' for enum '{}'",
6420                    v,
6421                    "CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"
6422                );
6423                Ok(Unknown(v.to_owned()))
6424            }
6425        }
6426    }
6427}
6428impl std::fmt::Display
6429    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
6430{
6431    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6432        f.write_str(self.as_str())
6433    }
6434}
6435
6436impl std::fmt::Debug
6437    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
6438{
6439    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6440        f.write_str(self.as_str())
6441    }
6442}
6443impl serde::Serialize
6444    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
6445{
6446    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6447    where
6448        S: serde::Serializer,
6449    {
6450        serializer.serialize_str(self.as_str())
6451    }
6452}
6453#[cfg(feature = "deserialize")]
6454impl<'de> serde::Deserialize<'de>
6455    for CreatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
6456{
6457    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6458        use std::str::FromStr;
6459        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6460        Ok(Self::from_str(&s).expect("infallible"))
6461    }
6462}
6463/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
6464#[derive(Clone, Debug, serde::Serialize)]
6465pub struct CreatePaymentIntentPaymentMethodOptionsCashapp {
6466    /// Controls when the funds are captured from the customer's account.
6467    ///
6468    /// 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.
6469    ///
6470    /// 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.
6471    #[serde(skip_serializing_if = "Option::is_none")]
6472    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
6473    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6474    ///
6475    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6476    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6477    ///
6478    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6479    ///
6480    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6481    ///
6482    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6483    #[serde(skip_serializing_if = "Option::is_none")]
6484    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
6485}
6486impl CreatePaymentIntentPaymentMethodOptionsCashapp {
6487    pub fn new() -> Self {
6488        Self { capture_method: None, setup_future_usage: None }
6489    }
6490}
6491impl Default for CreatePaymentIntentPaymentMethodOptionsCashapp {
6492    fn default() -> Self {
6493        Self::new()
6494    }
6495}
6496/// Controls when the funds are captured from the customer's account.
6497///
6498/// 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.
6499///
6500/// 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.
6501#[derive(Clone, Eq, PartialEq)]
6502#[non_exhaustive]
6503pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6504    Manual,
6505    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6506    Unknown(String),
6507}
6508impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6509    pub fn as_str(&self) -> &str {
6510        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
6511        match self {
6512            Manual => "manual",
6513            Unknown(v) => v,
6514        }
6515    }
6516}
6517
6518impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6519    type Err = std::convert::Infallible;
6520    fn from_str(s: &str) -> Result<Self, Self::Err> {
6521        use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
6522        match s {
6523            "manual" => Ok(Manual),
6524            v => {
6525                tracing::warn!(
6526                    "Unknown value '{}' for enum '{}'",
6527                    v,
6528                    "CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod"
6529                );
6530                Ok(Unknown(v.to_owned()))
6531            }
6532        }
6533    }
6534}
6535impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6536    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6537        f.write_str(self.as_str())
6538    }
6539}
6540
6541impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6542    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6543        f.write_str(self.as_str())
6544    }
6545}
6546impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6547    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6548    where
6549        S: serde::Serializer,
6550    {
6551        serializer.serialize_str(self.as_str())
6552    }
6553}
6554#[cfg(feature = "deserialize")]
6555impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
6556    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6557        use std::str::FromStr;
6558        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6559        Ok(Self::from_str(&s).expect("infallible"))
6560    }
6561}
6562/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6563///
6564/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6565/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6566///
6567/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6568///
6569/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6570///
6571/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6572#[derive(Clone, Eq, PartialEq)]
6573#[non_exhaustive]
6574pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6575    None,
6576    OffSession,
6577    OnSession,
6578    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6579    Unknown(String),
6580}
6581impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6582    pub fn as_str(&self) -> &str {
6583        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
6584        match self {
6585            None => "none",
6586            OffSession => "off_session",
6587            OnSession => "on_session",
6588            Unknown(v) => v,
6589        }
6590    }
6591}
6592
6593impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6594    type Err = std::convert::Infallible;
6595    fn from_str(s: &str) -> Result<Self, Self::Err> {
6596        use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
6597        match s {
6598            "none" => Ok(None),
6599            "off_session" => Ok(OffSession),
6600            "on_session" => Ok(OnSession),
6601            v => {
6602                tracing::warn!(
6603                    "Unknown value '{}' for enum '{}'",
6604                    v,
6605                    "CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage"
6606                );
6607                Ok(Unknown(v.to_owned()))
6608            }
6609        }
6610    }
6611}
6612impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6613    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6614        f.write_str(self.as_str())
6615    }
6616}
6617
6618impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6619    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6620        f.write_str(self.as_str())
6621    }
6622}
6623impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
6624    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6625    where
6626        S: serde::Serializer,
6627    {
6628        serializer.serialize_str(self.as_str())
6629    }
6630}
6631#[cfg(feature = "deserialize")]
6632impl<'de> serde::Deserialize<'de>
6633    for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
6634{
6635    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6636        use std::str::FromStr;
6637        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6638        Ok(Self::from_str(&s).expect("infallible"))
6639    }
6640}
6641/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
6642#[derive(Clone, Debug, serde::Serialize)]
6643pub struct CreatePaymentIntentPaymentMethodOptionsCrypto {
6644    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6645    ///
6646    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6647    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6648    ///
6649    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6650    ///
6651    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6652    ///
6653    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6654    #[serde(skip_serializing_if = "Option::is_none")]
6655    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
6656}
6657impl CreatePaymentIntentPaymentMethodOptionsCrypto {
6658    pub fn new() -> Self {
6659        Self { setup_future_usage: None }
6660    }
6661}
6662impl Default for CreatePaymentIntentPaymentMethodOptionsCrypto {
6663    fn default() -> Self {
6664        Self::new()
6665    }
6666}
6667/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6668///
6669/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6670/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6671///
6672/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6673///
6674/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6675///
6676/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6677#[derive(Clone, Eq, PartialEq)]
6678#[non_exhaustive]
6679pub enum CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6680    None,
6681    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6682    Unknown(String),
6683}
6684impl CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6685    pub fn as_str(&self) -> &str {
6686        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
6687        match self {
6688            None => "none",
6689            Unknown(v) => v,
6690        }
6691    }
6692}
6693
6694impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6695    type Err = std::convert::Infallible;
6696    fn from_str(s: &str) -> Result<Self, Self::Err> {
6697        use CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
6698        match s {
6699            "none" => Ok(None),
6700            v => {
6701                tracing::warn!(
6702                    "Unknown value '{}' for enum '{}'",
6703                    v,
6704                    "CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage"
6705                );
6706                Ok(Unknown(v.to_owned()))
6707            }
6708        }
6709    }
6710}
6711impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6712    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6713        f.write_str(self.as_str())
6714    }
6715}
6716
6717impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6718    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6719        f.write_str(self.as_str())
6720    }
6721}
6722impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
6723    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6724    where
6725        S: serde::Serializer,
6726    {
6727        serializer.serialize_str(self.as_str())
6728    }
6729}
6730#[cfg(feature = "deserialize")]
6731impl<'de> serde::Deserialize<'de>
6732    for CreatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
6733{
6734    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6735        use std::str::FromStr;
6736        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6737        Ok(Self::from_str(&s).expect("infallible"))
6738    }
6739}
6740/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
6741#[derive(Clone, Debug, serde::Serialize)]
6742pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6743    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
6744    #[serde(skip_serializing_if = "Option::is_none")]
6745    pub bank_transfer: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
6746    /// The funding method type to be used when there are not enough funds in the customer balance.
6747    /// Permitted values include: `bank_transfer`.
6748    #[serde(skip_serializing_if = "Option::is_none")]
6749    pub funding_type: Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
6750    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
6751    ///
6752    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
6753    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6754    ///
6755    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6756    ///
6757    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6758    ///
6759    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6760    #[serde(skip_serializing_if = "Option::is_none")]
6761    pub setup_future_usage:
6762        Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
6763}
6764impl CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6765    pub fn new() -> Self {
6766        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
6767    }
6768}
6769impl Default for CreatePaymentIntentPaymentMethodOptionsCustomerBalance {
6770    fn default() -> Self {
6771        Self::new()
6772    }
6773}
6774/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
6775#[derive(Clone, Debug, serde::Serialize)]
6776pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
6777    /// Configuration for the eu_bank_transfer funding type.
6778    #[serde(skip_serializing_if = "Option::is_none")]
6779    pub eu_bank_transfer: Option<EuBankTransferParams>,
6780    /// List of address types that should be returned in the financial_addresses response.
6781    /// If not specified, all valid types will be returned.
6782    ///
6783    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
6784    #[serde(skip_serializing_if = "Option::is_none")]
6785    pub requested_address_types: Option<
6786        Vec<
6787            CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
6788        >,
6789    >,
6790    /// 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`.
6791    #[serde(rename = "type")]
6792    pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
6793}
6794impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
6795    pub fn new(
6796        type_: impl Into<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
6797    ) -> Self {
6798        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
6799    }
6800}
6801/// List of address types that should be returned in the financial_addresses response.
6802/// If not specified, all valid types will be returned.
6803///
6804/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
6805#[derive(Clone, Eq, PartialEq)]
6806#[non_exhaustive]
6807pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
6808    Aba,
6809    Iban,
6810    Sepa,
6811    SortCode,
6812    Spei,
6813    Swift,
6814    Zengin,
6815    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6816    Unknown(String),
6817}
6818impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
6819    pub fn as_str(&self) -> &str {
6820        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
6821        match self {
6822            Aba => "aba",
6823            Iban => "iban",
6824            Sepa => "sepa",
6825            SortCode => "sort_code",
6826            Spei => "spei",
6827            Swift => "swift",
6828            Zengin => "zengin",
6829            Unknown(v) => v,
6830        }
6831    }
6832}
6833
6834impl std::str::FromStr
6835    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6836{
6837    type Err = std::convert::Infallible;
6838    fn from_str(s: &str) -> Result<Self, Self::Err> {
6839        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
6840        match s {
6841            "aba" => Ok(Aba),
6842            "iban" => Ok(Iban),
6843            "sepa" => Ok(Sepa),
6844            "sort_code" => Ok(SortCode),
6845            "spei" => Ok(Spei),
6846            "swift" => Ok(Swift),
6847            "zengin" => Ok(Zengin),
6848            v => {
6849                tracing::warn!(
6850                    "Unknown value '{}' for enum '{}'",
6851                    v,
6852                    "CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"
6853                );
6854                Ok(Unknown(v.to_owned()))
6855            }
6856        }
6857    }
6858}
6859impl std::fmt::Display
6860    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6861{
6862    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6863        f.write_str(self.as_str())
6864    }
6865}
6866
6867impl std::fmt::Debug
6868    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6869{
6870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6871        f.write_str(self.as_str())
6872    }
6873}
6874impl serde::Serialize
6875    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6876{
6877    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6878    where
6879        S: serde::Serializer,
6880    {
6881        serializer.serialize_str(self.as_str())
6882    }
6883}
6884#[cfg(feature = "deserialize")]
6885impl<'de> serde::Deserialize<'de>
6886    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
6887{
6888    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6889        use std::str::FromStr;
6890        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6891        Ok(Self::from_str(&s).expect("infallible"))
6892    }
6893}
6894/// 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`.
6895#[derive(Clone, Eq, PartialEq)]
6896#[non_exhaustive]
6897pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6898    EuBankTransfer,
6899    GbBankTransfer,
6900    JpBankTransfer,
6901    MxBankTransfer,
6902    UsBankTransfer,
6903    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6904    Unknown(String),
6905}
6906impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6907    pub fn as_str(&self) -> &str {
6908        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6909        match self {
6910            EuBankTransfer => "eu_bank_transfer",
6911            GbBankTransfer => "gb_bank_transfer",
6912            JpBankTransfer => "jp_bank_transfer",
6913            MxBankTransfer => "mx_bank_transfer",
6914            UsBankTransfer => "us_bank_transfer",
6915            Unknown(v) => v,
6916        }
6917    }
6918}
6919
6920impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6921    type Err = std::convert::Infallible;
6922    fn from_str(s: &str) -> Result<Self, Self::Err> {
6923        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
6924        match s {
6925            "eu_bank_transfer" => Ok(EuBankTransfer),
6926            "gb_bank_transfer" => Ok(GbBankTransfer),
6927            "jp_bank_transfer" => Ok(JpBankTransfer),
6928            "mx_bank_transfer" => Ok(MxBankTransfer),
6929            "us_bank_transfer" => Ok(UsBankTransfer),
6930            v => {
6931                tracing::warn!(
6932                    "Unknown value '{}' for enum '{}'",
6933                    v,
6934                    "CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"
6935                );
6936                Ok(Unknown(v.to_owned()))
6937            }
6938        }
6939    }
6940}
6941impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6942    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6943        f.write_str(self.as_str())
6944    }
6945}
6946
6947impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6948    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6949        f.write_str(self.as_str())
6950    }
6951}
6952impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
6953    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
6954    where
6955        S: serde::Serializer,
6956    {
6957        serializer.serialize_str(self.as_str())
6958    }
6959}
6960#[cfg(feature = "deserialize")]
6961impl<'de> serde::Deserialize<'de>
6962    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
6963{
6964    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6965        use std::str::FromStr;
6966        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
6967        Ok(Self::from_str(&s).expect("infallible"))
6968    }
6969}
6970/// The funding method type to be used when there are not enough funds in the customer balance.
6971/// Permitted values include: `bank_transfer`.
6972#[derive(Clone, Eq, PartialEq)]
6973#[non_exhaustive]
6974pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6975    BankTransfer,
6976    /// An unrecognized value from Stripe. Should not be used as a request parameter.
6977    Unknown(String),
6978}
6979impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6980    pub fn as_str(&self) -> &str {
6981        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6982        match self {
6983            BankTransfer => "bank_transfer",
6984            Unknown(v) => v,
6985        }
6986    }
6987}
6988
6989impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
6990    type Err = std::convert::Infallible;
6991    fn from_str(s: &str) -> Result<Self, Self::Err> {
6992        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
6993        match s {
6994            "bank_transfer" => Ok(BankTransfer),
6995            v => {
6996                tracing::warn!(
6997                    "Unknown value '{}' for enum '{}'",
6998                    v,
6999                    "CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"
7000                );
7001                Ok(Unknown(v.to_owned()))
7002            }
7003        }
7004    }
7005}
7006impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
7007    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7008        f.write_str(self.as_str())
7009    }
7010}
7011
7012impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
7013    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7014        f.write_str(self.as_str())
7015    }
7016}
7017impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
7018    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7019    where
7020        S: serde::Serializer,
7021    {
7022        serializer.serialize_str(self.as_str())
7023    }
7024}
7025#[cfg(feature = "deserialize")]
7026impl<'de> serde::Deserialize<'de>
7027    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
7028{
7029    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7030        use std::str::FromStr;
7031        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7032        Ok(Self::from_str(&s).expect("infallible"))
7033    }
7034}
7035/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7036///
7037/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7038/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7039///
7040/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7041///
7042/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7043///
7044/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7045#[derive(Clone, Eq, PartialEq)]
7046#[non_exhaustive]
7047pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7048    None,
7049    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7050    Unknown(String),
7051}
7052impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7053    pub fn as_str(&self) -> &str {
7054        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
7055        match self {
7056            None => "none",
7057            Unknown(v) => v,
7058        }
7059    }
7060}
7061
7062impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7063    type Err = std::convert::Infallible;
7064    fn from_str(s: &str) -> Result<Self, Self::Err> {
7065        use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
7066        match s {
7067            "none" => Ok(None),
7068            v => {
7069                tracing::warn!(
7070                    "Unknown value '{}' for enum '{}'",
7071                    v,
7072                    "CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"
7073                );
7074                Ok(Unknown(v.to_owned()))
7075            }
7076        }
7077    }
7078}
7079impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7080    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7081        f.write_str(self.as_str())
7082    }
7083}
7084
7085impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7086    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7087        f.write_str(self.as_str())
7088    }
7089}
7090impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
7091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7092    where
7093        S: serde::Serializer,
7094    {
7095        serializer.serialize_str(self.as_str())
7096    }
7097}
7098#[cfg(feature = "deserialize")]
7099impl<'de> serde::Deserialize<'de>
7100    for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
7101{
7102    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7103        use std::str::FromStr;
7104        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7105        Ok(Self::from_str(&s).expect("infallible"))
7106    }
7107}
7108/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
7109#[derive(Clone, Debug, serde::Serialize)]
7110pub struct CreatePaymentIntentPaymentMethodOptionsEps {
7111    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7112    ///
7113    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7114    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7115    ///
7116    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7117    ///
7118    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7119    ///
7120    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7121    #[serde(skip_serializing_if = "Option::is_none")]
7122    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
7123}
7124impl CreatePaymentIntentPaymentMethodOptionsEps {
7125    pub fn new() -> Self {
7126        Self { setup_future_usage: None }
7127    }
7128}
7129impl Default for CreatePaymentIntentPaymentMethodOptionsEps {
7130    fn default() -> Self {
7131        Self::new()
7132    }
7133}
7134/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7135///
7136/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7137/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7138///
7139/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7140///
7141/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7142///
7143/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7144#[derive(Clone, Eq, PartialEq)]
7145#[non_exhaustive]
7146pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7147    None,
7148    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7149    Unknown(String),
7150}
7151impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7152    pub fn as_str(&self) -> &str {
7153        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
7154        match self {
7155            None => "none",
7156            Unknown(v) => v,
7157        }
7158    }
7159}
7160
7161impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7162    type Err = std::convert::Infallible;
7163    fn from_str(s: &str) -> Result<Self, Self::Err> {
7164        use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
7165        match s {
7166            "none" => Ok(None),
7167            v => {
7168                tracing::warn!(
7169                    "Unknown value '{}' for enum '{}'",
7170                    v,
7171                    "CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage"
7172                );
7173                Ok(Unknown(v.to_owned()))
7174            }
7175        }
7176    }
7177}
7178impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7179    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7180        f.write_str(self.as_str())
7181    }
7182}
7183
7184impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7185    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7186        f.write_str(self.as_str())
7187    }
7188}
7189impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7190    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7191    where
7192        S: serde::Serializer,
7193    {
7194        serializer.serialize_str(self.as_str())
7195    }
7196}
7197#[cfg(feature = "deserialize")]
7198impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
7199    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7200        use std::str::FromStr;
7201        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7202        Ok(Self::from_str(&s).expect("infallible"))
7203    }
7204}
7205/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
7206#[derive(Clone, Debug, serde::Serialize)]
7207pub struct CreatePaymentIntentPaymentMethodOptionsFpx {
7208    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7209    ///
7210    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7211    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7212    ///
7213    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7214    ///
7215    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7216    ///
7217    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7218    #[serde(skip_serializing_if = "Option::is_none")]
7219    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
7220}
7221impl CreatePaymentIntentPaymentMethodOptionsFpx {
7222    pub fn new() -> Self {
7223        Self { setup_future_usage: None }
7224    }
7225}
7226impl Default for CreatePaymentIntentPaymentMethodOptionsFpx {
7227    fn default() -> Self {
7228        Self::new()
7229    }
7230}
7231/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7232///
7233/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7234/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7235///
7236/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7237///
7238/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7239///
7240/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7241#[derive(Clone, Eq, PartialEq)]
7242#[non_exhaustive]
7243pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7244    None,
7245    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7246    Unknown(String),
7247}
7248impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7249    pub fn as_str(&self) -> &str {
7250        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
7251        match self {
7252            None => "none",
7253            Unknown(v) => v,
7254        }
7255    }
7256}
7257
7258impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7259    type Err = std::convert::Infallible;
7260    fn from_str(s: &str) -> Result<Self, Self::Err> {
7261        use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
7262        match s {
7263            "none" => Ok(None),
7264            v => {
7265                tracing::warn!(
7266                    "Unknown value '{}' for enum '{}'",
7267                    v,
7268                    "CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage"
7269                );
7270                Ok(Unknown(v.to_owned()))
7271            }
7272        }
7273    }
7274}
7275impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7276    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7277        f.write_str(self.as_str())
7278    }
7279}
7280
7281impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7282    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7283        f.write_str(self.as_str())
7284    }
7285}
7286impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7287    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7288    where
7289        S: serde::Serializer,
7290    {
7291        serializer.serialize_str(self.as_str())
7292    }
7293}
7294#[cfg(feature = "deserialize")]
7295impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
7296    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7297        use std::str::FromStr;
7298        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7299        Ok(Self::from_str(&s).expect("infallible"))
7300    }
7301}
7302/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
7303#[derive(Clone, Debug, serde::Serialize)]
7304pub struct CreatePaymentIntentPaymentMethodOptionsGiropay {
7305    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7306    ///
7307    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7308    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7309    ///
7310    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7311    ///
7312    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7313    ///
7314    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7315    #[serde(skip_serializing_if = "Option::is_none")]
7316    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
7317}
7318impl CreatePaymentIntentPaymentMethodOptionsGiropay {
7319    pub fn new() -> Self {
7320        Self { setup_future_usage: None }
7321    }
7322}
7323impl Default for CreatePaymentIntentPaymentMethodOptionsGiropay {
7324    fn default() -> Self {
7325        Self::new()
7326    }
7327}
7328/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7329///
7330/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7331/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7332///
7333/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7334///
7335/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7336///
7337/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7338#[derive(Clone, Eq, PartialEq)]
7339#[non_exhaustive]
7340pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
7341    None,
7342    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7343    Unknown(String),
7344}
7345impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
7346    pub fn as_str(&self) -> &str {
7347        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
7348        match self {
7349            None => "none",
7350            Unknown(v) => v,
7351        }
7352    }
7353}
7354
7355impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
7356    type Err = std::convert::Infallible;
7357    fn from_str(s: &str) -> Result<Self, Self::Err> {
7358        use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
7359        match s {
7360            "none" => Ok(None),
7361            v => {
7362                tracing::warn!(
7363                    "Unknown value '{}' for enum '{}'",
7364                    v,
7365                    "CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage"
7366                );
7367                Ok(Unknown(v.to_owned()))
7368            }
7369        }
7370    }
7371}
7372impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
7373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7374        f.write_str(self.as_str())
7375    }
7376}
7377
7378impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
7379    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7380        f.write_str(self.as_str())
7381    }
7382}
7383impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
7384    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7385    where
7386        S: serde::Serializer,
7387    {
7388        serializer.serialize_str(self.as_str())
7389    }
7390}
7391#[cfg(feature = "deserialize")]
7392impl<'de> serde::Deserialize<'de>
7393    for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
7394{
7395    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7396        use std::str::FromStr;
7397        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7398        Ok(Self::from_str(&s).expect("infallible"))
7399    }
7400}
7401/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
7402#[derive(Clone, Debug, serde::Serialize)]
7403pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay {
7404    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7405    ///
7406    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7407    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7408    ///
7409    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7410    ///
7411    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7412    ///
7413    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7414    #[serde(skip_serializing_if = "Option::is_none")]
7415    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
7416}
7417impl CreatePaymentIntentPaymentMethodOptionsGrabpay {
7418    pub fn new() -> Self {
7419        Self { setup_future_usage: None }
7420    }
7421}
7422impl Default for CreatePaymentIntentPaymentMethodOptionsGrabpay {
7423    fn default() -> Self {
7424        Self::new()
7425    }
7426}
7427/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7428///
7429/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7430/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7431///
7432/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7433///
7434/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7435///
7436/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7437#[derive(Clone, Eq, PartialEq)]
7438#[non_exhaustive]
7439pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
7440    None,
7441    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7442    Unknown(String),
7443}
7444impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
7445    pub fn as_str(&self) -> &str {
7446        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
7447        match self {
7448            None => "none",
7449            Unknown(v) => v,
7450        }
7451    }
7452}
7453
7454impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
7455    type Err = std::convert::Infallible;
7456    fn from_str(s: &str) -> Result<Self, Self::Err> {
7457        use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
7458        match s {
7459            "none" => Ok(None),
7460            v => {
7461                tracing::warn!(
7462                    "Unknown value '{}' for enum '{}'",
7463                    v,
7464                    "CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage"
7465                );
7466                Ok(Unknown(v.to_owned()))
7467            }
7468        }
7469    }
7470}
7471impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
7472    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7473        f.write_str(self.as_str())
7474    }
7475}
7476
7477impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
7478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7479        f.write_str(self.as_str())
7480    }
7481}
7482impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
7483    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7484    where
7485        S: serde::Serializer,
7486    {
7487        serializer.serialize_str(self.as_str())
7488    }
7489}
7490#[cfg(feature = "deserialize")]
7491impl<'de> serde::Deserialize<'de>
7492    for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
7493{
7494    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7495        use std::str::FromStr;
7496        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7497        Ok(Self::from_str(&s).expect("infallible"))
7498    }
7499}
7500/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
7501#[derive(Clone, Debug, serde::Serialize)]
7502pub struct CreatePaymentIntentPaymentMethodOptionsIdeal {
7503    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7504    ///
7505    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7506    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7507    ///
7508    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7509    ///
7510    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7511    ///
7512    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7513    #[serde(skip_serializing_if = "Option::is_none")]
7514    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
7515}
7516impl CreatePaymentIntentPaymentMethodOptionsIdeal {
7517    pub fn new() -> Self {
7518        Self { setup_future_usage: None }
7519    }
7520}
7521impl Default for CreatePaymentIntentPaymentMethodOptionsIdeal {
7522    fn default() -> Self {
7523        Self::new()
7524    }
7525}
7526/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7527///
7528/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7529/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7530///
7531/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7532///
7533/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7534///
7535/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7536#[derive(Clone, Eq, PartialEq)]
7537#[non_exhaustive]
7538pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7539    None,
7540    OffSession,
7541    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7542    Unknown(String),
7543}
7544impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7545    pub fn as_str(&self) -> &str {
7546        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
7547        match self {
7548            None => "none",
7549            OffSession => "off_session",
7550            Unknown(v) => v,
7551        }
7552    }
7553}
7554
7555impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7556    type Err = std::convert::Infallible;
7557    fn from_str(s: &str) -> Result<Self, Self::Err> {
7558        use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
7559        match s {
7560            "none" => Ok(None),
7561            "off_session" => Ok(OffSession),
7562            v => {
7563                tracing::warn!(
7564                    "Unknown value '{}' for enum '{}'",
7565                    v,
7566                    "CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage"
7567                );
7568                Ok(Unknown(v.to_owned()))
7569            }
7570        }
7571    }
7572}
7573impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7574    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7575        f.write_str(self.as_str())
7576    }
7577}
7578
7579impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7580    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7581        f.write_str(self.as_str())
7582    }
7583}
7584impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7585    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7586    where
7587        S: serde::Serializer,
7588    {
7589        serializer.serialize_str(self.as_str())
7590    }
7591}
7592#[cfg(feature = "deserialize")]
7593impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
7594    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7595        use std::str::FromStr;
7596        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7597        Ok(Self::from_str(&s).expect("infallible"))
7598    }
7599}
7600/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
7601#[derive(Clone, Debug, serde::Serialize)]
7602pub struct CreatePaymentIntentPaymentMethodOptionsKakaoPay {
7603    /// Controls when the funds are captured from the customer's account.
7604    ///
7605    /// 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.
7606    ///
7607    /// 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.
7608    #[serde(skip_serializing_if = "Option::is_none")]
7609    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
7610    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7611    ///
7612    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7613    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7614    ///
7615    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7616    ///
7617    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7618    #[serde(skip_serializing_if = "Option::is_none")]
7619    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
7620}
7621impl CreatePaymentIntentPaymentMethodOptionsKakaoPay {
7622    pub fn new() -> Self {
7623        Self { capture_method: None, setup_future_usage: None }
7624    }
7625}
7626impl Default for CreatePaymentIntentPaymentMethodOptionsKakaoPay {
7627    fn default() -> Self {
7628        Self::new()
7629    }
7630}
7631/// Controls when the funds are captured from the customer's account.
7632///
7633/// 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.
7634///
7635/// 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.
7636#[derive(Clone, Eq, PartialEq)]
7637#[non_exhaustive]
7638pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7639    Manual,
7640    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7641    Unknown(String),
7642}
7643impl CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7644    pub fn as_str(&self) -> &str {
7645        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
7646        match self {
7647            Manual => "manual",
7648            Unknown(v) => v,
7649        }
7650    }
7651}
7652
7653impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7654    type Err = std::convert::Infallible;
7655    fn from_str(s: &str) -> Result<Self, Self::Err> {
7656        use CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
7657        match s {
7658            "manual" => Ok(Manual),
7659            v => {
7660                tracing::warn!(
7661                    "Unknown value '{}' for enum '{}'",
7662                    v,
7663                    "CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod"
7664                );
7665                Ok(Unknown(v.to_owned()))
7666            }
7667        }
7668    }
7669}
7670impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7672        f.write_str(self.as_str())
7673    }
7674}
7675
7676impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7677    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7678        f.write_str(self.as_str())
7679    }
7680}
7681impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7682    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7683    where
7684        S: serde::Serializer,
7685    {
7686        serializer.serialize_str(self.as_str())
7687    }
7688}
7689#[cfg(feature = "deserialize")]
7690impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
7691    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7692        use std::str::FromStr;
7693        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7694        Ok(Self::from_str(&s).expect("infallible"))
7695    }
7696}
7697/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7698///
7699/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7700/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7701///
7702/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7703///
7704/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7705#[derive(Clone, Eq, PartialEq)]
7706#[non_exhaustive]
7707pub enum CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7708    None,
7709    OffSession,
7710    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7711    Unknown(String),
7712}
7713impl CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7714    pub fn as_str(&self) -> &str {
7715        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
7716        match self {
7717            None => "none",
7718            OffSession => "off_session",
7719            Unknown(v) => v,
7720        }
7721    }
7722}
7723
7724impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7725    type Err = std::convert::Infallible;
7726    fn from_str(s: &str) -> Result<Self, Self::Err> {
7727        use CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
7728        match s {
7729            "none" => Ok(None),
7730            "off_session" => Ok(OffSession),
7731            v => {
7732                tracing::warn!(
7733                    "Unknown value '{}' for enum '{}'",
7734                    v,
7735                    "CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage"
7736                );
7737                Ok(Unknown(v.to_owned()))
7738            }
7739        }
7740    }
7741}
7742impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7743    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7744        f.write_str(self.as_str())
7745    }
7746}
7747
7748impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7749    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7750        f.write_str(self.as_str())
7751    }
7752}
7753impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
7754    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7755    where
7756        S: serde::Serializer,
7757    {
7758        serializer.serialize_str(self.as_str())
7759    }
7760}
7761#[cfg(feature = "deserialize")]
7762impl<'de> serde::Deserialize<'de>
7763    for CreatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
7764{
7765    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7766        use std::str::FromStr;
7767        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7768        Ok(Self::from_str(&s).expect("infallible"))
7769    }
7770}
7771/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
7772#[derive(Clone, Debug, serde::Serialize)]
7773pub struct CreatePaymentIntentPaymentMethodOptionsKlarna {
7774    /// Controls when the funds are captured from the customer's account.
7775    ///
7776    /// 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.
7777    ///
7778    /// 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.
7779    #[serde(skip_serializing_if = "Option::is_none")]
7780    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
7781    /// On-demand details if setting up or charging an on-demand payment.
7782    #[serde(skip_serializing_if = "Option::is_none")]
7783    pub on_demand: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
7784    /// Preferred language of the Klarna authorization page that the customer is redirected to
7785    #[serde(skip_serializing_if = "Option::is_none")]
7786    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
7787    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
7788    ///
7789    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
7790    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7791    ///
7792    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7793    ///
7794    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7795    ///
7796    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7797    #[serde(skip_serializing_if = "Option::is_none")]
7798    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
7799    /// Subscription details if setting up or charging a subscription.
7800    #[serde(skip_serializing_if = "Option::is_none")]
7801    pub subscriptions: Option<Vec<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
7802}
7803impl CreatePaymentIntentPaymentMethodOptionsKlarna {
7804    pub fn new() -> Self {
7805        Self {
7806            capture_method: None,
7807            on_demand: None,
7808            preferred_locale: None,
7809            setup_future_usage: None,
7810            subscriptions: None,
7811        }
7812    }
7813}
7814impl Default for CreatePaymentIntentPaymentMethodOptionsKlarna {
7815    fn default() -> Self {
7816        Self::new()
7817    }
7818}
7819/// Controls when the funds are captured from the customer's account.
7820///
7821/// 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.
7822///
7823/// 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.
7824#[derive(Clone, Eq, PartialEq)]
7825#[non_exhaustive]
7826pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7827    Manual,
7828    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7829    Unknown(String),
7830}
7831impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7832    pub fn as_str(&self) -> &str {
7833        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
7834        match self {
7835            Manual => "manual",
7836            Unknown(v) => v,
7837        }
7838    }
7839}
7840
7841impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7842    type Err = std::convert::Infallible;
7843    fn from_str(s: &str) -> Result<Self, Self::Err> {
7844        use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
7845        match s {
7846            "manual" => Ok(Manual),
7847            v => {
7848                tracing::warn!(
7849                    "Unknown value '{}' for enum '{}'",
7850                    v,
7851                    "CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod"
7852                );
7853                Ok(Unknown(v.to_owned()))
7854            }
7855        }
7856    }
7857}
7858impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7859    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7860        f.write_str(self.as_str())
7861    }
7862}
7863
7864impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7865    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7866        f.write_str(self.as_str())
7867    }
7868}
7869impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7870    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7871    where
7872        S: serde::Serializer,
7873    {
7874        serializer.serialize_str(self.as_str())
7875    }
7876}
7877#[cfg(feature = "deserialize")]
7878impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
7879    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7880        use std::str::FromStr;
7881        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7882        Ok(Self::from_str(&s).expect("infallible"))
7883    }
7884}
7885/// On-demand details if setting up or charging an on-demand payment.
7886#[derive(Clone, Debug, serde::Serialize)]
7887pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7888    /// Your average amount value.
7889    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7890    #[serde(skip_serializing_if = "Option::is_none")]
7891    pub average_amount: Option<i64>,
7892    /// The maximum value you may charge a customer per purchase.
7893    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7894    #[serde(skip_serializing_if = "Option::is_none")]
7895    pub maximum_amount: Option<i64>,
7896    /// The lowest or minimum value you may charge a customer per purchase.
7897    /// You can use a value across your customer base, or segment based on customer type, country, etc.
7898    #[serde(skip_serializing_if = "Option::is_none")]
7899    pub minimum_amount: Option<i64>,
7900    /// Interval at which the customer is making purchases
7901    #[serde(skip_serializing_if = "Option::is_none")]
7902    pub purchase_interval:
7903        Option<CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
7904    /// The number of `purchase_interval` between charges
7905    #[serde(skip_serializing_if = "Option::is_none")]
7906    pub purchase_interval_count: Option<u64>,
7907}
7908impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7909    pub fn new() -> Self {
7910        Self {
7911            average_amount: None,
7912            maximum_amount: None,
7913            minimum_amount: None,
7914            purchase_interval: None,
7915            purchase_interval_count: None,
7916        }
7917    }
7918}
7919impl Default for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
7920    fn default() -> Self {
7921        Self::new()
7922    }
7923}
7924/// Interval at which the customer is making purchases
7925#[derive(Clone, Eq, PartialEq)]
7926#[non_exhaustive]
7927pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7928    Day,
7929    Month,
7930    Week,
7931    Year,
7932    /// An unrecognized value from Stripe. Should not be used as a request parameter.
7933    Unknown(String),
7934}
7935impl CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7936    pub fn as_str(&self) -> &str {
7937        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7938        match self {
7939            Day => "day",
7940            Month => "month",
7941            Week => "week",
7942            Year => "year",
7943            Unknown(v) => v,
7944        }
7945    }
7946}
7947
7948impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7949    type Err = std::convert::Infallible;
7950    fn from_str(s: &str) -> Result<Self, Self::Err> {
7951        use CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
7952        match s {
7953            "day" => Ok(Day),
7954            "month" => Ok(Month),
7955            "week" => Ok(Week),
7956            "year" => Ok(Year),
7957            v => {
7958                tracing::warn!(
7959                    "Unknown value '{}' for enum '{}'",
7960                    v,
7961                    "CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
7962                );
7963                Ok(Unknown(v.to_owned()))
7964            }
7965        }
7966    }
7967}
7968impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7969    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7970        f.write_str(self.as_str())
7971    }
7972}
7973
7974impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7975    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
7976        f.write_str(self.as_str())
7977    }
7978}
7979impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
7980    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
7981    where
7982        S: serde::Serializer,
7983    {
7984        serializer.serialize_str(self.as_str())
7985    }
7986}
7987#[cfg(feature = "deserialize")]
7988impl<'de> serde::Deserialize<'de>
7989    for CreatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
7990{
7991    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
7992        use std::str::FromStr;
7993        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
7994        Ok(Self::from_str(&s).expect("infallible"))
7995    }
7996}
7997/// Preferred language of the Klarna authorization page that the customer is redirected to
7998#[derive(Clone, Eq, PartialEq)]
7999#[non_exhaustive]
8000pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8001    CsMinusCz,
8002    DaMinusDk,
8003    DeMinusAt,
8004    DeMinusCh,
8005    DeMinusDe,
8006    ElMinusGr,
8007    EnMinusAt,
8008    EnMinusAu,
8009    EnMinusBe,
8010    EnMinusCa,
8011    EnMinusCh,
8012    EnMinusCz,
8013    EnMinusDe,
8014    EnMinusDk,
8015    EnMinusEs,
8016    EnMinusFi,
8017    EnMinusFr,
8018    EnMinusGb,
8019    EnMinusGr,
8020    EnMinusIe,
8021    EnMinusIt,
8022    EnMinusNl,
8023    EnMinusNo,
8024    EnMinusNz,
8025    EnMinusPl,
8026    EnMinusPt,
8027    EnMinusRo,
8028    EnMinusSe,
8029    EnMinusUs,
8030    EsMinusEs,
8031    EsMinusUs,
8032    FiMinusFi,
8033    FrMinusBe,
8034    FrMinusCa,
8035    FrMinusCh,
8036    FrMinusFr,
8037    ItMinusCh,
8038    ItMinusIt,
8039    NbMinusNo,
8040    NlMinusBe,
8041    NlMinusNl,
8042    PlMinusPl,
8043    PtMinusPt,
8044    RoMinusRo,
8045    SvMinusFi,
8046    SvMinusSe,
8047    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8048    Unknown(String),
8049}
8050impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8051    pub fn as_str(&self) -> &str {
8052        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
8053        match self {
8054            CsMinusCz => "cs-CZ",
8055            DaMinusDk => "da-DK",
8056            DeMinusAt => "de-AT",
8057            DeMinusCh => "de-CH",
8058            DeMinusDe => "de-DE",
8059            ElMinusGr => "el-GR",
8060            EnMinusAt => "en-AT",
8061            EnMinusAu => "en-AU",
8062            EnMinusBe => "en-BE",
8063            EnMinusCa => "en-CA",
8064            EnMinusCh => "en-CH",
8065            EnMinusCz => "en-CZ",
8066            EnMinusDe => "en-DE",
8067            EnMinusDk => "en-DK",
8068            EnMinusEs => "en-ES",
8069            EnMinusFi => "en-FI",
8070            EnMinusFr => "en-FR",
8071            EnMinusGb => "en-GB",
8072            EnMinusGr => "en-GR",
8073            EnMinusIe => "en-IE",
8074            EnMinusIt => "en-IT",
8075            EnMinusNl => "en-NL",
8076            EnMinusNo => "en-NO",
8077            EnMinusNz => "en-NZ",
8078            EnMinusPl => "en-PL",
8079            EnMinusPt => "en-PT",
8080            EnMinusRo => "en-RO",
8081            EnMinusSe => "en-SE",
8082            EnMinusUs => "en-US",
8083            EsMinusEs => "es-ES",
8084            EsMinusUs => "es-US",
8085            FiMinusFi => "fi-FI",
8086            FrMinusBe => "fr-BE",
8087            FrMinusCa => "fr-CA",
8088            FrMinusCh => "fr-CH",
8089            FrMinusFr => "fr-FR",
8090            ItMinusCh => "it-CH",
8091            ItMinusIt => "it-IT",
8092            NbMinusNo => "nb-NO",
8093            NlMinusBe => "nl-BE",
8094            NlMinusNl => "nl-NL",
8095            PlMinusPl => "pl-PL",
8096            PtMinusPt => "pt-PT",
8097            RoMinusRo => "ro-RO",
8098            SvMinusFi => "sv-FI",
8099            SvMinusSe => "sv-SE",
8100            Unknown(v) => v,
8101        }
8102    }
8103}
8104
8105impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8106    type Err = std::convert::Infallible;
8107    fn from_str(s: &str) -> Result<Self, Self::Err> {
8108        use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
8109        match s {
8110            "cs-CZ" => Ok(CsMinusCz),
8111            "da-DK" => Ok(DaMinusDk),
8112            "de-AT" => Ok(DeMinusAt),
8113            "de-CH" => Ok(DeMinusCh),
8114            "de-DE" => Ok(DeMinusDe),
8115            "el-GR" => Ok(ElMinusGr),
8116            "en-AT" => Ok(EnMinusAt),
8117            "en-AU" => Ok(EnMinusAu),
8118            "en-BE" => Ok(EnMinusBe),
8119            "en-CA" => Ok(EnMinusCa),
8120            "en-CH" => Ok(EnMinusCh),
8121            "en-CZ" => Ok(EnMinusCz),
8122            "en-DE" => Ok(EnMinusDe),
8123            "en-DK" => Ok(EnMinusDk),
8124            "en-ES" => Ok(EnMinusEs),
8125            "en-FI" => Ok(EnMinusFi),
8126            "en-FR" => Ok(EnMinusFr),
8127            "en-GB" => Ok(EnMinusGb),
8128            "en-GR" => Ok(EnMinusGr),
8129            "en-IE" => Ok(EnMinusIe),
8130            "en-IT" => Ok(EnMinusIt),
8131            "en-NL" => Ok(EnMinusNl),
8132            "en-NO" => Ok(EnMinusNo),
8133            "en-NZ" => Ok(EnMinusNz),
8134            "en-PL" => Ok(EnMinusPl),
8135            "en-PT" => Ok(EnMinusPt),
8136            "en-RO" => Ok(EnMinusRo),
8137            "en-SE" => Ok(EnMinusSe),
8138            "en-US" => Ok(EnMinusUs),
8139            "es-ES" => Ok(EsMinusEs),
8140            "es-US" => Ok(EsMinusUs),
8141            "fi-FI" => Ok(FiMinusFi),
8142            "fr-BE" => Ok(FrMinusBe),
8143            "fr-CA" => Ok(FrMinusCa),
8144            "fr-CH" => Ok(FrMinusCh),
8145            "fr-FR" => Ok(FrMinusFr),
8146            "it-CH" => Ok(ItMinusCh),
8147            "it-IT" => Ok(ItMinusIt),
8148            "nb-NO" => Ok(NbMinusNo),
8149            "nl-BE" => Ok(NlMinusBe),
8150            "nl-NL" => Ok(NlMinusNl),
8151            "pl-PL" => Ok(PlMinusPl),
8152            "pt-PT" => Ok(PtMinusPt),
8153            "ro-RO" => Ok(RoMinusRo),
8154            "sv-FI" => Ok(SvMinusFi),
8155            "sv-SE" => Ok(SvMinusSe),
8156            v => {
8157                tracing::warn!(
8158                    "Unknown value '{}' for enum '{}'",
8159                    v,
8160                    "CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale"
8161                );
8162                Ok(Unknown(v.to_owned()))
8163            }
8164        }
8165    }
8166}
8167impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8168    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8169        f.write_str(self.as_str())
8170    }
8171}
8172
8173impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8174    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8175        f.write_str(self.as_str())
8176    }
8177}
8178impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8179    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8180    where
8181        S: serde::Serializer,
8182    {
8183        serializer.serialize_str(self.as_str())
8184    }
8185}
8186#[cfg(feature = "deserialize")]
8187impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
8188    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8189        use std::str::FromStr;
8190        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8191        Ok(Self::from_str(&s).expect("infallible"))
8192    }
8193}
8194/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8195///
8196/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8197/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8198///
8199/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8200///
8201/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8202///
8203/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8204#[derive(Clone, Eq, PartialEq)]
8205#[non_exhaustive]
8206pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
8207    None,
8208    OffSession,
8209    OnSession,
8210    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8211    Unknown(String),
8212}
8213impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
8214    pub fn as_str(&self) -> &str {
8215        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
8216        match self {
8217            None => "none",
8218            OffSession => "off_session",
8219            OnSession => "on_session",
8220            Unknown(v) => v,
8221        }
8222    }
8223}
8224
8225impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
8226    type Err = std::convert::Infallible;
8227    fn from_str(s: &str) -> Result<Self, Self::Err> {
8228        use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
8229        match s {
8230            "none" => Ok(None),
8231            "off_session" => Ok(OffSession),
8232            "on_session" => Ok(OnSession),
8233            v => {
8234                tracing::warn!(
8235                    "Unknown value '{}' for enum '{}'",
8236                    v,
8237                    "CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage"
8238                );
8239                Ok(Unknown(v.to_owned()))
8240            }
8241        }
8242    }
8243}
8244impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
8245    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8246        f.write_str(self.as_str())
8247    }
8248}
8249
8250impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
8251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8252        f.write_str(self.as_str())
8253    }
8254}
8255impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
8256    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8257    where
8258        S: serde::Serializer,
8259    {
8260        serializer.serialize_str(self.as_str())
8261    }
8262}
8263#[cfg(feature = "deserialize")]
8264impl<'de> serde::Deserialize<'de>
8265    for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
8266{
8267    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8268        use std::str::FromStr;
8269        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8270        Ok(Self::from_str(&s).expect("infallible"))
8271    }
8272}
8273/// Subscription details if setting up or charging a subscription.
8274#[derive(Clone, Debug, serde::Serialize)]
8275pub struct CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
8276    /// Unit of time between subscription charges.
8277    pub interval: CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
8278    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
8279    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
8280    #[serde(skip_serializing_if = "Option::is_none")]
8281    pub interval_count: Option<u64>,
8282    /// Name for subscription.
8283    #[serde(skip_serializing_if = "Option::is_none")]
8284    pub name: Option<String>,
8285    /// Describes the upcoming charge for this subscription.
8286    #[serde(skip_serializing_if = "Option::is_none")]
8287    pub next_billing: Option<SubscriptionNextBillingParam>,
8288    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
8289    /// Use a value that persists across subscription charges.
8290    pub reference: String,
8291}
8292impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
8293    pub fn new(
8294        interval: impl Into<CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
8295        reference: impl Into<String>,
8296    ) -> Self {
8297        Self {
8298            interval: interval.into(),
8299            interval_count: None,
8300            name: None,
8301            next_billing: None,
8302            reference: reference.into(),
8303        }
8304    }
8305}
8306/// Unit of time between subscription charges.
8307#[derive(Clone, Eq, PartialEq)]
8308#[non_exhaustive]
8309pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8310    Day,
8311    Month,
8312    Week,
8313    Year,
8314    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8315    Unknown(String),
8316}
8317impl CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8318    pub fn as_str(&self) -> &str {
8319        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8320        match self {
8321            Day => "day",
8322            Month => "month",
8323            Week => "week",
8324            Year => "year",
8325            Unknown(v) => v,
8326        }
8327    }
8328}
8329
8330impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8331    type Err = std::convert::Infallible;
8332    fn from_str(s: &str) -> Result<Self, Self::Err> {
8333        use CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
8334        match s {
8335            "day" => Ok(Day),
8336            "month" => Ok(Month),
8337            "week" => Ok(Week),
8338            "year" => Ok(Year),
8339            v => {
8340                tracing::warn!(
8341                    "Unknown value '{}' for enum '{}'",
8342                    v,
8343                    "CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
8344                );
8345                Ok(Unknown(v.to_owned()))
8346            }
8347        }
8348    }
8349}
8350impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8351    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8352        f.write_str(self.as_str())
8353    }
8354}
8355
8356impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8357    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8358        f.write_str(self.as_str())
8359    }
8360}
8361impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
8362    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8363    where
8364        S: serde::Serializer,
8365    {
8366        serializer.serialize_str(self.as_str())
8367    }
8368}
8369#[cfg(feature = "deserialize")]
8370impl<'de> serde::Deserialize<'de>
8371    for CreatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
8372{
8373    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8374        use std::str::FromStr;
8375        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8376        Ok(Self::from_str(&s).expect("infallible"))
8377    }
8378}
8379/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
8380#[derive(Clone, Debug, serde::Serialize)]
8381pub struct CreatePaymentIntentPaymentMethodOptionsKonbini {
8382    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
8383    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
8384    /// We recommend to use the customer's phone number.
8385    #[serde(skip_serializing_if = "Option::is_none")]
8386    pub confirmation_number: Option<String>,
8387    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
8388    /// 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.
8389    /// Defaults to 3 days.
8390    #[serde(skip_serializing_if = "Option::is_none")]
8391    pub expires_after_days: Option<u32>,
8392    /// The timestamp at which the Konbini payment instructions will expire.
8393    /// Only one of `expires_after_days` or `expires_at` may be set.
8394    #[serde(skip_serializing_if = "Option::is_none")]
8395    pub expires_at: Option<stripe_types::Timestamp>,
8396    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
8397    #[serde(skip_serializing_if = "Option::is_none")]
8398    pub product_description: Option<String>,
8399    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8400    ///
8401    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8402    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8403    ///
8404    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8405    ///
8406    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8407    ///
8408    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8409    #[serde(skip_serializing_if = "Option::is_none")]
8410    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
8411}
8412impl CreatePaymentIntentPaymentMethodOptionsKonbini {
8413    pub fn new() -> Self {
8414        Self {
8415            confirmation_number: None,
8416            expires_after_days: None,
8417            expires_at: None,
8418            product_description: None,
8419            setup_future_usage: None,
8420        }
8421    }
8422}
8423impl Default for CreatePaymentIntentPaymentMethodOptionsKonbini {
8424    fn default() -> Self {
8425        Self::new()
8426    }
8427}
8428/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8429///
8430/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8431/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8432///
8433/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8434///
8435/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8436///
8437/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8438#[derive(Clone, Eq, PartialEq)]
8439#[non_exhaustive]
8440pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
8441    None,
8442    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8443    Unknown(String),
8444}
8445impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
8446    pub fn as_str(&self) -> &str {
8447        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
8448        match self {
8449            None => "none",
8450            Unknown(v) => v,
8451        }
8452    }
8453}
8454
8455impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
8456    type Err = std::convert::Infallible;
8457    fn from_str(s: &str) -> Result<Self, Self::Err> {
8458        use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
8459        match s {
8460            "none" => Ok(None),
8461            v => {
8462                tracing::warn!(
8463                    "Unknown value '{}' for enum '{}'",
8464                    v,
8465                    "CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage"
8466                );
8467                Ok(Unknown(v.to_owned()))
8468            }
8469        }
8470    }
8471}
8472impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
8473    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8474        f.write_str(self.as_str())
8475    }
8476}
8477
8478impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
8479    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8480        f.write_str(self.as_str())
8481    }
8482}
8483impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
8484    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8485    where
8486        S: serde::Serializer,
8487    {
8488        serializer.serialize_str(self.as_str())
8489    }
8490}
8491#[cfg(feature = "deserialize")]
8492impl<'de> serde::Deserialize<'de>
8493    for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
8494{
8495    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8496        use std::str::FromStr;
8497        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8498        Ok(Self::from_str(&s).expect("infallible"))
8499    }
8500}
8501/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
8502#[derive(Clone, Debug, serde::Serialize)]
8503pub struct CreatePaymentIntentPaymentMethodOptionsKrCard {
8504    /// Controls when the funds are captured from the customer's account.
8505    ///
8506    /// 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.
8507    ///
8508    /// 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.
8509    #[serde(skip_serializing_if = "Option::is_none")]
8510    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
8511    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8512    ///
8513    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8514    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8515    ///
8516    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8517    ///
8518    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8519    #[serde(skip_serializing_if = "Option::is_none")]
8520    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
8521}
8522impl CreatePaymentIntentPaymentMethodOptionsKrCard {
8523    pub fn new() -> Self {
8524        Self { capture_method: None, setup_future_usage: None }
8525    }
8526}
8527impl Default for CreatePaymentIntentPaymentMethodOptionsKrCard {
8528    fn default() -> Self {
8529        Self::new()
8530    }
8531}
8532/// Controls when the funds are captured from the customer's account.
8533///
8534/// 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.
8535///
8536/// 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.
8537#[derive(Clone, Eq, PartialEq)]
8538#[non_exhaustive]
8539pub enum CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8540    Manual,
8541    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8542    Unknown(String),
8543}
8544impl CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8545    pub fn as_str(&self) -> &str {
8546        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
8547        match self {
8548            Manual => "manual",
8549            Unknown(v) => v,
8550        }
8551    }
8552}
8553
8554impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8555    type Err = std::convert::Infallible;
8556    fn from_str(s: &str) -> Result<Self, Self::Err> {
8557        use CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
8558        match s {
8559            "manual" => Ok(Manual),
8560            v => {
8561                tracing::warn!(
8562                    "Unknown value '{}' for enum '{}'",
8563                    v,
8564                    "CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod"
8565                );
8566                Ok(Unknown(v.to_owned()))
8567            }
8568        }
8569    }
8570}
8571impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8573        f.write_str(self.as_str())
8574    }
8575}
8576
8577impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8578    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8579        f.write_str(self.as_str())
8580    }
8581}
8582impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8583    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8584    where
8585        S: serde::Serializer,
8586    {
8587        serializer.serialize_str(self.as_str())
8588    }
8589}
8590#[cfg(feature = "deserialize")]
8591impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
8592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8593        use std::str::FromStr;
8594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8595        Ok(Self::from_str(&s).expect("infallible"))
8596    }
8597}
8598/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8599///
8600/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8601/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8602///
8603/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8604///
8605/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8606#[derive(Clone, Eq, PartialEq)]
8607#[non_exhaustive]
8608pub enum CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8609    None,
8610    OffSession,
8611    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8612    Unknown(String),
8613}
8614impl CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8615    pub fn as_str(&self) -> &str {
8616        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
8617        match self {
8618            None => "none",
8619            OffSession => "off_session",
8620            Unknown(v) => v,
8621        }
8622    }
8623}
8624
8625impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8626    type Err = std::convert::Infallible;
8627    fn from_str(s: &str) -> Result<Self, Self::Err> {
8628        use CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
8629        match s {
8630            "none" => Ok(None),
8631            "off_session" => Ok(OffSession),
8632            v => {
8633                tracing::warn!(
8634                    "Unknown value '{}' for enum '{}'",
8635                    v,
8636                    "CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage"
8637                );
8638                Ok(Unknown(v.to_owned()))
8639            }
8640        }
8641    }
8642}
8643impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8644    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8645        f.write_str(self.as_str())
8646    }
8647}
8648
8649impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8650    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8651        f.write_str(self.as_str())
8652    }
8653}
8654impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
8655    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8656    where
8657        S: serde::Serializer,
8658    {
8659        serializer.serialize_str(self.as_str())
8660    }
8661}
8662#[cfg(feature = "deserialize")]
8663impl<'de> serde::Deserialize<'de>
8664    for CreatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
8665{
8666    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8667        use std::str::FromStr;
8668        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8669        Ok(Self::from_str(&s).expect("infallible"))
8670    }
8671}
8672/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
8673#[derive(Clone, Debug, serde::Serialize)]
8674pub struct CreatePaymentIntentPaymentMethodOptionsLink {
8675    /// Controls when the funds are captured from the customer's account.
8676    ///
8677    /// 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.
8678    ///
8679    /// 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.
8680    #[serde(skip_serializing_if = "Option::is_none")]
8681    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
8682    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
8683    #[serde(skip_serializing_if = "Option::is_none")]
8684    pub persistent_token: Option<String>,
8685    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8686    ///
8687    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8688    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8689    ///
8690    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8691    ///
8692    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8693    ///
8694    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8695    #[serde(skip_serializing_if = "Option::is_none")]
8696    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
8697}
8698impl CreatePaymentIntentPaymentMethodOptionsLink {
8699    pub fn new() -> Self {
8700        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
8701    }
8702}
8703impl Default for CreatePaymentIntentPaymentMethodOptionsLink {
8704    fn default() -> Self {
8705        Self::new()
8706    }
8707}
8708/// Controls when the funds are captured from the customer's account.
8709///
8710/// 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.
8711///
8712/// 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.
8713#[derive(Clone, Eq, PartialEq)]
8714#[non_exhaustive]
8715pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8716    Manual,
8717    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8718    Unknown(String),
8719}
8720impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8721    pub fn as_str(&self) -> &str {
8722        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
8723        match self {
8724            Manual => "manual",
8725            Unknown(v) => v,
8726        }
8727    }
8728}
8729
8730impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8731    type Err = std::convert::Infallible;
8732    fn from_str(s: &str) -> Result<Self, Self::Err> {
8733        use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
8734        match s {
8735            "manual" => Ok(Manual),
8736            v => {
8737                tracing::warn!(
8738                    "Unknown value '{}' for enum '{}'",
8739                    v,
8740                    "CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod"
8741                );
8742                Ok(Unknown(v.to_owned()))
8743            }
8744        }
8745    }
8746}
8747impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8748    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8749        f.write_str(self.as_str())
8750    }
8751}
8752
8753impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8754    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8755        f.write_str(self.as_str())
8756    }
8757}
8758impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8759    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8760    where
8761        S: serde::Serializer,
8762    {
8763        serializer.serialize_str(self.as_str())
8764    }
8765}
8766#[cfg(feature = "deserialize")]
8767impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
8768    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8769        use std::str::FromStr;
8770        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8771        Ok(Self::from_str(&s).expect("infallible"))
8772    }
8773}
8774/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8775///
8776/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8777/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8778///
8779/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8780///
8781/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8782///
8783/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8784#[derive(Clone, Eq, PartialEq)]
8785#[non_exhaustive]
8786pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8787    None,
8788    OffSession,
8789    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8790    Unknown(String),
8791}
8792impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8793    pub fn as_str(&self) -> &str {
8794        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
8795        match self {
8796            None => "none",
8797            OffSession => "off_session",
8798            Unknown(v) => v,
8799        }
8800    }
8801}
8802
8803impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8804    type Err = std::convert::Infallible;
8805    fn from_str(s: &str) -> Result<Self, Self::Err> {
8806        use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
8807        match s {
8808            "none" => Ok(None),
8809            "off_session" => Ok(OffSession),
8810            v => {
8811                tracing::warn!(
8812                    "Unknown value '{}' for enum '{}'",
8813                    v,
8814                    "CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage"
8815                );
8816                Ok(Unknown(v.to_owned()))
8817            }
8818        }
8819    }
8820}
8821impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8822    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8823        f.write_str(self.as_str())
8824    }
8825}
8826
8827impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8828    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8829        f.write_str(self.as_str())
8830    }
8831}
8832impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8833    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8834    where
8835        S: serde::Serializer,
8836    {
8837        serializer.serialize_str(self.as_str())
8838    }
8839}
8840#[cfg(feature = "deserialize")]
8841impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
8842    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8843        use std::str::FromStr;
8844        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8845        Ok(Self::from_str(&s).expect("infallible"))
8846    }
8847}
8848/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
8849#[derive(Clone, Debug, serde::Serialize)]
8850pub struct CreatePaymentIntentPaymentMethodOptionsMbWay {
8851    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8852    ///
8853    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8854    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8855    ///
8856    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8857    ///
8858    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8859    ///
8860    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8861    #[serde(skip_serializing_if = "Option::is_none")]
8862    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
8863}
8864impl CreatePaymentIntentPaymentMethodOptionsMbWay {
8865    pub fn new() -> Self {
8866        Self { setup_future_usage: None }
8867    }
8868}
8869impl Default for CreatePaymentIntentPaymentMethodOptionsMbWay {
8870    fn default() -> Self {
8871        Self::new()
8872    }
8873}
8874/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8875///
8876/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8877/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8878///
8879/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8880///
8881/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8882///
8883/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8884#[derive(Clone, Eq, PartialEq)]
8885#[non_exhaustive]
8886pub enum CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8887    None,
8888    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8889    Unknown(String),
8890}
8891impl CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8892    pub fn as_str(&self) -> &str {
8893        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
8894        match self {
8895            None => "none",
8896            Unknown(v) => v,
8897        }
8898    }
8899}
8900
8901impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8902    type Err = std::convert::Infallible;
8903    fn from_str(s: &str) -> Result<Self, Self::Err> {
8904        use CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
8905        match s {
8906            "none" => Ok(None),
8907            v => {
8908                tracing::warn!(
8909                    "Unknown value '{}' for enum '{}'",
8910                    v,
8911                    "CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage"
8912                );
8913                Ok(Unknown(v.to_owned()))
8914            }
8915        }
8916    }
8917}
8918impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8919    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8920        f.write_str(self.as_str())
8921    }
8922}
8923
8924impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8925    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
8926        f.write_str(self.as_str())
8927    }
8928}
8929impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8930    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
8931    where
8932        S: serde::Serializer,
8933    {
8934        serializer.serialize_str(self.as_str())
8935    }
8936}
8937#[cfg(feature = "deserialize")]
8938impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
8939    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
8940        use std::str::FromStr;
8941        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
8942        Ok(Self::from_str(&s).expect("infallible"))
8943    }
8944}
8945/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
8946#[derive(Clone, Debug, serde::Serialize)]
8947pub struct CreatePaymentIntentPaymentMethodOptionsMobilepay {
8948    /// Controls when the funds are captured from the customer's account.
8949    ///
8950    /// 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.
8951    ///
8952    /// 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.
8953    #[serde(skip_serializing_if = "Option::is_none")]
8954    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
8955    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
8956    ///
8957    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
8958    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
8959    ///
8960    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
8961    ///
8962    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
8963    ///
8964    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
8965    #[serde(skip_serializing_if = "Option::is_none")]
8966    pub setup_future_usage:
8967        Option<CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
8968}
8969impl CreatePaymentIntentPaymentMethodOptionsMobilepay {
8970    pub fn new() -> Self {
8971        Self { capture_method: None, setup_future_usage: None }
8972    }
8973}
8974impl Default for CreatePaymentIntentPaymentMethodOptionsMobilepay {
8975    fn default() -> Self {
8976        Self::new()
8977    }
8978}
8979/// Controls when the funds are captured from the customer's account.
8980///
8981/// 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.
8982///
8983/// 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.
8984#[derive(Clone, Eq, PartialEq)]
8985#[non_exhaustive]
8986pub enum CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8987    Manual,
8988    /// An unrecognized value from Stripe. Should not be used as a request parameter.
8989    Unknown(String),
8990}
8991impl CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
8992    pub fn as_str(&self) -> &str {
8993        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
8994        match self {
8995            Manual => "manual",
8996            Unknown(v) => v,
8997        }
8998    }
8999}
9000
9001impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
9002    type Err = std::convert::Infallible;
9003    fn from_str(s: &str) -> Result<Self, Self::Err> {
9004        use CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
9005        match s {
9006            "manual" => Ok(Manual),
9007            v => {
9008                tracing::warn!(
9009                    "Unknown value '{}' for enum '{}'",
9010                    v,
9011                    "CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod"
9012                );
9013                Ok(Unknown(v.to_owned()))
9014            }
9015        }
9016    }
9017}
9018impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
9019    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9020        f.write_str(self.as_str())
9021    }
9022}
9023
9024impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
9025    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9026        f.write_str(self.as_str())
9027    }
9028}
9029impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
9030    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9031    where
9032        S: serde::Serializer,
9033    {
9034        serializer.serialize_str(self.as_str())
9035    }
9036}
9037#[cfg(feature = "deserialize")]
9038impl<'de> serde::Deserialize<'de>
9039    for CreatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
9040{
9041    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9042        use std::str::FromStr;
9043        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9044        Ok(Self::from_str(&s).expect("infallible"))
9045    }
9046}
9047/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9048///
9049/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9050/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9051///
9052/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9053///
9054/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9055///
9056/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9057#[derive(Clone, Eq, PartialEq)]
9058#[non_exhaustive]
9059pub enum CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
9060    None,
9061    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9062    Unknown(String),
9063}
9064impl CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
9065    pub fn as_str(&self) -> &str {
9066        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
9067        match self {
9068            None => "none",
9069            Unknown(v) => v,
9070        }
9071    }
9072}
9073
9074impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
9075    type Err = std::convert::Infallible;
9076    fn from_str(s: &str) -> Result<Self, Self::Err> {
9077        use CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
9078        match s {
9079            "none" => Ok(None),
9080            v => {
9081                tracing::warn!(
9082                    "Unknown value '{}' for enum '{}'",
9083                    v,
9084                    "CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"
9085                );
9086                Ok(Unknown(v.to_owned()))
9087            }
9088        }
9089    }
9090}
9091impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
9092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9093        f.write_str(self.as_str())
9094    }
9095}
9096
9097impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
9098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9099        f.write_str(self.as_str())
9100    }
9101}
9102impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
9103    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9104    where
9105        S: serde::Serializer,
9106    {
9107        serializer.serialize_str(self.as_str())
9108    }
9109}
9110#[cfg(feature = "deserialize")]
9111impl<'de> serde::Deserialize<'de>
9112    for CreatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
9113{
9114    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9115        use std::str::FromStr;
9116        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9117        Ok(Self::from_str(&s).expect("infallible"))
9118    }
9119}
9120/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
9121#[derive(Clone, Debug, serde::Serialize)]
9122pub struct CreatePaymentIntentPaymentMethodOptionsMultibanco {
9123    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9124    ///
9125    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9126    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9127    ///
9128    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9129    ///
9130    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9131    ///
9132    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9133    #[serde(skip_serializing_if = "Option::is_none")]
9134    pub setup_future_usage:
9135        Option<CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
9136}
9137impl CreatePaymentIntentPaymentMethodOptionsMultibanco {
9138    pub fn new() -> Self {
9139        Self { setup_future_usage: None }
9140    }
9141}
9142impl Default for CreatePaymentIntentPaymentMethodOptionsMultibanco {
9143    fn default() -> Self {
9144        Self::new()
9145    }
9146}
9147/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9148///
9149/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9150/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9151///
9152/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9153///
9154/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9155///
9156/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9157#[derive(Clone, Eq, PartialEq)]
9158#[non_exhaustive]
9159pub enum CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
9160    None,
9161    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9162    Unknown(String),
9163}
9164impl CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
9165    pub fn as_str(&self) -> &str {
9166        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
9167        match self {
9168            None => "none",
9169            Unknown(v) => v,
9170        }
9171    }
9172}
9173
9174impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
9175    type Err = std::convert::Infallible;
9176    fn from_str(s: &str) -> Result<Self, Self::Err> {
9177        use CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
9178        match s {
9179            "none" => Ok(None),
9180            v => {
9181                tracing::warn!(
9182                    "Unknown value '{}' for enum '{}'",
9183                    v,
9184                    "CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"
9185                );
9186                Ok(Unknown(v.to_owned()))
9187            }
9188        }
9189    }
9190}
9191impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
9192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9193        f.write_str(self.as_str())
9194    }
9195}
9196
9197impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
9198    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9199        f.write_str(self.as_str())
9200    }
9201}
9202impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
9203    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9204    where
9205        S: serde::Serializer,
9206    {
9207        serializer.serialize_str(self.as_str())
9208    }
9209}
9210#[cfg(feature = "deserialize")]
9211impl<'de> serde::Deserialize<'de>
9212    for CreatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
9213{
9214    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9215        use std::str::FromStr;
9216        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9217        Ok(Self::from_str(&s).expect("infallible"))
9218    }
9219}
9220/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
9221#[derive(Clone, Debug, serde::Serialize)]
9222pub struct CreatePaymentIntentPaymentMethodOptionsNaverPay {
9223    /// Controls when the funds are captured from the customer's account.
9224    ///
9225    /// 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.
9226    ///
9227    /// 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.
9228    #[serde(skip_serializing_if = "Option::is_none")]
9229    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
9230    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9231    ///
9232    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9233    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9234    ///
9235    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9236    ///
9237    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9238    #[serde(skip_serializing_if = "Option::is_none")]
9239    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
9240}
9241impl CreatePaymentIntentPaymentMethodOptionsNaverPay {
9242    pub fn new() -> Self {
9243        Self { capture_method: None, setup_future_usage: None }
9244    }
9245}
9246impl Default for CreatePaymentIntentPaymentMethodOptionsNaverPay {
9247    fn default() -> Self {
9248        Self::new()
9249    }
9250}
9251/// Controls when the funds are captured from the customer's account.
9252///
9253/// 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.
9254///
9255/// 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.
9256#[derive(Clone, Eq, PartialEq)]
9257#[non_exhaustive]
9258pub enum CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9259    Manual,
9260    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9261    Unknown(String),
9262}
9263impl CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9264    pub fn as_str(&self) -> &str {
9265        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
9266        match self {
9267            Manual => "manual",
9268            Unknown(v) => v,
9269        }
9270    }
9271}
9272
9273impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9274    type Err = std::convert::Infallible;
9275    fn from_str(s: &str) -> Result<Self, Self::Err> {
9276        use CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
9277        match s {
9278            "manual" => Ok(Manual),
9279            v => {
9280                tracing::warn!(
9281                    "Unknown value '{}' for enum '{}'",
9282                    v,
9283                    "CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod"
9284                );
9285                Ok(Unknown(v.to_owned()))
9286            }
9287        }
9288    }
9289}
9290impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9291    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9292        f.write_str(self.as_str())
9293    }
9294}
9295
9296impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9298        f.write_str(self.as_str())
9299    }
9300}
9301impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9302    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9303    where
9304        S: serde::Serializer,
9305    {
9306        serializer.serialize_str(self.as_str())
9307    }
9308}
9309#[cfg(feature = "deserialize")]
9310impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
9311    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9312        use std::str::FromStr;
9313        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9314        Ok(Self::from_str(&s).expect("infallible"))
9315    }
9316}
9317/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9318///
9319/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9320/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9321///
9322/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9323///
9324/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9325#[derive(Clone, Eq, PartialEq)]
9326#[non_exhaustive]
9327pub enum CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
9328    None,
9329    OffSession,
9330    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9331    Unknown(String),
9332}
9333impl CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
9334    pub fn as_str(&self) -> &str {
9335        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
9336        match self {
9337            None => "none",
9338            OffSession => "off_session",
9339            Unknown(v) => v,
9340        }
9341    }
9342}
9343
9344impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
9345    type Err = std::convert::Infallible;
9346    fn from_str(s: &str) -> Result<Self, Self::Err> {
9347        use CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
9348        match s {
9349            "none" => Ok(None),
9350            "off_session" => Ok(OffSession),
9351            v => {
9352                tracing::warn!(
9353                    "Unknown value '{}' for enum '{}'",
9354                    v,
9355                    "CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage"
9356                );
9357                Ok(Unknown(v.to_owned()))
9358            }
9359        }
9360    }
9361}
9362impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
9363    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9364        f.write_str(self.as_str())
9365    }
9366}
9367
9368impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
9369    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9370        f.write_str(self.as_str())
9371    }
9372}
9373impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
9374    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9375    where
9376        S: serde::Serializer,
9377    {
9378        serializer.serialize_str(self.as_str())
9379    }
9380}
9381#[cfg(feature = "deserialize")]
9382impl<'de> serde::Deserialize<'de>
9383    for CreatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
9384{
9385    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9386        use std::str::FromStr;
9387        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9388        Ok(Self::from_str(&s).expect("infallible"))
9389    }
9390}
9391/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
9392#[derive(Clone, Debug, serde::Serialize)]
9393pub struct CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
9394    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9395    ///
9396    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9397    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9398    ///
9399    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9400    ///
9401    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9402    ///
9403    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9404    #[serde(skip_serializing_if = "Option::is_none")]
9405    pub setup_future_usage:
9406        Option<CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
9407    /// Controls when Stripe will attempt to debit the funds from the customer's account.
9408    /// The date must be a string in YYYY-MM-DD format.
9409    /// The date must be in the future and between 3 and 15 calendar days from now.
9410    #[serde(skip_serializing_if = "Option::is_none")]
9411    pub target_date: Option<String>,
9412}
9413impl CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
9414    pub fn new() -> Self {
9415        Self { setup_future_usage: None, target_date: None }
9416    }
9417}
9418impl Default for CreatePaymentIntentPaymentMethodOptionsNzBankAccount {
9419    fn default() -> Self {
9420        Self::new()
9421    }
9422}
9423/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9424///
9425/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9426/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9427///
9428/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9429///
9430/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9431///
9432/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9433#[derive(Clone, Eq, PartialEq)]
9434#[non_exhaustive]
9435pub enum CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
9436    None,
9437    OffSession,
9438    OnSession,
9439    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9440    Unknown(String),
9441}
9442impl CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
9443    pub fn as_str(&self) -> &str {
9444        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
9445        match self {
9446            None => "none",
9447            OffSession => "off_session",
9448            OnSession => "on_session",
9449            Unknown(v) => v,
9450        }
9451    }
9452}
9453
9454impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
9455    type Err = std::convert::Infallible;
9456    fn from_str(s: &str) -> Result<Self, Self::Err> {
9457        use CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
9458        match s {
9459            "none" => Ok(None),
9460            "off_session" => Ok(OffSession),
9461            "on_session" => Ok(OnSession),
9462            v => {
9463                tracing::warn!(
9464                    "Unknown value '{}' for enum '{}'",
9465                    v,
9466                    "CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"
9467                );
9468                Ok(Unknown(v.to_owned()))
9469            }
9470        }
9471    }
9472}
9473impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
9474    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9475        f.write_str(self.as_str())
9476    }
9477}
9478
9479impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
9480    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9481        f.write_str(self.as_str())
9482    }
9483}
9484impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
9485    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9486    where
9487        S: serde::Serializer,
9488    {
9489        serializer.serialize_str(self.as_str())
9490    }
9491}
9492#[cfg(feature = "deserialize")]
9493impl<'de> serde::Deserialize<'de>
9494    for CreatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
9495{
9496    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9497        use std::str::FromStr;
9498        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9499        Ok(Self::from_str(&s).expect("infallible"))
9500    }
9501}
9502/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
9503#[derive(Clone, Debug, serde::Serialize)]
9504pub struct CreatePaymentIntentPaymentMethodOptionsOxxo {
9505    /// The number of calendar days before an OXXO voucher expires.
9506    /// 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.
9507    #[serde(skip_serializing_if = "Option::is_none")]
9508    pub expires_after_days: Option<u32>,
9509    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9510    ///
9511    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9512    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9513    ///
9514    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9515    ///
9516    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9517    ///
9518    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9519    #[serde(skip_serializing_if = "Option::is_none")]
9520    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
9521}
9522impl CreatePaymentIntentPaymentMethodOptionsOxxo {
9523    pub fn new() -> Self {
9524        Self { expires_after_days: None, setup_future_usage: None }
9525    }
9526}
9527impl Default for CreatePaymentIntentPaymentMethodOptionsOxxo {
9528    fn default() -> Self {
9529        Self::new()
9530    }
9531}
9532/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9533///
9534/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9535/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9536///
9537/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9538///
9539/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9540///
9541/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9542#[derive(Clone, Eq, PartialEq)]
9543#[non_exhaustive]
9544pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9545    None,
9546    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9547    Unknown(String),
9548}
9549impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9550    pub fn as_str(&self) -> &str {
9551        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
9552        match self {
9553            None => "none",
9554            Unknown(v) => v,
9555        }
9556    }
9557}
9558
9559impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9560    type Err = std::convert::Infallible;
9561    fn from_str(s: &str) -> Result<Self, Self::Err> {
9562        use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
9563        match s {
9564            "none" => Ok(None),
9565            v => {
9566                tracing::warn!(
9567                    "Unknown value '{}' for enum '{}'",
9568                    v,
9569                    "CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage"
9570                );
9571                Ok(Unknown(v.to_owned()))
9572            }
9573        }
9574    }
9575}
9576impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9577    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9578        f.write_str(self.as_str())
9579    }
9580}
9581
9582impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9584        f.write_str(self.as_str())
9585    }
9586}
9587impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9588    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9589    where
9590        S: serde::Serializer,
9591    {
9592        serializer.serialize_str(self.as_str())
9593    }
9594}
9595#[cfg(feature = "deserialize")]
9596impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
9597    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9598        use std::str::FromStr;
9599        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9600        Ok(Self::from_str(&s).expect("infallible"))
9601    }
9602}
9603/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
9604#[derive(Clone, Debug, serde::Serialize)]
9605pub struct CreatePaymentIntentPaymentMethodOptionsP24 {
9606    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9607    ///
9608    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9609    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9610    ///
9611    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9612    ///
9613    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9614    ///
9615    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9616    #[serde(skip_serializing_if = "Option::is_none")]
9617    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
9618    /// Confirm that the payer has accepted the P24 terms and conditions.
9619    #[serde(skip_serializing_if = "Option::is_none")]
9620    pub tos_shown_and_accepted: Option<bool>,
9621}
9622impl CreatePaymentIntentPaymentMethodOptionsP24 {
9623    pub fn new() -> Self {
9624        Self { setup_future_usage: None, tos_shown_and_accepted: None }
9625    }
9626}
9627impl Default for CreatePaymentIntentPaymentMethodOptionsP24 {
9628    fn default() -> Self {
9629        Self::new()
9630    }
9631}
9632/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9633///
9634/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9635/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9636///
9637/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9638///
9639/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9640///
9641/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9642#[derive(Clone, Eq, PartialEq)]
9643#[non_exhaustive]
9644pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9645    None,
9646    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9647    Unknown(String),
9648}
9649impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9650    pub fn as_str(&self) -> &str {
9651        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
9652        match self {
9653            None => "none",
9654            Unknown(v) => v,
9655        }
9656    }
9657}
9658
9659impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9660    type Err = std::convert::Infallible;
9661    fn from_str(s: &str) -> Result<Self, Self::Err> {
9662        use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
9663        match s {
9664            "none" => Ok(None),
9665            v => {
9666                tracing::warn!(
9667                    "Unknown value '{}' for enum '{}'",
9668                    v,
9669                    "CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage"
9670                );
9671                Ok(Unknown(v.to_owned()))
9672            }
9673        }
9674    }
9675}
9676impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9677    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9678        f.write_str(self.as_str())
9679    }
9680}
9681
9682impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9683    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9684        f.write_str(self.as_str())
9685    }
9686}
9687impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9688    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9689    where
9690        S: serde::Serializer,
9691    {
9692        serializer.serialize_str(self.as_str())
9693    }
9694}
9695#[cfg(feature = "deserialize")]
9696impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
9697    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9698        use std::str::FromStr;
9699        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9700        Ok(Self::from_str(&s).expect("infallible"))
9701    }
9702}
9703/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
9704#[derive(Clone, Debug, serde::Serialize)]
9705pub struct CreatePaymentIntentPaymentMethodOptionsPayco {
9706    /// Controls when the funds are captured from the customer's account.
9707    ///
9708    /// 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.
9709    ///
9710    /// 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.
9711    #[serde(skip_serializing_if = "Option::is_none")]
9712    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
9713}
9714impl CreatePaymentIntentPaymentMethodOptionsPayco {
9715    pub fn new() -> Self {
9716        Self { capture_method: None }
9717    }
9718}
9719impl Default for CreatePaymentIntentPaymentMethodOptionsPayco {
9720    fn default() -> Self {
9721        Self::new()
9722    }
9723}
9724/// Controls when the funds are captured from the customer's account.
9725///
9726/// 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.
9727///
9728/// 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.
9729#[derive(Clone, Eq, PartialEq)]
9730#[non_exhaustive]
9731pub enum CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9732    Manual,
9733    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9734    Unknown(String),
9735}
9736impl CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9737    pub fn as_str(&self) -> &str {
9738        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
9739        match self {
9740            Manual => "manual",
9741            Unknown(v) => v,
9742        }
9743    }
9744}
9745
9746impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9747    type Err = std::convert::Infallible;
9748    fn from_str(s: &str) -> Result<Self, Self::Err> {
9749        use CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
9750        match s {
9751            "manual" => Ok(Manual),
9752            v => {
9753                tracing::warn!(
9754                    "Unknown value '{}' for enum '{}'",
9755                    v,
9756                    "CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod"
9757                );
9758                Ok(Unknown(v.to_owned()))
9759            }
9760        }
9761    }
9762}
9763impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9765        f.write_str(self.as_str())
9766    }
9767}
9768
9769impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9771        f.write_str(self.as_str())
9772    }
9773}
9774impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9775    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9776    where
9777        S: serde::Serializer,
9778    {
9779        serializer.serialize_str(self.as_str())
9780    }
9781}
9782#[cfg(feature = "deserialize")]
9783impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
9784    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9785        use std::str::FromStr;
9786        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9787        Ok(Self::from_str(&s).expect("infallible"))
9788    }
9789}
9790/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
9791#[derive(Clone, Debug, serde::Serialize)]
9792pub struct CreatePaymentIntentPaymentMethodOptionsPaynow {
9793    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9794    ///
9795    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9796    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9797    ///
9798    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9799    ///
9800    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9801    ///
9802    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9803    #[serde(skip_serializing_if = "Option::is_none")]
9804    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
9805}
9806impl CreatePaymentIntentPaymentMethodOptionsPaynow {
9807    pub fn new() -> Self {
9808        Self { setup_future_usage: None }
9809    }
9810}
9811impl Default for CreatePaymentIntentPaymentMethodOptionsPaynow {
9812    fn default() -> Self {
9813        Self::new()
9814    }
9815}
9816/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9817///
9818/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9819/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9820///
9821/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9822///
9823/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9824///
9825/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9826#[derive(Clone, Eq, PartialEq)]
9827#[non_exhaustive]
9828pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9829    None,
9830    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9831    Unknown(String),
9832}
9833impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9834    pub fn as_str(&self) -> &str {
9835        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
9836        match self {
9837            None => "none",
9838            Unknown(v) => v,
9839        }
9840    }
9841}
9842
9843impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9844    type Err = std::convert::Infallible;
9845    fn from_str(s: &str) -> Result<Self, Self::Err> {
9846        use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
9847        match s {
9848            "none" => Ok(None),
9849            v => {
9850                tracing::warn!(
9851                    "Unknown value '{}' for enum '{}'",
9852                    v,
9853                    "CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage"
9854                );
9855                Ok(Unknown(v.to_owned()))
9856            }
9857        }
9858    }
9859}
9860impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9861    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9862        f.write_str(self.as_str())
9863    }
9864}
9865
9866impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9867    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9868        f.write_str(self.as_str())
9869    }
9870}
9871impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
9872    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9873    where
9874        S: serde::Serializer,
9875    {
9876        serializer.serialize_str(self.as_str())
9877    }
9878}
9879#[cfg(feature = "deserialize")]
9880impl<'de> serde::Deserialize<'de>
9881    for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
9882{
9883    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9884        use std::str::FromStr;
9885        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9886        Ok(Self::from_str(&s).expect("infallible"))
9887    }
9888}
9889/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
9890#[derive(Clone, Debug, serde::Serialize)]
9891pub struct CreatePaymentIntentPaymentMethodOptionsPaypal {
9892    /// Controls when the funds will be captured from the customer's account.
9893    #[serde(skip_serializing_if = "Option::is_none")]
9894    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
9895    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
9896    #[serde(skip_serializing_if = "Option::is_none")]
9897    pub preferred_locale: Option<CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
9898    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
9899    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
9900    #[serde(skip_serializing_if = "Option::is_none")]
9901    pub reference: Option<String>,
9902    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
9903    #[serde(skip_serializing_if = "Option::is_none")]
9904    pub risk_correlation_id: Option<String>,
9905    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
9906    ///
9907    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
9908    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
9909    ///
9910    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
9911    ///
9912    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
9913    ///
9914    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
9915    #[serde(skip_serializing_if = "Option::is_none")]
9916    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
9917}
9918impl CreatePaymentIntentPaymentMethodOptionsPaypal {
9919    pub fn new() -> Self {
9920        Self {
9921            capture_method: None,
9922            preferred_locale: None,
9923            reference: None,
9924            risk_correlation_id: None,
9925            setup_future_usage: None,
9926        }
9927    }
9928}
9929impl Default for CreatePaymentIntentPaymentMethodOptionsPaypal {
9930    fn default() -> Self {
9931        Self::new()
9932    }
9933}
9934/// Controls when the funds will be captured from the customer's account.
9935#[derive(Clone, Eq, PartialEq)]
9936#[non_exhaustive]
9937pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9938    Manual,
9939    /// An unrecognized value from Stripe. Should not be used as a request parameter.
9940    Unknown(String),
9941}
9942impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9943    pub fn as_str(&self) -> &str {
9944        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
9945        match self {
9946            Manual => "manual",
9947            Unknown(v) => v,
9948        }
9949    }
9950}
9951
9952impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9953    type Err = std::convert::Infallible;
9954    fn from_str(s: &str) -> Result<Self, Self::Err> {
9955        use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
9956        match s {
9957            "manual" => Ok(Manual),
9958            v => {
9959                tracing::warn!(
9960                    "Unknown value '{}' for enum '{}'",
9961                    v,
9962                    "CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod"
9963                );
9964                Ok(Unknown(v.to_owned()))
9965            }
9966        }
9967    }
9968}
9969impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9970    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9971        f.write_str(self.as_str())
9972    }
9973}
9974
9975impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9976    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9977        f.write_str(self.as_str())
9978    }
9979}
9980impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9981    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
9982    where
9983        S: serde::Serializer,
9984    {
9985        serializer.serialize_str(self.as_str())
9986    }
9987}
9988#[cfg(feature = "deserialize")]
9989impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
9990    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
9991        use std::str::FromStr;
9992        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
9993        Ok(Self::from_str(&s).expect("infallible"))
9994    }
9995}
9996/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
9997#[derive(Clone, Eq, PartialEq)]
9998#[non_exhaustive]
9999pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10000    CsMinusCz,
10001    DaMinusDk,
10002    DeMinusAt,
10003    DeMinusDe,
10004    DeMinusLu,
10005    ElMinusGr,
10006    EnMinusGb,
10007    EnMinusUs,
10008    EsMinusEs,
10009    FiMinusFi,
10010    FrMinusBe,
10011    FrMinusFr,
10012    FrMinusLu,
10013    HuMinusHu,
10014    ItMinusIt,
10015    NlMinusBe,
10016    NlMinusNl,
10017    PlMinusPl,
10018    PtMinusPt,
10019    SkMinusSk,
10020    SvMinusSe,
10021    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10022    Unknown(String),
10023}
10024impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10025    pub fn as_str(&self) -> &str {
10026        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
10027        match self {
10028            CsMinusCz => "cs-CZ",
10029            DaMinusDk => "da-DK",
10030            DeMinusAt => "de-AT",
10031            DeMinusDe => "de-DE",
10032            DeMinusLu => "de-LU",
10033            ElMinusGr => "el-GR",
10034            EnMinusGb => "en-GB",
10035            EnMinusUs => "en-US",
10036            EsMinusEs => "es-ES",
10037            FiMinusFi => "fi-FI",
10038            FrMinusBe => "fr-BE",
10039            FrMinusFr => "fr-FR",
10040            FrMinusLu => "fr-LU",
10041            HuMinusHu => "hu-HU",
10042            ItMinusIt => "it-IT",
10043            NlMinusBe => "nl-BE",
10044            NlMinusNl => "nl-NL",
10045            PlMinusPl => "pl-PL",
10046            PtMinusPt => "pt-PT",
10047            SkMinusSk => "sk-SK",
10048            SvMinusSe => "sv-SE",
10049            Unknown(v) => v,
10050        }
10051    }
10052}
10053
10054impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10055    type Err = std::convert::Infallible;
10056    fn from_str(s: &str) -> Result<Self, Self::Err> {
10057        use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
10058        match s {
10059            "cs-CZ" => Ok(CsMinusCz),
10060            "da-DK" => Ok(DaMinusDk),
10061            "de-AT" => Ok(DeMinusAt),
10062            "de-DE" => Ok(DeMinusDe),
10063            "de-LU" => Ok(DeMinusLu),
10064            "el-GR" => Ok(ElMinusGr),
10065            "en-GB" => Ok(EnMinusGb),
10066            "en-US" => Ok(EnMinusUs),
10067            "es-ES" => Ok(EsMinusEs),
10068            "fi-FI" => Ok(FiMinusFi),
10069            "fr-BE" => Ok(FrMinusBe),
10070            "fr-FR" => Ok(FrMinusFr),
10071            "fr-LU" => Ok(FrMinusLu),
10072            "hu-HU" => Ok(HuMinusHu),
10073            "it-IT" => Ok(ItMinusIt),
10074            "nl-BE" => Ok(NlMinusBe),
10075            "nl-NL" => Ok(NlMinusNl),
10076            "pl-PL" => Ok(PlMinusPl),
10077            "pt-PT" => Ok(PtMinusPt),
10078            "sk-SK" => Ok(SkMinusSk),
10079            "sv-SE" => Ok(SvMinusSe),
10080            v => {
10081                tracing::warn!(
10082                    "Unknown value '{}' for enum '{}'",
10083                    v,
10084                    "CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale"
10085                );
10086                Ok(Unknown(v.to_owned()))
10087            }
10088        }
10089    }
10090}
10091impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10092    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10093        f.write_str(self.as_str())
10094    }
10095}
10096
10097impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10099        f.write_str(self.as_str())
10100    }
10101}
10102impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10103    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10104    where
10105        S: serde::Serializer,
10106    {
10107        serializer.serialize_str(self.as_str())
10108    }
10109}
10110#[cfg(feature = "deserialize")]
10111impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
10112    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10113        use std::str::FromStr;
10114        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10115        Ok(Self::from_str(&s).expect("infallible"))
10116    }
10117}
10118/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10119///
10120/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10121/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10122///
10123/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10124///
10125/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10126///
10127/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10128#[derive(Clone, Eq, PartialEq)]
10129#[non_exhaustive]
10130pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
10131    None,
10132    OffSession,
10133    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10134    Unknown(String),
10135}
10136impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
10137    pub fn as_str(&self) -> &str {
10138        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
10139        match self {
10140            None => "none",
10141            OffSession => "off_session",
10142            Unknown(v) => v,
10143        }
10144    }
10145}
10146
10147impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
10148    type Err = std::convert::Infallible;
10149    fn from_str(s: &str) -> Result<Self, Self::Err> {
10150        use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
10151        match s {
10152            "none" => Ok(None),
10153            "off_session" => Ok(OffSession),
10154            v => {
10155                tracing::warn!(
10156                    "Unknown value '{}' for enum '{}'",
10157                    v,
10158                    "CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage"
10159                );
10160                Ok(Unknown(v.to_owned()))
10161            }
10162        }
10163    }
10164}
10165impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
10166    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10167        f.write_str(self.as_str())
10168    }
10169}
10170
10171impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
10172    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10173        f.write_str(self.as_str())
10174    }
10175}
10176impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
10177    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10178    where
10179        S: serde::Serializer,
10180    {
10181        serializer.serialize_str(self.as_str())
10182    }
10183}
10184#[cfg(feature = "deserialize")]
10185impl<'de> serde::Deserialize<'de>
10186    for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
10187{
10188    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10189        use std::str::FromStr;
10190        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10191        Ok(Self::from_str(&s).expect("infallible"))
10192    }
10193}
10194/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
10195#[derive(Clone, Debug, serde::Serialize)]
10196pub struct CreatePaymentIntentPaymentMethodOptionsPix {
10197    /// Determines if the amount includes the IOF tax. Defaults to `never`.
10198    #[serde(skip_serializing_if = "Option::is_none")]
10199    pub amount_includes_iof: Option<CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
10200    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
10201    /// Defaults to 86400 seconds.
10202    #[serde(skip_serializing_if = "Option::is_none")]
10203    pub expires_after_seconds: Option<i64>,
10204    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
10205    /// Defaults to 1 day in the future.
10206    #[serde(skip_serializing_if = "Option::is_none")]
10207    pub expires_at: Option<stripe_types::Timestamp>,
10208    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10209    ///
10210    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10211    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10212    ///
10213    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10214    ///
10215    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10216    ///
10217    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10218    #[serde(skip_serializing_if = "Option::is_none")]
10219    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
10220}
10221impl CreatePaymentIntentPaymentMethodOptionsPix {
10222    pub fn new() -> Self {
10223        Self {
10224            amount_includes_iof: None,
10225            expires_after_seconds: None,
10226            expires_at: None,
10227            setup_future_usage: None,
10228        }
10229    }
10230}
10231impl Default for CreatePaymentIntentPaymentMethodOptionsPix {
10232    fn default() -> Self {
10233        Self::new()
10234    }
10235}
10236/// Determines if the amount includes the IOF tax. Defaults to `never`.
10237#[derive(Clone, Eq, PartialEq)]
10238#[non_exhaustive]
10239pub enum CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10240    Always,
10241    Never,
10242    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10243    Unknown(String),
10244}
10245impl CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10246    pub fn as_str(&self) -> &str {
10247        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
10248        match self {
10249            Always => "always",
10250            Never => "never",
10251            Unknown(v) => v,
10252        }
10253    }
10254}
10255
10256impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10257    type Err = std::convert::Infallible;
10258    fn from_str(s: &str) -> Result<Self, Self::Err> {
10259        use CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
10260        match s {
10261            "always" => Ok(Always),
10262            "never" => Ok(Never),
10263            v => {
10264                tracing::warn!(
10265                    "Unknown value '{}' for enum '{}'",
10266                    v,
10267                    "CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof"
10268                );
10269                Ok(Unknown(v.to_owned()))
10270            }
10271        }
10272    }
10273}
10274impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10275    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10276        f.write_str(self.as_str())
10277    }
10278}
10279
10280impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10281    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10282        f.write_str(self.as_str())
10283    }
10284}
10285impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10286    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10287    where
10288        S: serde::Serializer,
10289    {
10290        serializer.serialize_str(self.as_str())
10291    }
10292}
10293#[cfg(feature = "deserialize")]
10294impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
10295    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10296        use std::str::FromStr;
10297        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10298        Ok(Self::from_str(&s).expect("infallible"))
10299    }
10300}
10301/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10302///
10303/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10304/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10305///
10306/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10307///
10308/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10309///
10310/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10311#[derive(Clone, Eq, PartialEq)]
10312#[non_exhaustive]
10313pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10314    None,
10315    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10316    Unknown(String),
10317}
10318impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10319    pub fn as_str(&self) -> &str {
10320        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
10321        match self {
10322            None => "none",
10323            Unknown(v) => v,
10324        }
10325    }
10326}
10327
10328impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10329    type Err = std::convert::Infallible;
10330    fn from_str(s: &str) -> Result<Self, Self::Err> {
10331        use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
10332        match s {
10333            "none" => Ok(None),
10334            v => {
10335                tracing::warn!(
10336                    "Unknown value '{}' for enum '{}'",
10337                    v,
10338                    "CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage"
10339                );
10340                Ok(Unknown(v.to_owned()))
10341            }
10342        }
10343    }
10344}
10345impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10346    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10347        f.write_str(self.as_str())
10348    }
10349}
10350
10351impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10352    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10353        f.write_str(self.as_str())
10354    }
10355}
10356impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10357    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10358    where
10359        S: serde::Serializer,
10360    {
10361        serializer.serialize_str(self.as_str())
10362    }
10363}
10364#[cfg(feature = "deserialize")]
10365impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
10366    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10367        use std::str::FromStr;
10368        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10369        Ok(Self::from_str(&s).expect("infallible"))
10370    }
10371}
10372/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
10373#[derive(Clone, Debug, serde::Serialize)]
10374pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay {
10375    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10376    ///
10377    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10378    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10379    ///
10380    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10381    ///
10382    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10383    ///
10384    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10385    #[serde(skip_serializing_if = "Option::is_none")]
10386    pub setup_future_usage:
10387        Option<CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
10388}
10389impl CreatePaymentIntentPaymentMethodOptionsPromptpay {
10390    pub fn new() -> Self {
10391        Self { setup_future_usage: None }
10392    }
10393}
10394impl Default for CreatePaymentIntentPaymentMethodOptionsPromptpay {
10395    fn default() -> Self {
10396        Self::new()
10397    }
10398}
10399/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10400///
10401/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10402/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10403///
10404/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10405///
10406/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10407///
10408/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10409#[derive(Clone, Eq, PartialEq)]
10410#[non_exhaustive]
10411pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
10412    None,
10413    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10414    Unknown(String),
10415}
10416impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
10417    pub fn as_str(&self) -> &str {
10418        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
10419        match self {
10420            None => "none",
10421            Unknown(v) => v,
10422        }
10423    }
10424}
10425
10426impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
10427    type Err = std::convert::Infallible;
10428    fn from_str(s: &str) -> Result<Self, Self::Err> {
10429        use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
10430        match s {
10431            "none" => Ok(None),
10432            v => {
10433                tracing::warn!(
10434                    "Unknown value '{}' for enum '{}'",
10435                    v,
10436                    "CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"
10437                );
10438                Ok(Unknown(v.to_owned()))
10439            }
10440        }
10441    }
10442}
10443impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
10444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10445        f.write_str(self.as_str())
10446    }
10447}
10448
10449impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
10450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10451        f.write_str(self.as_str())
10452    }
10453}
10454impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
10455    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10456    where
10457        S: serde::Serializer,
10458    {
10459        serializer.serialize_str(self.as_str())
10460    }
10461}
10462#[cfg(feature = "deserialize")]
10463impl<'de> serde::Deserialize<'de>
10464    for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
10465{
10466    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10467        use std::str::FromStr;
10468        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10469        Ok(Self::from_str(&s).expect("infallible"))
10470    }
10471}
10472/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
10473#[derive(Clone, Debug, serde::Serialize)]
10474pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay {
10475    /// Controls when the funds are captured from the customer's account.
10476    ///
10477    /// 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.
10478    ///
10479    /// 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.
10480    #[serde(skip_serializing_if = "Option::is_none")]
10481    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
10482    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10483    ///
10484    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10485    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10486    ///
10487    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10488    ///
10489    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10490    #[serde(skip_serializing_if = "Option::is_none")]
10491    pub setup_future_usage:
10492        Option<CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
10493}
10494impl CreatePaymentIntentPaymentMethodOptionsRevolutPay {
10495    pub fn new() -> Self {
10496        Self { capture_method: None, setup_future_usage: None }
10497    }
10498}
10499impl Default for CreatePaymentIntentPaymentMethodOptionsRevolutPay {
10500    fn default() -> Self {
10501        Self::new()
10502    }
10503}
10504/// Controls when the funds are captured from the customer's account.
10505///
10506/// 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.
10507///
10508/// 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.
10509#[derive(Clone, Eq, PartialEq)]
10510#[non_exhaustive]
10511pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
10512    Manual,
10513    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10514    Unknown(String),
10515}
10516impl CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
10517    pub fn as_str(&self) -> &str {
10518        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
10519        match self {
10520            Manual => "manual",
10521            Unknown(v) => v,
10522        }
10523    }
10524}
10525
10526impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
10527    type Err = std::convert::Infallible;
10528    fn from_str(s: &str) -> Result<Self, Self::Err> {
10529        use CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
10530        match s {
10531            "manual" => Ok(Manual),
10532            v => {
10533                tracing::warn!(
10534                    "Unknown value '{}' for enum '{}'",
10535                    v,
10536                    "CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod"
10537                );
10538                Ok(Unknown(v.to_owned()))
10539            }
10540        }
10541    }
10542}
10543impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
10544    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10545        f.write_str(self.as_str())
10546    }
10547}
10548
10549impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
10550    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10551        f.write_str(self.as_str())
10552    }
10553}
10554impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
10555    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10556    where
10557        S: serde::Serializer,
10558    {
10559        serializer.serialize_str(self.as_str())
10560    }
10561}
10562#[cfg(feature = "deserialize")]
10563impl<'de> serde::Deserialize<'de>
10564    for CreatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
10565{
10566    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10567        use std::str::FromStr;
10568        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10569        Ok(Self::from_str(&s).expect("infallible"))
10570    }
10571}
10572/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10573///
10574/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10575/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10576///
10577/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10578///
10579/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10580#[derive(Clone, Eq, PartialEq)]
10581#[non_exhaustive]
10582pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
10583    None,
10584    OffSession,
10585    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10586    Unknown(String),
10587}
10588impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
10589    pub fn as_str(&self) -> &str {
10590        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
10591        match self {
10592            None => "none",
10593            OffSession => "off_session",
10594            Unknown(v) => v,
10595        }
10596    }
10597}
10598
10599impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
10600    type Err = std::convert::Infallible;
10601    fn from_str(s: &str) -> Result<Self, Self::Err> {
10602        use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
10603        match s {
10604            "none" => Ok(None),
10605            "off_session" => Ok(OffSession),
10606            v => {
10607                tracing::warn!(
10608                    "Unknown value '{}' for enum '{}'",
10609                    v,
10610                    "CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"
10611                );
10612                Ok(Unknown(v.to_owned()))
10613            }
10614        }
10615    }
10616}
10617impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
10618    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10619        f.write_str(self.as_str())
10620    }
10621}
10622
10623impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
10624    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10625        f.write_str(self.as_str())
10626    }
10627}
10628impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
10629    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10630    where
10631        S: serde::Serializer,
10632    {
10633        serializer.serialize_str(self.as_str())
10634    }
10635}
10636#[cfg(feature = "deserialize")]
10637impl<'de> serde::Deserialize<'de>
10638    for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
10639{
10640    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10641        use std::str::FromStr;
10642        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10643        Ok(Self::from_str(&s).expect("infallible"))
10644    }
10645}
10646/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
10647#[derive(Clone, Debug, serde::Serialize)]
10648pub struct CreatePaymentIntentPaymentMethodOptionsSamsungPay {
10649    /// Controls when the funds are captured from the customer's account.
10650    ///
10651    /// 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.
10652    ///
10653    /// 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.
10654    #[serde(skip_serializing_if = "Option::is_none")]
10655    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
10656}
10657impl CreatePaymentIntentPaymentMethodOptionsSamsungPay {
10658    pub fn new() -> Self {
10659        Self { capture_method: None }
10660    }
10661}
10662impl Default for CreatePaymentIntentPaymentMethodOptionsSamsungPay {
10663    fn default() -> Self {
10664        Self::new()
10665    }
10666}
10667/// Controls when the funds are captured from the customer's account.
10668///
10669/// 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.
10670///
10671/// 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.
10672#[derive(Clone, Eq, PartialEq)]
10673#[non_exhaustive]
10674pub enum CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
10675    Manual,
10676    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10677    Unknown(String),
10678}
10679impl CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
10680    pub fn as_str(&self) -> &str {
10681        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
10682        match self {
10683            Manual => "manual",
10684            Unknown(v) => v,
10685        }
10686    }
10687}
10688
10689impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
10690    type Err = std::convert::Infallible;
10691    fn from_str(s: &str) -> Result<Self, Self::Err> {
10692        use CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
10693        match s {
10694            "manual" => Ok(Manual),
10695            v => {
10696                tracing::warn!(
10697                    "Unknown value '{}' for enum '{}'",
10698                    v,
10699                    "CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod"
10700                );
10701                Ok(Unknown(v.to_owned()))
10702            }
10703        }
10704    }
10705}
10706impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
10707    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10708        f.write_str(self.as_str())
10709    }
10710}
10711
10712impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
10713    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10714        f.write_str(self.as_str())
10715    }
10716}
10717impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
10718    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10719    where
10720        S: serde::Serializer,
10721    {
10722        serializer.serialize_str(self.as_str())
10723    }
10724}
10725#[cfg(feature = "deserialize")]
10726impl<'de> serde::Deserialize<'de>
10727    for CreatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
10728{
10729    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10730        use std::str::FromStr;
10731        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10732        Ok(Self::from_str(&s).expect("infallible"))
10733    }
10734}
10735/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
10736#[derive(Clone, Debug, serde::Serialize)]
10737pub struct CreatePaymentIntentPaymentMethodOptionsSatispay {
10738    /// Controls when the funds are captured from the customer's account.
10739    ///
10740    /// 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.
10741    ///
10742    /// 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.
10743    #[serde(skip_serializing_if = "Option::is_none")]
10744    pub capture_method: Option<CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
10745}
10746impl CreatePaymentIntentPaymentMethodOptionsSatispay {
10747    pub fn new() -> Self {
10748        Self { capture_method: None }
10749    }
10750}
10751impl Default for CreatePaymentIntentPaymentMethodOptionsSatispay {
10752    fn default() -> Self {
10753        Self::new()
10754    }
10755}
10756/// Controls when the funds are captured from the customer's account.
10757///
10758/// 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.
10759///
10760/// 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.
10761#[derive(Clone, Eq, PartialEq)]
10762#[non_exhaustive]
10763pub enum CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10764    Manual,
10765    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10766    Unknown(String),
10767}
10768impl CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10769    pub fn as_str(&self) -> &str {
10770        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
10771        match self {
10772            Manual => "manual",
10773            Unknown(v) => v,
10774        }
10775    }
10776}
10777
10778impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10779    type Err = std::convert::Infallible;
10780    fn from_str(s: &str) -> Result<Self, Self::Err> {
10781        use CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
10782        match s {
10783            "manual" => Ok(Manual),
10784            v => {
10785                tracing::warn!(
10786                    "Unknown value '{}' for enum '{}'",
10787                    v,
10788                    "CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod"
10789                );
10790                Ok(Unknown(v.to_owned()))
10791            }
10792        }
10793    }
10794}
10795impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10796    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10797        f.write_str(self.as_str())
10798    }
10799}
10800
10801impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10803        f.write_str(self.as_str())
10804    }
10805}
10806impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10807    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10808    where
10809        S: serde::Serializer,
10810    {
10811        serializer.serialize_str(self.as_str())
10812    }
10813}
10814#[cfg(feature = "deserialize")]
10815impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
10816    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10817        use std::str::FromStr;
10818        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10819        Ok(Self::from_str(&s).expect("infallible"))
10820    }
10821}
10822/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
10823#[derive(Clone, Debug, serde::Serialize)]
10824pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit {
10825    /// Additional fields for Mandate creation
10826    #[serde(skip_serializing_if = "Option::is_none")]
10827    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
10828    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10829    ///
10830    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10831    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10832    ///
10833    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10834    ///
10835    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10836    ///
10837    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10838    #[serde(skip_serializing_if = "Option::is_none")]
10839    pub setup_future_usage:
10840        Option<CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
10841    /// Controls when Stripe will attempt to debit the funds from the customer's account.
10842    /// The date must be a string in YYYY-MM-DD format.
10843    /// The date must be in the future and between 3 and 15 calendar days from now.
10844    #[serde(skip_serializing_if = "Option::is_none")]
10845    pub target_date: Option<String>,
10846}
10847impl CreatePaymentIntentPaymentMethodOptionsSepaDebit {
10848    pub fn new() -> Self {
10849        Self { mandate_options: None, setup_future_usage: None, target_date: None }
10850    }
10851}
10852impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebit {
10853    fn default() -> Self {
10854        Self::new()
10855    }
10856}
10857/// Additional fields for Mandate creation
10858#[derive(Clone, Debug, serde::Serialize)]
10859pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
10860    /// Prefix used to generate the Mandate reference.
10861    /// Must be at most 12 characters long.
10862    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
10863    /// Cannot begin with 'STRIPE'.
10864    #[serde(skip_serializing_if = "Option::is_none")]
10865    pub reference_prefix: Option<String>,
10866}
10867impl CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
10868    pub fn new() -> Self {
10869        Self { reference_prefix: None }
10870    }
10871}
10872impl Default for CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
10873    fn default() -> Self {
10874        Self::new()
10875    }
10876}
10877/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10878///
10879/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10880/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10881///
10882/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10883///
10884/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10885///
10886/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10887#[derive(Clone, Eq, PartialEq)]
10888#[non_exhaustive]
10889pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10890    None,
10891    OffSession,
10892    OnSession,
10893    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10894    Unknown(String),
10895}
10896impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10897    pub fn as_str(&self) -> &str {
10898        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
10899        match self {
10900            None => "none",
10901            OffSession => "off_session",
10902            OnSession => "on_session",
10903            Unknown(v) => v,
10904        }
10905    }
10906}
10907
10908impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10909    type Err = std::convert::Infallible;
10910    fn from_str(s: &str) -> Result<Self, Self::Err> {
10911        use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
10912        match s {
10913            "none" => Ok(None),
10914            "off_session" => Ok(OffSession),
10915            "on_session" => Ok(OnSession),
10916            v => {
10917                tracing::warn!(
10918                    "Unknown value '{}' for enum '{}'",
10919                    v,
10920                    "CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"
10921                );
10922                Ok(Unknown(v.to_owned()))
10923            }
10924        }
10925    }
10926}
10927impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10928    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10929        f.write_str(self.as_str())
10930    }
10931}
10932
10933impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10934    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10935        f.write_str(self.as_str())
10936    }
10937}
10938impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
10939    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
10940    where
10941        S: serde::Serializer,
10942    {
10943        serializer.serialize_str(self.as_str())
10944    }
10945}
10946#[cfg(feature = "deserialize")]
10947impl<'de> serde::Deserialize<'de>
10948    for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
10949{
10950    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
10951        use std::str::FromStr;
10952        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
10953        Ok(Self::from_str(&s).expect("infallible"))
10954    }
10955}
10956/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
10957#[derive(Clone, Debug, serde::Serialize)]
10958pub struct CreatePaymentIntentPaymentMethodOptionsSofort {
10959    /// Language shown to the payer on redirect.
10960    #[serde(skip_serializing_if = "Option::is_none")]
10961    pub preferred_language: Option<CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
10962    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
10963    ///
10964    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
10965    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
10966    ///
10967    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
10968    ///
10969    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
10970    ///
10971    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
10972    #[serde(skip_serializing_if = "Option::is_none")]
10973    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
10974}
10975impl CreatePaymentIntentPaymentMethodOptionsSofort {
10976    pub fn new() -> Self {
10977        Self { preferred_language: None, setup_future_usage: None }
10978    }
10979}
10980impl Default for CreatePaymentIntentPaymentMethodOptionsSofort {
10981    fn default() -> Self {
10982        Self::new()
10983    }
10984}
10985/// Language shown to the payer on redirect.
10986#[derive(Clone, Eq, PartialEq)]
10987#[non_exhaustive]
10988pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
10989    De,
10990    En,
10991    Es,
10992    Fr,
10993    It,
10994    Nl,
10995    Pl,
10996    /// An unrecognized value from Stripe. Should not be used as a request parameter.
10997    Unknown(String),
10998}
10999impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
11000    pub fn as_str(&self) -> &str {
11001        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
11002        match self {
11003            De => "de",
11004            En => "en",
11005            Es => "es",
11006            Fr => "fr",
11007            It => "it",
11008            Nl => "nl",
11009            Pl => "pl",
11010            Unknown(v) => v,
11011        }
11012    }
11013}
11014
11015impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
11016    type Err = std::convert::Infallible;
11017    fn from_str(s: &str) -> Result<Self, Self::Err> {
11018        use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
11019        match s {
11020            "de" => Ok(De),
11021            "en" => Ok(En),
11022            "es" => Ok(Es),
11023            "fr" => Ok(Fr),
11024            "it" => Ok(It),
11025            "nl" => Ok(Nl),
11026            "pl" => Ok(Pl),
11027            v => {
11028                tracing::warn!(
11029                    "Unknown value '{}' for enum '{}'",
11030                    v,
11031                    "CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage"
11032                );
11033                Ok(Unknown(v.to_owned()))
11034            }
11035        }
11036    }
11037}
11038impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
11039    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11040        f.write_str(self.as_str())
11041    }
11042}
11043
11044impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
11045    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11046        f.write_str(self.as_str())
11047    }
11048}
11049impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
11050    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11051    where
11052        S: serde::Serializer,
11053    {
11054        serializer.serialize_str(self.as_str())
11055    }
11056}
11057#[cfg(feature = "deserialize")]
11058impl<'de> serde::Deserialize<'de>
11059    for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
11060{
11061    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11062        use std::str::FromStr;
11063        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11064        Ok(Self::from_str(&s).expect("infallible"))
11065    }
11066}
11067/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11068///
11069/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11070/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11071///
11072/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11073///
11074/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11075///
11076/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11077#[derive(Clone, Eq, PartialEq)]
11078#[non_exhaustive]
11079pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
11080    None,
11081    OffSession,
11082    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11083    Unknown(String),
11084}
11085impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
11086    pub fn as_str(&self) -> &str {
11087        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
11088        match self {
11089            None => "none",
11090            OffSession => "off_session",
11091            Unknown(v) => v,
11092        }
11093    }
11094}
11095
11096impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
11097    type Err = std::convert::Infallible;
11098    fn from_str(s: &str) -> Result<Self, Self::Err> {
11099        use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
11100        match s {
11101            "none" => Ok(None),
11102            "off_session" => Ok(OffSession),
11103            v => {
11104                tracing::warn!(
11105                    "Unknown value '{}' for enum '{}'",
11106                    v,
11107                    "CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage"
11108                );
11109                Ok(Unknown(v.to_owned()))
11110            }
11111        }
11112    }
11113}
11114impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
11115    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11116        f.write_str(self.as_str())
11117    }
11118}
11119
11120impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
11121    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11122        f.write_str(self.as_str())
11123    }
11124}
11125impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
11126    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11127    where
11128        S: serde::Serializer,
11129    {
11130        serializer.serialize_str(self.as_str())
11131    }
11132}
11133#[cfg(feature = "deserialize")]
11134impl<'de> serde::Deserialize<'de>
11135    for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
11136{
11137    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11138        use std::str::FromStr;
11139        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11140        Ok(Self::from_str(&s).expect("infallible"))
11141    }
11142}
11143/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
11144#[derive(Clone, Debug, serde::Serialize)]
11145pub struct CreatePaymentIntentPaymentMethodOptionsSwish {
11146    /// A reference for this payment to be displayed in the Swish app.
11147    #[serde(skip_serializing_if = "Option::is_none")]
11148    pub reference: Option<String>,
11149    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11150    ///
11151    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11152    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11153    ///
11154    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11155    ///
11156    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11157    ///
11158    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11159    #[serde(skip_serializing_if = "Option::is_none")]
11160    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
11161}
11162impl CreatePaymentIntentPaymentMethodOptionsSwish {
11163    pub fn new() -> Self {
11164        Self { reference: None, setup_future_usage: None }
11165    }
11166}
11167impl Default for CreatePaymentIntentPaymentMethodOptionsSwish {
11168    fn default() -> Self {
11169        Self::new()
11170    }
11171}
11172/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11173///
11174/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11175/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11176///
11177/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11178///
11179/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11180///
11181/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11182#[derive(Clone, Eq, PartialEq)]
11183#[non_exhaustive]
11184pub enum CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11185    None,
11186    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11187    Unknown(String),
11188}
11189impl CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11190    pub fn as_str(&self) -> &str {
11191        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
11192        match self {
11193            None => "none",
11194            Unknown(v) => v,
11195        }
11196    }
11197}
11198
11199impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11200    type Err = std::convert::Infallible;
11201    fn from_str(s: &str) -> Result<Self, Self::Err> {
11202        use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
11203        match s {
11204            "none" => Ok(None),
11205            v => {
11206                tracing::warn!(
11207                    "Unknown value '{}' for enum '{}'",
11208                    v,
11209                    "CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage"
11210                );
11211                Ok(Unknown(v.to_owned()))
11212            }
11213        }
11214    }
11215}
11216impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11218        f.write_str(self.as_str())
11219    }
11220}
11221
11222impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11223    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11224        f.write_str(self.as_str())
11225    }
11226}
11227impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11228    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11229    where
11230        S: serde::Serializer,
11231    {
11232        serializer.serialize_str(self.as_str())
11233    }
11234}
11235#[cfg(feature = "deserialize")]
11236impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
11237    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11238        use std::str::FromStr;
11239        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11240        Ok(Self::from_str(&s).expect("infallible"))
11241    }
11242}
11243/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
11244#[derive(Clone, Debug, serde::Serialize)]
11245pub struct CreatePaymentIntentPaymentMethodOptionsTwint {
11246    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11247    ///
11248    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11249    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11250    ///
11251    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11252    ///
11253    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11254    ///
11255    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11256    #[serde(skip_serializing_if = "Option::is_none")]
11257    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
11258}
11259impl CreatePaymentIntentPaymentMethodOptionsTwint {
11260    pub fn new() -> Self {
11261        Self { setup_future_usage: None }
11262    }
11263}
11264impl Default for CreatePaymentIntentPaymentMethodOptionsTwint {
11265    fn default() -> Self {
11266        Self::new()
11267    }
11268}
11269/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11270///
11271/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11272/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11273///
11274/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11275///
11276/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11277///
11278/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11279#[derive(Clone, Eq, PartialEq)]
11280#[non_exhaustive]
11281pub enum CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11282    None,
11283    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11284    Unknown(String),
11285}
11286impl CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11287    pub fn as_str(&self) -> &str {
11288        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
11289        match self {
11290            None => "none",
11291            Unknown(v) => v,
11292        }
11293    }
11294}
11295
11296impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11297    type Err = std::convert::Infallible;
11298    fn from_str(s: &str) -> Result<Self, Self::Err> {
11299        use CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
11300        match s {
11301            "none" => Ok(None),
11302            v => {
11303                tracing::warn!(
11304                    "Unknown value '{}' for enum '{}'",
11305                    v,
11306                    "CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage"
11307                );
11308                Ok(Unknown(v.to_owned()))
11309            }
11310        }
11311    }
11312}
11313impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11314    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11315        f.write_str(self.as_str())
11316    }
11317}
11318
11319impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11320    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11321        f.write_str(self.as_str())
11322    }
11323}
11324impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11325    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11326    where
11327        S: serde::Serializer,
11328    {
11329        serializer.serialize_str(self.as_str())
11330    }
11331}
11332#[cfg(feature = "deserialize")]
11333impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
11334    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11335        use std::str::FromStr;
11336        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11337        Ok(Self::from_str(&s).expect("infallible"))
11338    }
11339}
11340/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
11341#[derive(Clone, Debug, serde::Serialize)]
11342pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
11343    /// Additional fields for Financial Connections Session creation
11344    #[serde(skip_serializing_if = "Option::is_none")]
11345    pub financial_connections:
11346        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
11347    /// Additional fields for Mandate creation
11348    #[serde(skip_serializing_if = "Option::is_none")]
11349    pub mandate_options: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
11350    /// Additional fields for network related functions
11351    #[serde(skip_serializing_if = "Option::is_none")]
11352    pub networks: Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
11353    /// Preferred transaction settlement speed
11354    #[serde(skip_serializing_if = "Option::is_none")]
11355    pub preferred_settlement_speed:
11356        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
11357    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11358    ///
11359    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11360    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11361    ///
11362    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11363    ///
11364    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11365    ///
11366    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11367    #[serde(skip_serializing_if = "Option::is_none")]
11368    pub setup_future_usage:
11369        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
11370    /// Controls when Stripe will attempt to debit the funds from the customer's account.
11371    /// The date must be a string in YYYY-MM-DD format.
11372    /// The date must be in the future and between 3 and 15 calendar days from now.
11373    #[serde(skip_serializing_if = "Option::is_none")]
11374    pub target_date: Option<String>,
11375    /// Bank account verification method.
11376    #[serde(skip_serializing_if = "Option::is_none")]
11377    pub verification_method:
11378        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
11379}
11380impl CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
11381    pub fn new() -> Self {
11382        Self {
11383            financial_connections: None,
11384            mandate_options: None,
11385            networks: None,
11386            preferred_settlement_speed: None,
11387            setup_future_usage: None,
11388            target_date: None,
11389            verification_method: None,
11390        }
11391    }
11392}
11393impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccount {
11394    fn default() -> Self {
11395        Self::new()
11396    }
11397}
11398/// Additional fields for Financial Connections Session creation
11399#[derive(Clone, Debug, serde::Serialize)]
11400pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11401    /// Provide filters for the linked accounts that the customer can select for the payment method.
11402    #[serde(skip_serializing_if = "Option::is_none")]
11403    pub filters:
11404        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
11405    /// The list of permissions to request.
11406    /// If this parameter is passed, the `payment_method` permission must be included.
11407    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
11408    #[serde(skip_serializing_if = "Option::is_none")]
11409    pub permissions: Option<
11410        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
11411    >,
11412    /// List of data features that you would like to retrieve upon account creation.
11413    #[serde(skip_serializing_if = "Option::is_none")]
11414    pub prefetch: Option<
11415        Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
11416    >,
11417    /// For webview integrations only.
11418    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
11419    #[serde(skip_serializing_if = "Option::is_none")]
11420    pub return_url: Option<String>,
11421}
11422impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11423    pub fn new() -> Self {
11424        Self { filters: None, permissions: None, prefetch: None, return_url: None }
11425    }
11426}
11427impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
11428    fn default() -> Self {
11429        Self::new()
11430    }
11431}
11432/// Provide filters for the linked accounts that the customer can select for the payment method.
11433#[derive(Clone, Debug, serde::Serialize)]
11434pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
11435        /// The account subcategories to use to filter for selectable accounts.
11436    /// Valid subcategories are `checking` and `savings`.
11437#[serde(skip_serializing_if = "Option::is_none")]
11438pub account_subcategories: Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
11439
11440}
11441impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
11442    pub fn new() -> Self {
11443        Self { account_subcategories: None }
11444    }
11445}
11446impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
11447    fn default() -> Self {
11448        Self::new()
11449    }
11450}
11451/// The account subcategories to use to filter for selectable accounts.
11452/// Valid subcategories are `checking` and `savings`.
11453#[derive(Clone, Eq, PartialEq)]
11454#[non_exhaustive]
11455pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
11456{
11457    Checking,
11458    Savings,
11459    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11460    Unknown(String),
11461}
11462impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11463    pub fn as_str(&self) -> &str {
11464        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
11465        match self {
11466Checking => "checking",
11467Savings => "savings",
11468Unknown(v) => v,
11469
11470        }
11471    }
11472}
11473
11474impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11475    type Err = std::convert::Infallible;
11476    fn from_str(s: &str) -> Result<Self, Self::Err> {
11477        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
11478        match s {
11479    "checking" => Ok(Checking),
11480"savings" => Ok(Savings),
11481v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
11482
11483        }
11484    }
11485}
11486impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11487    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11488        f.write_str(self.as_str())
11489    }
11490}
11491
11492impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11494        f.write_str(self.as_str())
11495    }
11496}
11497impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11498    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
11499        serializer.serialize_str(self.as_str())
11500    }
11501}
11502#[cfg(feature = "deserialize")]
11503impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
11504    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11505        use std::str::FromStr;
11506        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11507        Ok(Self::from_str(&s).expect("infallible"))
11508    }
11509}
11510/// The list of permissions to request.
11511/// If this parameter is passed, the `payment_method` permission must be included.
11512/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
11513#[derive(Clone, Eq, PartialEq)]
11514#[non_exhaustive]
11515pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
11516    Balances,
11517    Ownership,
11518    PaymentMethod,
11519    Transactions,
11520    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11521    Unknown(String),
11522}
11523impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
11524    pub fn as_str(&self) -> &str {
11525        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
11526        match self {
11527            Balances => "balances",
11528            Ownership => "ownership",
11529            PaymentMethod => "payment_method",
11530            Transactions => "transactions",
11531            Unknown(v) => v,
11532        }
11533    }
11534}
11535
11536impl std::str::FromStr
11537    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
11538{
11539    type Err = std::convert::Infallible;
11540    fn from_str(s: &str) -> Result<Self, Self::Err> {
11541        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
11542        match s {
11543            "balances" => Ok(Balances),
11544            "ownership" => Ok(Ownership),
11545            "payment_method" => Ok(PaymentMethod),
11546            "transactions" => Ok(Transactions),
11547            v => {
11548                tracing::warn!(
11549                    "Unknown value '{}' for enum '{}'",
11550                    v,
11551                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
11552                );
11553                Ok(Unknown(v.to_owned()))
11554            }
11555        }
11556    }
11557}
11558impl std::fmt::Display
11559    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
11560{
11561    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11562        f.write_str(self.as_str())
11563    }
11564}
11565
11566impl std::fmt::Debug
11567    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
11568{
11569    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11570        f.write_str(self.as_str())
11571    }
11572}
11573impl serde::Serialize
11574    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
11575{
11576    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11577    where
11578        S: serde::Serializer,
11579    {
11580        serializer.serialize_str(self.as_str())
11581    }
11582}
11583#[cfg(feature = "deserialize")]
11584impl<'de> serde::Deserialize<'de>
11585    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
11586{
11587    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11588        use std::str::FromStr;
11589        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11590        Ok(Self::from_str(&s).expect("infallible"))
11591    }
11592}
11593/// List of data features that you would like to retrieve upon account creation.
11594#[derive(Clone, Eq, PartialEq)]
11595#[non_exhaustive]
11596pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
11597    Balances,
11598    Ownership,
11599    Transactions,
11600    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11601    Unknown(String),
11602}
11603impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
11604    pub fn as_str(&self) -> &str {
11605        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
11606        match self {
11607            Balances => "balances",
11608            Ownership => "ownership",
11609            Transactions => "transactions",
11610            Unknown(v) => v,
11611        }
11612    }
11613}
11614
11615impl std::str::FromStr
11616    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
11617{
11618    type Err = std::convert::Infallible;
11619    fn from_str(s: &str) -> Result<Self, Self::Err> {
11620        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
11621        match s {
11622            "balances" => Ok(Balances),
11623            "ownership" => Ok(Ownership),
11624            "transactions" => Ok(Transactions),
11625            v => {
11626                tracing::warn!(
11627                    "Unknown value '{}' for enum '{}'",
11628                    v,
11629                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
11630                );
11631                Ok(Unknown(v.to_owned()))
11632            }
11633        }
11634    }
11635}
11636impl std::fmt::Display
11637    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
11638{
11639    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11640        f.write_str(self.as_str())
11641    }
11642}
11643
11644impl std::fmt::Debug
11645    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
11646{
11647    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11648        f.write_str(self.as_str())
11649    }
11650}
11651impl serde::Serialize
11652    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
11653{
11654    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11655    where
11656        S: serde::Serializer,
11657    {
11658        serializer.serialize_str(self.as_str())
11659    }
11660}
11661#[cfg(feature = "deserialize")]
11662impl<'de> serde::Deserialize<'de>
11663    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
11664{
11665    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11666        use std::str::FromStr;
11667        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11668        Ok(Self::from_str(&s).expect("infallible"))
11669    }
11670}
11671/// Additional fields for Mandate creation
11672#[derive(Clone, Debug, serde::Serialize)]
11673pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
11674    /// The method used to collect offline mandate customer acceptance.
11675    #[serde(skip_serializing_if = "Option::is_none")]
11676    pub collection_method:
11677        Option<CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
11678}
11679impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
11680    pub fn new() -> Self {
11681        Self { collection_method: None }
11682    }
11683}
11684impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
11685    fn default() -> Self {
11686        Self::new()
11687    }
11688}
11689/// The method used to collect offline mandate customer acceptance.
11690#[derive(Clone, Eq, PartialEq)]
11691#[non_exhaustive]
11692pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
11693    Paper,
11694    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11695    Unknown(String),
11696}
11697impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
11698    pub fn as_str(&self) -> &str {
11699        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
11700        match self {
11701            Paper => "paper",
11702            Unknown(v) => v,
11703        }
11704    }
11705}
11706
11707impl std::str::FromStr
11708    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
11709{
11710    type Err = std::convert::Infallible;
11711    fn from_str(s: &str) -> Result<Self, Self::Err> {
11712        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
11713        match s {
11714            "paper" => Ok(Paper),
11715            v => {
11716                tracing::warn!(
11717                    "Unknown value '{}' for enum '{}'",
11718                    v,
11719                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
11720                );
11721                Ok(Unknown(v.to_owned()))
11722            }
11723        }
11724    }
11725}
11726impl std::fmt::Display
11727    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
11728{
11729    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11730        f.write_str(self.as_str())
11731    }
11732}
11733
11734impl std::fmt::Debug
11735    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
11736{
11737    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11738        f.write_str(self.as_str())
11739    }
11740}
11741impl serde::Serialize
11742    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
11743{
11744    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11745    where
11746        S: serde::Serializer,
11747    {
11748        serializer.serialize_str(self.as_str())
11749    }
11750}
11751#[cfg(feature = "deserialize")]
11752impl<'de> serde::Deserialize<'de>
11753    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
11754{
11755    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11756        use std::str::FromStr;
11757        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11758        Ok(Self::from_str(&s).expect("infallible"))
11759    }
11760}
11761/// Additional fields for network related functions
11762#[derive(Clone, Debug, serde::Serialize)]
11763pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
11764    /// Triggers validations to run across the selected networks
11765    #[serde(skip_serializing_if = "Option::is_none")]
11766    pub requested:
11767        Option<Vec<CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
11768}
11769impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
11770    pub fn new() -> Self {
11771        Self { requested: None }
11772    }
11773}
11774impl Default for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
11775    fn default() -> Self {
11776        Self::new()
11777    }
11778}
11779/// Triggers validations to run across the selected networks
11780#[derive(Clone, Eq, PartialEq)]
11781#[non_exhaustive]
11782pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
11783    Ach,
11784    UsDomesticWire,
11785    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11786    Unknown(String),
11787}
11788impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
11789    pub fn as_str(&self) -> &str {
11790        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
11791        match self {
11792            Ach => "ach",
11793            UsDomesticWire => "us_domestic_wire",
11794            Unknown(v) => v,
11795        }
11796    }
11797}
11798
11799impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
11800    type Err = std::convert::Infallible;
11801    fn from_str(s: &str) -> Result<Self, Self::Err> {
11802        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
11803        match s {
11804            "ach" => Ok(Ach),
11805            "us_domestic_wire" => Ok(UsDomesticWire),
11806            v => {
11807                tracing::warn!(
11808                    "Unknown value '{}' for enum '{}'",
11809                    v,
11810                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
11811                );
11812                Ok(Unknown(v.to_owned()))
11813            }
11814        }
11815    }
11816}
11817impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
11818    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11819        f.write_str(self.as_str())
11820    }
11821}
11822
11823impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
11824    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11825        f.write_str(self.as_str())
11826    }
11827}
11828impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
11829    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11830    where
11831        S: serde::Serializer,
11832    {
11833        serializer.serialize_str(self.as_str())
11834    }
11835}
11836#[cfg(feature = "deserialize")]
11837impl<'de> serde::Deserialize<'de>
11838    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
11839{
11840    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11841        use std::str::FromStr;
11842        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11843        Ok(Self::from_str(&s).expect("infallible"))
11844    }
11845}
11846/// Preferred transaction settlement speed
11847#[derive(Clone, Eq, PartialEq)]
11848#[non_exhaustive]
11849pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
11850    Fastest,
11851    Standard,
11852    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11853    Unknown(String),
11854}
11855impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
11856    pub fn as_str(&self) -> &str {
11857        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
11858        match self {
11859            Fastest => "fastest",
11860            Standard => "standard",
11861            Unknown(v) => v,
11862        }
11863    }
11864}
11865
11866impl std::str::FromStr
11867    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
11868{
11869    type Err = std::convert::Infallible;
11870    fn from_str(s: &str) -> Result<Self, Self::Err> {
11871        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
11872        match s {
11873            "fastest" => Ok(Fastest),
11874            "standard" => Ok(Standard),
11875            v => {
11876                tracing::warn!(
11877                    "Unknown value '{}' for enum '{}'",
11878                    v,
11879                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"
11880                );
11881                Ok(Unknown(v.to_owned()))
11882            }
11883        }
11884    }
11885}
11886impl std::fmt::Display
11887    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
11888{
11889    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11890        f.write_str(self.as_str())
11891    }
11892}
11893
11894impl std::fmt::Debug
11895    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
11896{
11897    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11898        f.write_str(self.as_str())
11899    }
11900}
11901impl serde::Serialize
11902    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
11903{
11904    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11905    where
11906        S: serde::Serializer,
11907    {
11908        serializer.serialize_str(self.as_str())
11909    }
11910}
11911#[cfg(feature = "deserialize")]
11912impl<'de> serde::Deserialize<'de>
11913    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
11914{
11915    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11916        use std::str::FromStr;
11917        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11918        Ok(Self::from_str(&s).expect("infallible"))
11919    }
11920}
11921/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
11922///
11923/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
11924/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
11925///
11926/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
11927///
11928/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
11929///
11930/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
11931#[derive(Clone, Eq, PartialEq)]
11932#[non_exhaustive]
11933pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11934    None,
11935    OffSession,
11936    OnSession,
11937    /// An unrecognized value from Stripe. Should not be used as a request parameter.
11938    Unknown(String),
11939}
11940impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11941    pub fn as_str(&self) -> &str {
11942        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
11943        match self {
11944            None => "none",
11945            OffSession => "off_session",
11946            OnSession => "on_session",
11947            Unknown(v) => v,
11948        }
11949    }
11950}
11951
11952impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11953    type Err = std::convert::Infallible;
11954    fn from_str(s: &str) -> Result<Self, Self::Err> {
11955        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
11956        match s {
11957            "none" => Ok(None),
11958            "off_session" => Ok(OffSession),
11959            "on_session" => Ok(OnSession),
11960            v => {
11961                tracing::warn!(
11962                    "Unknown value '{}' for enum '{}'",
11963                    v,
11964                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"
11965                );
11966                Ok(Unknown(v.to_owned()))
11967            }
11968        }
11969    }
11970}
11971impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11972    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11973        f.write_str(self.as_str())
11974    }
11975}
11976
11977impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11978    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
11979        f.write_str(self.as_str())
11980    }
11981}
11982impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
11983    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
11984    where
11985        S: serde::Serializer,
11986    {
11987        serializer.serialize_str(self.as_str())
11988    }
11989}
11990#[cfg(feature = "deserialize")]
11991impl<'de> serde::Deserialize<'de>
11992    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
11993{
11994    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
11995        use std::str::FromStr;
11996        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
11997        Ok(Self::from_str(&s).expect("infallible"))
11998    }
11999}
12000/// Bank account verification method.
12001#[derive(Clone, Eq, PartialEq)]
12002#[non_exhaustive]
12003pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12004    Automatic,
12005    Instant,
12006    Microdeposits,
12007    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12008    Unknown(String),
12009}
12010impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12011    pub fn as_str(&self) -> &str {
12012        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12013        match self {
12014            Automatic => "automatic",
12015            Instant => "instant",
12016            Microdeposits => "microdeposits",
12017            Unknown(v) => v,
12018        }
12019    }
12020}
12021
12022impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12023    type Err = std::convert::Infallible;
12024    fn from_str(s: &str) -> Result<Self, Self::Err> {
12025        use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
12026        match s {
12027            "automatic" => Ok(Automatic),
12028            "instant" => Ok(Instant),
12029            "microdeposits" => Ok(Microdeposits),
12030            v => {
12031                tracing::warn!(
12032                    "Unknown value '{}' for enum '{}'",
12033                    v,
12034                    "CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
12035                );
12036                Ok(Unknown(v.to_owned()))
12037            }
12038        }
12039    }
12040}
12041impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12042    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12043        f.write_str(self.as_str())
12044    }
12045}
12046
12047impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12048    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12049        f.write_str(self.as_str())
12050    }
12051}
12052impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
12053    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12054    where
12055        S: serde::Serializer,
12056    {
12057        serializer.serialize_str(self.as_str())
12058    }
12059}
12060#[cfg(feature = "deserialize")]
12061impl<'de> serde::Deserialize<'de>
12062    for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
12063{
12064    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12065        use std::str::FromStr;
12066        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12067        Ok(Self::from_str(&s).expect("infallible"))
12068    }
12069}
12070/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
12071#[derive(Clone, Debug, serde::Serialize)]
12072pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay {
12073    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
12074    #[serde(skip_serializing_if = "Option::is_none")]
12075    pub app_id: Option<String>,
12076    /// The client type that the end customer will pay from
12077    #[serde(skip_serializing_if = "Option::is_none")]
12078    pub client: Option<CreatePaymentIntentPaymentMethodOptionsWechatPayClient>,
12079    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12080    ///
12081    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12082    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12083    ///
12084    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12085    ///
12086    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12087    ///
12088    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
12089    #[serde(skip_serializing_if = "Option::is_none")]
12090    pub setup_future_usage:
12091        Option<CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
12092}
12093impl CreatePaymentIntentPaymentMethodOptionsWechatPay {
12094    pub fn new() -> Self {
12095        Self { app_id: None, client: None, setup_future_usage: None }
12096    }
12097}
12098impl Default for CreatePaymentIntentPaymentMethodOptionsWechatPay {
12099    fn default() -> Self {
12100        Self::new()
12101    }
12102}
12103/// The client type that the end customer will pay from
12104#[derive(Clone, Eq, PartialEq)]
12105#[non_exhaustive]
12106pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12107    Android,
12108    Ios,
12109    Web,
12110    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12111    Unknown(String),
12112}
12113impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12114    pub fn as_str(&self) -> &str {
12115        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
12116        match self {
12117            Android => "android",
12118            Ios => "ios",
12119            Web => "web",
12120            Unknown(v) => v,
12121        }
12122    }
12123}
12124
12125impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12126    type Err = std::convert::Infallible;
12127    fn from_str(s: &str) -> Result<Self, Self::Err> {
12128        use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
12129        match s {
12130            "android" => Ok(Android),
12131            "ios" => Ok(Ios),
12132            "web" => Ok(Web),
12133            v => {
12134                tracing::warn!(
12135                    "Unknown value '{}' for enum '{}'",
12136                    v,
12137                    "CreatePaymentIntentPaymentMethodOptionsWechatPayClient"
12138                );
12139                Ok(Unknown(v.to_owned()))
12140            }
12141        }
12142    }
12143}
12144impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12145    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12146        f.write_str(self.as_str())
12147    }
12148}
12149
12150impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12151    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12152        f.write_str(self.as_str())
12153    }
12154}
12155impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12156    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12157    where
12158        S: serde::Serializer,
12159    {
12160        serializer.serialize_str(self.as_str())
12161    }
12162}
12163#[cfg(feature = "deserialize")]
12164impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsWechatPayClient {
12165    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12166        use std::str::FromStr;
12167        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12168        Ok(Self::from_str(&s).expect("infallible"))
12169    }
12170}
12171/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12172///
12173/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12174/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12175///
12176/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12177///
12178/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12179///
12180/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
12181#[derive(Clone, Eq, PartialEq)]
12182#[non_exhaustive]
12183pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
12184    None,
12185    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12186    Unknown(String),
12187}
12188impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
12189    pub fn as_str(&self) -> &str {
12190        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
12191        match self {
12192            None => "none",
12193            Unknown(v) => v,
12194        }
12195    }
12196}
12197
12198impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
12199    type Err = std::convert::Infallible;
12200    fn from_str(s: &str) -> Result<Self, Self::Err> {
12201        use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
12202        match s {
12203            "none" => Ok(None),
12204            v => {
12205                tracing::warn!(
12206                    "Unknown value '{}' for enum '{}'",
12207                    v,
12208                    "CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"
12209                );
12210                Ok(Unknown(v.to_owned()))
12211            }
12212        }
12213    }
12214}
12215impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
12216    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12217        f.write_str(self.as_str())
12218    }
12219}
12220
12221impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
12222    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12223        f.write_str(self.as_str())
12224    }
12225}
12226impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
12227    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12228    where
12229        S: serde::Serializer,
12230    {
12231        serializer.serialize_str(self.as_str())
12232    }
12233}
12234#[cfg(feature = "deserialize")]
12235impl<'de> serde::Deserialize<'de>
12236    for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
12237{
12238    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12239        use std::str::FromStr;
12240        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12241        Ok(Self::from_str(&s).expect("infallible"))
12242    }
12243}
12244/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
12245#[derive(Clone, Debug, serde::Serialize)]
12246pub struct CreatePaymentIntentPaymentMethodOptionsZip {
12247    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12248    ///
12249    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12250    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12251    ///
12252    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12253    ///
12254    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12255    ///
12256    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
12257    #[serde(skip_serializing_if = "Option::is_none")]
12258    pub setup_future_usage: Option<CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
12259}
12260impl CreatePaymentIntentPaymentMethodOptionsZip {
12261    pub fn new() -> Self {
12262        Self { setup_future_usage: None }
12263    }
12264}
12265impl Default for CreatePaymentIntentPaymentMethodOptionsZip {
12266    fn default() -> Self {
12267        Self::new()
12268    }
12269}
12270/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12271///
12272/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12273/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12274///
12275/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12276///
12277/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12278///
12279/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
12280#[derive(Clone, Eq, PartialEq)]
12281#[non_exhaustive]
12282pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12283    None,
12284    /// An unrecognized value from Stripe. Should not be used as a request parameter.
12285    Unknown(String),
12286}
12287impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12288    pub fn as_str(&self) -> &str {
12289        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
12290        match self {
12291            None => "none",
12292            Unknown(v) => v,
12293        }
12294    }
12295}
12296
12297impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12298    type Err = std::convert::Infallible;
12299    fn from_str(s: &str) -> Result<Self, Self::Err> {
12300        use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
12301        match s {
12302            "none" => Ok(None),
12303            v => {
12304                tracing::warn!(
12305                    "Unknown value '{}' for enum '{}'",
12306                    v,
12307                    "CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage"
12308                );
12309                Ok(Unknown(v.to_owned()))
12310            }
12311        }
12312    }
12313}
12314impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12315    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12316        f.write_str(self.as_str())
12317    }
12318}
12319
12320impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12321    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
12322        f.write_str(self.as_str())
12323    }
12324}
12325impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12326    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
12327    where
12328        S: serde::Serializer,
12329    {
12330        serializer.serialize_str(self.as_str())
12331    }
12332}
12333#[cfg(feature = "deserialize")]
12334impl<'de> serde::Deserialize<'de> for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
12335    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
12336        use std::str::FromStr;
12337        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
12338        Ok(Self::from_str(&s).expect("infallible"))
12339    }
12340}
12341/// Options to configure Radar.
12342/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
12343#[derive(Clone, Debug, serde::Serialize)]
12344pub struct CreatePaymentIntentRadarOptions {
12345    /// 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.
12346    #[serde(skip_serializing_if = "Option::is_none")]
12347    pub session: Option<String>,
12348}
12349impl CreatePaymentIntentRadarOptions {
12350    pub fn new() -> Self {
12351        Self { session: None }
12352    }
12353}
12354impl Default for CreatePaymentIntentRadarOptions {
12355    fn default() -> Self {
12356        Self::new()
12357    }
12358}
12359/// Shipping information for this PaymentIntent.
12360#[derive(Clone, Debug, serde::Serialize)]
12361pub struct CreatePaymentIntentShipping {
12362    /// Shipping address.
12363    pub address: CreatePaymentIntentShippingAddress,
12364    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
12365    #[serde(skip_serializing_if = "Option::is_none")]
12366    pub carrier: Option<String>,
12367    /// Recipient name.
12368    pub name: String,
12369    /// Recipient phone (including extension).
12370    #[serde(skip_serializing_if = "Option::is_none")]
12371    pub phone: Option<String>,
12372    /// The tracking number for a physical product, obtained from the delivery service.
12373    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
12374    #[serde(skip_serializing_if = "Option::is_none")]
12375    pub tracking_number: Option<String>,
12376}
12377impl CreatePaymentIntentShipping {
12378    pub fn new(
12379        address: impl Into<CreatePaymentIntentShippingAddress>,
12380        name: impl Into<String>,
12381    ) -> Self {
12382        Self {
12383            address: address.into(),
12384            carrier: None,
12385            name: name.into(),
12386            phone: None,
12387            tracking_number: None,
12388        }
12389    }
12390}
12391/// Shipping address.
12392#[derive(Clone, Debug, serde::Serialize)]
12393pub struct CreatePaymentIntentShippingAddress {
12394    /// City, district, suburb, town, or village.
12395    #[serde(skip_serializing_if = "Option::is_none")]
12396    pub city: Option<String>,
12397    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
12398    #[serde(skip_serializing_if = "Option::is_none")]
12399    pub country: Option<String>,
12400    /// Address line 1, such as the street, PO Box, or company name.
12401    #[serde(skip_serializing_if = "Option::is_none")]
12402    pub line1: Option<String>,
12403    /// Address line 2, such as the apartment, suite, unit, or building.
12404    #[serde(skip_serializing_if = "Option::is_none")]
12405    pub line2: Option<String>,
12406    /// ZIP or postal code.
12407    #[serde(skip_serializing_if = "Option::is_none")]
12408    pub postal_code: Option<String>,
12409    /// State, county, province, or region.
12410    #[serde(skip_serializing_if = "Option::is_none")]
12411    pub state: Option<String>,
12412}
12413impl CreatePaymentIntentShippingAddress {
12414    pub fn new() -> Self {
12415        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
12416    }
12417}
12418impl Default for CreatePaymentIntentShippingAddress {
12419    fn default() -> Self {
12420        Self::new()
12421    }
12422}
12423/// The parameters that you can use to automatically create a Transfer.
12424/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
12425#[derive(Clone, Debug, serde::Serialize)]
12426pub struct CreatePaymentIntentTransferData {
12427    /// The amount that will be transferred automatically when a charge succeeds.
12428    /// The amount is capped at the total transaction amount and if no amount is set,
12429    /// the full amount is transferred.
12430    ///
12431    /// If you intend to collect a fee and you need a more robust reporting experience, using
12432    /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount).
12433    /// might be a better fit for your integration.
12434    #[serde(skip_serializing_if = "Option::is_none")]
12435    pub amount: Option<i64>,
12436    /// If specified, successful charges will be attributed to the destination
12437    /// account for tax reporting, and the funds from charges will be transferred
12438    /// to the destination account. The ID of the resulting transfer will be
12439    /// returned on the successful charge's `transfer` field.
12440    pub destination: String,
12441}
12442impl CreatePaymentIntentTransferData {
12443    pub fn new(destination: impl Into<String>) -> Self {
12444        Self { amount: None, destination: destination.into() }
12445    }
12446}
12447/// Creates a PaymentIntent object.
12448///
12449/// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm).
12450/// to continue the payment. Learn more about [the available payment flows
12451/// with the Payment Intents API](https://stripe.com/docs/payments/payment-intents).
12452///
12453/// When you use `confirm=true` during creation, it’s equivalent to creating
12454/// and confirming the PaymentIntent in the same call. You can use any parameters
12455/// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
12456/// `confirm=true`.
12457#[derive(Clone, Debug, serde::Serialize)]
12458pub struct CreatePaymentIntent {
12459    inner: CreatePaymentIntentBuilder,
12460}
12461impl CreatePaymentIntent {
12462    /// Construct a new `CreatePaymentIntent`.
12463    pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
12464        Self { inner: CreatePaymentIntentBuilder::new(amount.into(), currency.into()) }
12465    }
12466    /// Provides industry-specific information about the amount.
12467    pub fn amount_details(
12468        mut self,
12469        amount_details: impl Into<CreatePaymentIntentAmountDetails>,
12470    ) -> Self {
12471        self.inner.amount_details = Some(amount_details.into());
12472        self
12473    }
12474    /// 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.
12475    /// The amount of the application fee collected will be capped at the total amount captured.
12476    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
12477    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
12478        self.inner.application_fee_amount = Some(application_fee_amount.into());
12479        self
12480    }
12481    /// 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.
12482    pub fn automatic_payment_methods(
12483        mut self,
12484        automatic_payment_methods: impl Into<CreatePaymentIntentAutomaticPaymentMethods>,
12485    ) -> Self {
12486        self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
12487        self
12488    }
12489    /// Controls when the funds will be captured from the customer's account.
12490    pub fn capture_method(
12491        mut self,
12492        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
12493    ) -> Self {
12494        self.inner.capture_method = Some(capture_method.into());
12495        self
12496    }
12497    /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately.
12498    /// This parameter defaults to `false`.
12499    /// 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).
12500    pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
12501        self.inner.confirm = Some(confirm.into());
12502        self
12503    }
12504    /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
12505    pub fn confirmation_method(
12506        mut self,
12507        confirmation_method: impl Into<stripe_shared::PaymentIntentConfirmationMethod>,
12508    ) -> Self {
12509        self.inner.confirmation_method = Some(confirmation_method.into());
12510        self
12511    }
12512    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
12513    ///
12514    /// 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.
12515    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
12516        self.inner.confirmation_token = Some(confirmation_token.into());
12517        self
12518    }
12519    /// ID of the Customer this PaymentIntent belongs to, if one exists.
12520    ///
12521    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
12522    ///
12523    /// 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.
12524    /// 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.
12525    pub fn customer(mut self, customer: impl Into<String>) -> Self {
12526        self.inner.customer = Some(customer.into());
12527        self
12528    }
12529    /// An arbitrary string attached to the object. Often useful for displaying to users.
12530    pub fn description(mut self, description: impl Into<String>) -> Self {
12531        self.inner.description = Some(description.into());
12532        self
12533    }
12534    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
12535    /// 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).
12536    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
12537    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
12538        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
12539        self
12540    }
12541    /// The list of payment method types to exclude from use with this payment.
12542    pub fn excluded_payment_method_types(
12543        mut self,
12544        excluded_payment_method_types: impl Into<
12545            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
12546        >,
12547    ) -> Self {
12548        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
12549        self
12550    }
12551    /// Specifies which fields in the response should be expanded.
12552    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
12553        self.inner.expand = Some(expand.into());
12554        self
12555    }
12556    /// Automations to be run during the PaymentIntent lifecycle
12557    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
12558        self.inner.hooks = Some(hooks.into());
12559        self
12560    }
12561    /// ID of the mandate that's used for this payment.
12562    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
12563    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
12564        self.inner.mandate = Some(mandate.into());
12565        self
12566    }
12567    /// This hash contains details about the Mandate to create.
12568    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
12569    pub fn mandate_data(mut self, mandate_data: impl Into<CreatePaymentIntentMandateData>) -> Self {
12570        self.inner.mandate_data = Some(mandate_data.into());
12571        self
12572    }
12573    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
12574    /// This can be useful for storing additional information about the object in a structured format.
12575    /// Individual keys can be unset by posting an empty value to them.
12576    /// All keys can be unset by posting an empty value to `metadata`.
12577    pub fn metadata(
12578        mut self,
12579        metadata: impl Into<std::collections::HashMap<String, String>>,
12580    ) -> Self {
12581        self.inner.metadata = Some(metadata.into());
12582        self
12583    }
12584    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
12585    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
12586    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
12587    pub fn off_session(mut self, off_session: impl Into<CreatePaymentIntentOffSession>) -> Self {
12588        self.inner.off_session = Some(off_session.into());
12589        self
12590    }
12591    /// The Stripe account ID that these funds are intended for.
12592    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
12593    pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
12594        self.inner.on_behalf_of = Some(on_behalf_of.into());
12595        self
12596    }
12597    /// Provides industry-specific information about the charge.
12598    pub fn payment_details(
12599        mut self,
12600        payment_details: impl Into<CreatePaymentIntentPaymentDetails>,
12601    ) -> Self {
12602        self.inner.payment_details = Some(payment_details.into());
12603        self
12604    }
12605    /// 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.
12606    ///
12607    /// 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.
12608    /// We recommend that you explicitly provide the `payment_method` moving forward.
12609    /// 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.
12610    /// end
12611    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
12612        self.inner.payment_method = Some(payment_method.into());
12613        self
12614    }
12615    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
12616    pub fn payment_method_configuration(
12617        mut self,
12618        payment_method_configuration: impl Into<String>,
12619    ) -> Self {
12620        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
12621        self
12622    }
12623    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
12624    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
12625    /// property on the PaymentIntent.
12626    pub fn payment_method_data(
12627        mut self,
12628        payment_method_data: impl Into<CreatePaymentIntentPaymentMethodData>,
12629    ) -> Self {
12630        self.inner.payment_method_data = Some(payment_method_data.into());
12631        self
12632    }
12633    /// Payment method-specific configuration for this PaymentIntent.
12634    pub fn payment_method_options(
12635        mut self,
12636        payment_method_options: impl Into<CreatePaymentIntentPaymentMethodOptions>,
12637    ) -> Self {
12638        self.inner.payment_method_options = Some(payment_method_options.into());
12639        self
12640    }
12641    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
12642    /// 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).
12643    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
12644    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
12645        self.inner.payment_method_types = Some(payment_method_types.into());
12646        self
12647    }
12648    /// Options to configure Radar.
12649    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
12650    pub fn radar_options(
12651        mut self,
12652        radar_options: impl Into<CreatePaymentIntentRadarOptions>,
12653    ) -> Self {
12654        self.inner.radar_options = Some(radar_options.into());
12655        self
12656    }
12657    /// Email address to send the receipt to.
12658    /// 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).
12659    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
12660        self.inner.receipt_email = Some(receipt_email.into());
12661        self
12662    }
12663    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
12664    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
12665    /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
12666    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
12667        self.inner.return_url = Some(return_url.into());
12668        self
12669    }
12670    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
12671    ///
12672    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
12673    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
12674    ///
12675    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
12676    ///
12677    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
12678    pub fn setup_future_usage(
12679        mut self,
12680        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
12681    ) -> Self {
12682        self.inner.setup_future_usage = Some(setup_future_usage.into());
12683        self
12684    }
12685    /// Shipping information for this PaymentIntent.
12686    pub fn shipping(mut self, shipping: impl Into<CreatePaymentIntentShipping>) -> Self {
12687        self.inner.shipping = Some(shipping.into());
12688        self
12689    }
12690    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
12691    /// This value overrides the account's default statement descriptor.
12692    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
12693    ///
12694    /// Setting this value for a card charge returns an error.
12695    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
12696    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
12697        self.inner.statement_descriptor = Some(statement_descriptor.into());
12698        self
12699    }
12700    /// Provides information about a card charge.
12701    /// 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.
12702    pub fn statement_descriptor_suffix(
12703        mut self,
12704        statement_descriptor_suffix: impl Into<String>,
12705    ) -> Self {
12706        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
12707        self
12708    }
12709    /// The parameters that you can use to automatically create a Transfer.
12710    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
12711    pub fn transfer_data(
12712        mut self,
12713        transfer_data: impl Into<CreatePaymentIntentTransferData>,
12714    ) -> Self {
12715        self.inner.transfer_data = Some(transfer_data.into());
12716        self
12717    }
12718    /// A string that identifies the resulting payment as part of a group.
12719    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers).
12720    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
12721        self.inner.transfer_group = Some(transfer_group.into());
12722        self
12723    }
12724    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
12725    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
12726        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
12727        self
12728    }
12729}
12730impl CreatePaymentIntent {
12731    /// Send the request and return the deserialized response.
12732    pub async fn send<C: StripeClient>(
12733        &self,
12734        client: &C,
12735    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12736        self.customize().send(client).await
12737    }
12738
12739    /// Send the request and return the deserialized response, blocking until completion.
12740    pub fn send_blocking<C: StripeBlockingClient>(
12741        &self,
12742        client: &C,
12743    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
12744        self.customize().send_blocking(client)
12745    }
12746}
12747
12748impl StripeRequest for CreatePaymentIntent {
12749    type Output = stripe_shared::PaymentIntent;
12750
12751    fn build(&self) -> RequestBuilder {
12752        RequestBuilder::new(StripeMethod::Post, "/payment_intents").form(&self.inner)
12753    }
12754}
12755#[derive(Clone, Debug, serde::Serialize)]
12756struct UpdatePaymentIntentBuilder {
12757    #[serde(skip_serializing_if = "Option::is_none")]
12758    amount: Option<i64>,
12759    #[serde(skip_serializing_if = "Option::is_none")]
12760    amount_details: Option<UpdatePaymentIntentAmountDetails>,
12761    #[serde(skip_serializing_if = "Option::is_none")]
12762    application_fee_amount: Option<i64>,
12763    #[serde(skip_serializing_if = "Option::is_none")]
12764    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
12765    #[serde(skip_serializing_if = "Option::is_none")]
12766    currency: Option<stripe_types::Currency>,
12767    #[serde(skip_serializing_if = "Option::is_none")]
12768    customer: Option<String>,
12769    #[serde(skip_serializing_if = "Option::is_none")]
12770    description: Option<String>,
12771    #[serde(skip_serializing_if = "Option::is_none")]
12772    excluded_payment_method_types:
12773        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
12774    #[serde(skip_serializing_if = "Option::is_none")]
12775    expand: Option<Vec<String>>,
12776    #[serde(skip_serializing_if = "Option::is_none")]
12777    hooks: Option<AsyncWorkflowsParam>,
12778    #[serde(skip_serializing_if = "Option::is_none")]
12779    metadata: Option<std::collections::HashMap<String, String>>,
12780    #[serde(skip_serializing_if = "Option::is_none")]
12781    payment_details: Option<UpdatePaymentIntentPaymentDetails>,
12782    #[serde(skip_serializing_if = "Option::is_none")]
12783    payment_method: Option<String>,
12784    #[serde(skip_serializing_if = "Option::is_none")]
12785    payment_method_configuration: Option<String>,
12786    #[serde(skip_serializing_if = "Option::is_none")]
12787    payment_method_data: Option<UpdatePaymentIntentPaymentMethodData>,
12788    #[serde(skip_serializing_if = "Option::is_none")]
12789    payment_method_options: Option<UpdatePaymentIntentPaymentMethodOptions>,
12790    #[serde(skip_serializing_if = "Option::is_none")]
12791    payment_method_types: Option<Vec<String>>,
12792    #[serde(skip_serializing_if = "Option::is_none")]
12793    receipt_email: Option<String>,
12794    #[serde(skip_serializing_if = "Option::is_none")]
12795    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
12796    #[serde(skip_serializing_if = "Option::is_none")]
12797    shipping: Option<UpdatePaymentIntentShipping>,
12798    #[serde(skip_serializing_if = "Option::is_none")]
12799    statement_descriptor: Option<String>,
12800    #[serde(skip_serializing_if = "Option::is_none")]
12801    statement_descriptor_suffix: Option<String>,
12802    #[serde(skip_serializing_if = "Option::is_none")]
12803    transfer_data: Option<UpdatePaymentIntentTransferData>,
12804    #[serde(skip_serializing_if = "Option::is_none")]
12805    transfer_group: Option<String>,
12806}
12807impl UpdatePaymentIntentBuilder {
12808    fn new() -> Self {
12809        Self {
12810            amount: None,
12811            amount_details: None,
12812            application_fee_amount: None,
12813            capture_method: None,
12814            currency: None,
12815            customer: None,
12816            description: None,
12817            excluded_payment_method_types: None,
12818            expand: None,
12819            hooks: None,
12820            metadata: None,
12821            payment_details: None,
12822            payment_method: None,
12823            payment_method_configuration: None,
12824            payment_method_data: None,
12825            payment_method_options: None,
12826            payment_method_types: None,
12827            receipt_email: None,
12828            setup_future_usage: None,
12829            shipping: None,
12830            statement_descriptor: None,
12831            statement_descriptor_suffix: None,
12832            transfer_data: None,
12833            transfer_group: None,
12834        }
12835    }
12836}
12837/// Provides industry-specific information about the amount.
12838#[derive(Clone, Debug, serde::Serialize)]
12839pub struct UpdatePaymentIntentAmountDetails {
12840    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
12841    /// An integer greater than 0.
12842    ///
12843    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
12844    #[serde(skip_serializing_if = "Option::is_none")]
12845    pub discount_amount: Option<i64>,
12846    /// A list of line items, each containing information about a product in the PaymentIntent.
12847    /// There is a maximum of 100 line items.
12848    #[serde(skip_serializing_if = "Option::is_none")]
12849    pub line_items: Option<Vec<UpdatePaymentIntentAmountDetailsLineItems>>,
12850    /// Contains information about the shipping portion of the amount.
12851    #[serde(skip_serializing_if = "Option::is_none")]
12852    pub shipping: Option<AmountDetailsShippingParam>,
12853    /// Contains information about the tax portion of the amount.
12854    #[serde(skip_serializing_if = "Option::is_none")]
12855    pub tax: Option<AmountDetailsTaxParam>,
12856}
12857impl UpdatePaymentIntentAmountDetails {
12858    pub fn new() -> Self {
12859        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
12860    }
12861}
12862impl Default for UpdatePaymentIntentAmountDetails {
12863    fn default() -> Self {
12864        Self::new()
12865    }
12866}
12867/// A list of line items, each containing information about a product in the PaymentIntent.
12868/// There is a maximum of 100 line items.
12869#[derive(Clone, Debug, serde::Serialize)]
12870pub struct UpdatePaymentIntentAmountDetailsLineItems {
12871    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
12872    /// An integer greater than 0.
12873    ///
12874    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
12875    #[serde(skip_serializing_if = "Option::is_none")]
12876    pub discount_amount: Option<i64>,
12877    /// Payment method-specific information for line items.
12878    #[serde(skip_serializing_if = "Option::is_none")]
12879    pub payment_method_options:
12880        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
12881    /// The product code of the line item, such as an SKU.
12882    /// Required for L3 rates.
12883    /// At most 12 characters long.
12884    #[serde(skip_serializing_if = "Option::is_none")]
12885    pub product_code: Option<String>,
12886    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
12887    ///
12888    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
12889    /// For Paypal, this field is truncated to 127 characters.
12890    pub product_name: String,
12891    /// The quantity of items. Required for L3 rates. An integer greater than 0.
12892    pub quantity: u64,
12893    /// Contains information about the tax on the item.
12894    #[serde(skip_serializing_if = "Option::is_none")]
12895    pub tax: Option<AmountDetailsLineItemTaxParam>,
12896    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
12897    /// Required for L3 rates.
12898    /// An integer greater than or equal to 0.
12899    pub unit_cost: i64,
12900    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
12901    #[serde(skip_serializing_if = "Option::is_none")]
12902    pub unit_of_measure: Option<String>,
12903}
12904impl UpdatePaymentIntentAmountDetailsLineItems {
12905    pub fn new(
12906        product_name: impl Into<String>,
12907        quantity: impl Into<u64>,
12908        unit_cost: impl Into<i64>,
12909    ) -> Self {
12910        Self {
12911            discount_amount: None,
12912            payment_method_options: None,
12913            product_code: None,
12914            product_name: product_name.into(),
12915            quantity: quantity.into(),
12916            tax: None,
12917            unit_cost: unit_cost.into(),
12918            unit_of_measure: None,
12919        }
12920    }
12921}
12922/// Payment method-specific information for line items.
12923#[derive(Clone, Debug, serde::Serialize)]
12924pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
12925    /// This sub-hash contains line item details that are specific to `card` payment method."
12926    #[serde(skip_serializing_if = "Option::is_none")]
12927    pub card: Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
12928    /// This sub-hash contains line item details that are specific to `card_present` payment method."
12929    #[serde(skip_serializing_if = "Option::is_none")]
12930    pub card_present:
12931        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
12932    /// This sub-hash contains line item details that are specific to `klarna` payment method."
12933    #[serde(skip_serializing_if = "Option::is_none")]
12934    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
12935    /// This sub-hash contains line item details that are specific to `paypal` payment method."
12936    #[serde(skip_serializing_if = "Option::is_none")]
12937    pub paypal: Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
12938}
12939impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
12940    pub fn new() -> Self {
12941        Self { card: None, card_present: None, klarna: None, paypal: None }
12942    }
12943}
12944impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
12945    fn default() -> Self {
12946        Self::new()
12947    }
12948}
12949/// This sub-hash contains line item details that are specific to `card` payment method."
12950#[derive(Clone, Debug, serde::Serialize)]
12951pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
12952    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
12953    #[serde(skip_serializing_if = "Option::is_none")]
12954    pub commodity_code: Option<String>,
12955}
12956impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
12957    pub fn new() -> Self {
12958        Self { commodity_code: None }
12959    }
12960}
12961impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
12962    fn default() -> Self {
12963        Self::new()
12964    }
12965}
12966/// This sub-hash contains line item details that are specific to `card_present` payment method."
12967#[derive(Clone, Debug, serde::Serialize)]
12968pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
12969    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
12970    #[serde(skip_serializing_if = "Option::is_none")]
12971    pub commodity_code: Option<String>,
12972}
12973impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
12974    pub fn new() -> Self {
12975        Self { commodity_code: None }
12976    }
12977}
12978impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
12979    fn default() -> Self {
12980        Self::new()
12981    }
12982}
12983/// This sub-hash contains line item details that are specific to `paypal` payment method."
12984#[derive(Clone, Debug, serde::Serialize)]
12985pub struct UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
12986    /// Type of the line item.
12987    #[serde(skip_serializing_if = "Option::is_none")]
12988    pub category:
12989        Option<UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
12990    /// Description of the line item.
12991    #[serde(skip_serializing_if = "Option::is_none")]
12992    pub description: Option<String>,
12993    /// The Stripe account ID of the connected account that sells the item.
12994    #[serde(skip_serializing_if = "Option::is_none")]
12995    pub sold_by: Option<String>,
12996}
12997impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
12998    pub fn new() -> Self {
12999        Self { category: None, description: None, sold_by: None }
13000    }
13001}
13002impl Default for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
13003    fn default() -> Self {
13004        Self::new()
13005    }
13006}
13007/// Type of the line item.
13008#[derive(Clone, Eq, PartialEq)]
13009#[non_exhaustive]
13010pub enum UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
13011    DigitalGoods,
13012    Donation,
13013    PhysicalGoods,
13014    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13015    Unknown(String),
13016}
13017impl UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
13018    pub fn as_str(&self) -> &str {
13019        use UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
13020        match self {
13021            DigitalGoods => "digital_goods",
13022            Donation => "donation",
13023            PhysicalGoods => "physical_goods",
13024            Unknown(v) => v,
13025        }
13026    }
13027}
13028
13029impl std::str::FromStr
13030    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
13031{
13032    type Err = std::convert::Infallible;
13033    fn from_str(s: &str) -> Result<Self, Self::Err> {
13034        use UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
13035        match s {
13036            "digital_goods" => Ok(DigitalGoods),
13037            "donation" => Ok(Donation),
13038            "physical_goods" => Ok(PhysicalGoods),
13039            v => {
13040                tracing::warn!(
13041                    "Unknown value '{}' for enum '{}'",
13042                    v,
13043                    "UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"
13044                );
13045                Ok(Unknown(v.to_owned()))
13046            }
13047        }
13048    }
13049}
13050impl std::fmt::Display
13051    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
13052{
13053    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13054        f.write_str(self.as_str())
13055    }
13056}
13057
13058impl std::fmt::Debug
13059    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
13060{
13061    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13062        f.write_str(self.as_str())
13063    }
13064}
13065impl serde::Serialize
13066    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
13067{
13068    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13069    where
13070        S: serde::Serializer,
13071    {
13072        serializer.serialize_str(self.as_str())
13073    }
13074}
13075#[cfg(feature = "deserialize")]
13076impl<'de> serde::Deserialize<'de>
13077    for UpdatePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
13078{
13079    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13080        use std::str::FromStr;
13081        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13082        Ok(Self::from_str(&s).expect("infallible"))
13083    }
13084}
13085/// Provides industry-specific information about the charge.
13086#[derive(Clone, Debug, serde::Serialize)]
13087pub struct UpdatePaymentIntentPaymentDetails {
13088    /// A unique value to identify the customer. This field is available only for card payments.
13089    ///
13090    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
13091    #[serde(skip_serializing_if = "Option::is_none")]
13092    pub customer_reference: Option<String>,
13093    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
13094    ///
13095    /// 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`.
13096    ///
13097    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
13098    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
13099    #[serde(skip_serializing_if = "Option::is_none")]
13100    pub order_reference: Option<String>,
13101}
13102impl UpdatePaymentIntentPaymentDetails {
13103    pub fn new() -> Self {
13104        Self { customer_reference: None, order_reference: None }
13105    }
13106}
13107impl Default for UpdatePaymentIntentPaymentDetails {
13108    fn default() -> Self {
13109        Self::new()
13110    }
13111}
13112/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
13113/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
13114/// property on the PaymentIntent.
13115#[derive(Clone, Debug, serde::Serialize)]
13116pub struct UpdatePaymentIntentPaymentMethodData {
13117    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
13118    #[serde(skip_serializing_if = "Option::is_none")]
13119    pub acss_debit: Option<PaymentMethodParam>,
13120    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
13121    #[serde(skip_serializing_if = "Option::is_none")]
13122    #[serde(with = "stripe_types::with_serde_json_opt")]
13123    pub affirm: Option<miniserde::json::Value>,
13124    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
13125    #[serde(skip_serializing_if = "Option::is_none")]
13126    #[serde(with = "stripe_types::with_serde_json_opt")]
13127    pub afterpay_clearpay: Option<miniserde::json::Value>,
13128    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
13129    #[serde(skip_serializing_if = "Option::is_none")]
13130    #[serde(with = "stripe_types::with_serde_json_opt")]
13131    pub alipay: Option<miniserde::json::Value>,
13132    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
13133    /// 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.
13134    /// The field defaults to `unspecified`.
13135    #[serde(skip_serializing_if = "Option::is_none")]
13136    pub allow_redisplay: Option<UpdatePaymentIntentPaymentMethodDataAllowRedisplay>,
13137    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
13138    #[serde(skip_serializing_if = "Option::is_none")]
13139    #[serde(with = "stripe_types::with_serde_json_opt")]
13140    pub alma: Option<miniserde::json::Value>,
13141    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
13142    #[serde(skip_serializing_if = "Option::is_none")]
13143    #[serde(with = "stripe_types::with_serde_json_opt")]
13144    pub amazon_pay: Option<miniserde::json::Value>,
13145    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
13146    #[serde(skip_serializing_if = "Option::is_none")]
13147    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodDataAuBecsDebit>,
13148    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
13149    #[serde(skip_serializing_if = "Option::is_none")]
13150    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodDataBacsDebit>,
13151    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
13152    #[serde(skip_serializing_if = "Option::is_none")]
13153    #[serde(with = "stripe_types::with_serde_json_opt")]
13154    pub bancontact: Option<miniserde::json::Value>,
13155    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
13156    #[serde(skip_serializing_if = "Option::is_none")]
13157    #[serde(with = "stripe_types::with_serde_json_opt")]
13158    pub billie: Option<miniserde::json::Value>,
13159    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
13160    #[serde(skip_serializing_if = "Option::is_none")]
13161    pub billing_details: Option<UpdatePaymentIntentPaymentMethodDataBillingDetails>,
13162    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
13163    #[serde(skip_serializing_if = "Option::is_none")]
13164    #[serde(with = "stripe_types::with_serde_json_opt")]
13165    pub blik: Option<miniserde::json::Value>,
13166    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
13167    #[serde(skip_serializing_if = "Option::is_none")]
13168    pub boleto: Option<UpdatePaymentIntentPaymentMethodDataBoleto>,
13169    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
13170    #[serde(skip_serializing_if = "Option::is_none")]
13171    #[serde(with = "stripe_types::with_serde_json_opt")]
13172    pub cashapp: Option<miniserde::json::Value>,
13173    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
13174    #[serde(skip_serializing_if = "Option::is_none")]
13175    #[serde(with = "stripe_types::with_serde_json_opt")]
13176    pub crypto: Option<miniserde::json::Value>,
13177    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
13178    #[serde(skip_serializing_if = "Option::is_none")]
13179    #[serde(with = "stripe_types::with_serde_json_opt")]
13180    pub customer_balance: Option<miniserde::json::Value>,
13181    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
13182    #[serde(skip_serializing_if = "Option::is_none")]
13183    pub eps: Option<UpdatePaymentIntentPaymentMethodDataEps>,
13184    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
13185    #[serde(skip_serializing_if = "Option::is_none")]
13186    pub fpx: Option<UpdatePaymentIntentPaymentMethodDataFpx>,
13187    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
13188    #[serde(skip_serializing_if = "Option::is_none")]
13189    #[serde(with = "stripe_types::with_serde_json_opt")]
13190    pub giropay: Option<miniserde::json::Value>,
13191    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
13192    #[serde(skip_serializing_if = "Option::is_none")]
13193    #[serde(with = "stripe_types::with_serde_json_opt")]
13194    pub grabpay: Option<miniserde::json::Value>,
13195    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
13196    #[serde(skip_serializing_if = "Option::is_none")]
13197    pub ideal: Option<UpdatePaymentIntentPaymentMethodDataIdeal>,
13198    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
13199    #[serde(skip_serializing_if = "Option::is_none")]
13200    #[serde(with = "stripe_types::with_serde_json_opt")]
13201    pub interac_present: Option<miniserde::json::Value>,
13202    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
13203    #[serde(skip_serializing_if = "Option::is_none")]
13204    #[serde(with = "stripe_types::with_serde_json_opt")]
13205    pub kakao_pay: Option<miniserde::json::Value>,
13206    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
13207    #[serde(skip_serializing_if = "Option::is_none")]
13208    pub klarna: Option<UpdatePaymentIntentPaymentMethodDataKlarna>,
13209    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
13210    #[serde(skip_serializing_if = "Option::is_none")]
13211    #[serde(with = "stripe_types::with_serde_json_opt")]
13212    pub konbini: Option<miniserde::json::Value>,
13213    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
13214    #[serde(skip_serializing_if = "Option::is_none")]
13215    #[serde(with = "stripe_types::with_serde_json_opt")]
13216    pub kr_card: Option<miniserde::json::Value>,
13217    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
13218    #[serde(skip_serializing_if = "Option::is_none")]
13219    #[serde(with = "stripe_types::with_serde_json_opt")]
13220    pub link: Option<miniserde::json::Value>,
13221    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
13222    #[serde(skip_serializing_if = "Option::is_none")]
13223    #[serde(with = "stripe_types::with_serde_json_opt")]
13224    pub mb_way: Option<miniserde::json::Value>,
13225    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
13226    /// This can be useful for storing additional information about the object in a structured format.
13227    /// Individual keys can be unset by posting an empty value to them.
13228    /// All keys can be unset by posting an empty value to `metadata`.
13229    #[serde(skip_serializing_if = "Option::is_none")]
13230    pub metadata: Option<std::collections::HashMap<String, String>>,
13231    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
13232    #[serde(skip_serializing_if = "Option::is_none")]
13233    #[serde(with = "stripe_types::with_serde_json_opt")]
13234    pub mobilepay: Option<miniserde::json::Value>,
13235    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
13236    #[serde(skip_serializing_if = "Option::is_none")]
13237    #[serde(with = "stripe_types::with_serde_json_opt")]
13238    pub multibanco: Option<miniserde::json::Value>,
13239    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
13240    #[serde(skip_serializing_if = "Option::is_none")]
13241    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodDataNaverPay>,
13242    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
13243    #[serde(skip_serializing_if = "Option::is_none")]
13244    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodDataNzBankAccount>,
13245    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
13246    #[serde(skip_serializing_if = "Option::is_none")]
13247    #[serde(with = "stripe_types::with_serde_json_opt")]
13248    pub oxxo: Option<miniserde::json::Value>,
13249    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
13250    #[serde(skip_serializing_if = "Option::is_none")]
13251    pub p24: Option<UpdatePaymentIntentPaymentMethodDataP24>,
13252    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
13253    #[serde(skip_serializing_if = "Option::is_none")]
13254    #[serde(with = "stripe_types::with_serde_json_opt")]
13255    pub pay_by_bank: Option<miniserde::json::Value>,
13256    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
13257    #[serde(skip_serializing_if = "Option::is_none")]
13258    #[serde(with = "stripe_types::with_serde_json_opt")]
13259    pub payco: Option<miniserde::json::Value>,
13260    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
13261    #[serde(skip_serializing_if = "Option::is_none")]
13262    #[serde(with = "stripe_types::with_serde_json_opt")]
13263    pub paynow: Option<miniserde::json::Value>,
13264    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
13265    #[serde(skip_serializing_if = "Option::is_none")]
13266    #[serde(with = "stripe_types::with_serde_json_opt")]
13267    pub paypal: Option<miniserde::json::Value>,
13268    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
13269    #[serde(skip_serializing_if = "Option::is_none")]
13270    #[serde(with = "stripe_types::with_serde_json_opt")]
13271    pub pix: Option<miniserde::json::Value>,
13272    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
13273    #[serde(skip_serializing_if = "Option::is_none")]
13274    #[serde(with = "stripe_types::with_serde_json_opt")]
13275    pub promptpay: Option<miniserde::json::Value>,
13276    /// Options to configure Radar.
13277    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
13278    #[serde(skip_serializing_if = "Option::is_none")]
13279    pub radar_options: Option<UpdatePaymentIntentPaymentMethodDataRadarOptions>,
13280    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
13281    #[serde(skip_serializing_if = "Option::is_none")]
13282    #[serde(with = "stripe_types::with_serde_json_opt")]
13283    pub revolut_pay: Option<miniserde::json::Value>,
13284    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
13285    #[serde(skip_serializing_if = "Option::is_none")]
13286    #[serde(with = "stripe_types::with_serde_json_opt")]
13287    pub samsung_pay: Option<miniserde::json::Value>,
13288    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
13289    #[serde(skip_serializing_if = "Option::is_none")]
13290    #[serde(with = "stripe_types::with_serde_json_opt")]
13291    pub satispay: Option<miniserde::json::Value>,
13292    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
13293    #[serde(skip_serializing_if = "Option::is_none")]
13294    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodDataSepaDebit>,
13295    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
13296    #[serde(skip_serializing_if = "Option::is_none")]
13297    pub sofort: Option<UpdatePaymentIntentPaymentMethodDataSofort>,
13298    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
13299    #[serde(skip_serializing_if = "Option::is_none")]
13300    #[serde(with = "stripe_types::with_serde_json_opt")]
13301    pub swish: Option<miniserde::json::Value>,
13302    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
13303    #[serde(skip_serializing_if = "Option::is_none")]
13304    #[serde(with = "stripe_types::with_serde_json_opt")]
13305    pub twint: Option<miniserde::json::Value>,
13306    /// The type of the PaymentMethod.
13307    /// An additional hash is included on the PaymentMethod with a name matching this value.
13308    /// It contains additional information specific to the PaymentMethod type.
13309    #[serde(rename = "type")]
13310    pub type_: UpdatePaymentIntentPaymentMethodDataType,
13311    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
13312    #[serde(skip_serializing_if = "Option::is_none")]
13313    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccount>,
13314    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
13315    #[serde(skip_serializing_if = "Option::is_none")]
13316    #[serde(with = "stripe_types::with_serde_json_opt")]
13317    pub wechat_pay: Option<miniserde::json::Value>,
13318    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
13319    #[serde(skip_serializing_if = "Option::is_none")]
13320    #[serde(with = "stripe_types::with_serde_json_opt")]
13321    pub zip: Option<miniserde::json::Value>,
13322}
13323impl UpdatePaymentIntentPaymentMethodData {
13324    pub fn new(type_: impl Into<UpdatePaymentIntentPaymentMethodDataType>) -> Self {
13325        Self {
13326            acss_debit: None,
13327            affirm: None,
13328            afterpay_clearpay: None,
13329            alipay: None,
13330            allow_redisplay: None,
13331            alma: None,
13332            amazon_pay: None,
13333            au_becs_debit: None,
13334            bacs_debit: None,
13335            bancontact: None,
13336            billie: None,
13337            billing_details: None,
13338            blik: None,
13339            boleto: None,
13340            cashapp: None,
13341            crypto: None,
13342            customer_balance: None,
13343            eps: None,
13344            fpx: None,
13345            giropay: None,
13346            grabpay: None,
13347            ideal: None,
13348            interac_present: None,
13349            kakao_pay: None,
13350            klarna: None,
13351            konbini: None,
13352            kr_card: None,
13353            link: None,
13354            mb_way: None,
13355            metadata: None,
13356            mobilepay: None,
13357            multibanco: None,
13358            naver_pay: None,
13359            nz_bank_account: None,
13360            oxxo: None,
13361            p24: None,
13362            pay_by_bank: None,
13363            payco: None,
13364            paynow: None,
13365            paypal: None,
13366            pix: None,
13367            promptpay: None,
13368            radar_options: None,
13369            revolut_pay: None,
13370            samsung_pay: None,
13371            satispay: None,
13372            sepa_debit: None,
13373            sofort: None,
13374            swish: None,
13375            twint: None,
13376            type_: type_.into(),
13377            us_bank_account: None,
13378            wechat_pay: None,
13379            zip: None,
13380        }
13381    }
13382}
13383/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
13384/// 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.
13385/// The field defaults to `unspecified`.
13386#[derive(Clone, Eq, PartialEq)]
13387#[non_exhaustive]
13388pub enum UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13389    Always,
13390    Limited,
13391    Unspecified,
13392    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13393    Unknown(String),
13394}
13395impl UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13396    pub fn as_str(&self) -> &str {
13397        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
13398        match self {
13399            Always => "always",
13400            Limited => "limited",
13401            Unspecified => "unspecified",
13402            Unknown(v) => v,
13403        }
13404    }
13405}
13406
13407impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13408    type Err = std::convert::Infallible;
13409    fn from_str(s: &str) -> Result<Self, Self::Err> {
13410        use UpdatePaymentIntentPaymentMethodDataAllowRedisplay::*;
13411        match s {
13412            "always" => Ok(Always),
13413            "limited" => Ok(Limited),
13414            "unspecified" => Ok(Unspecified),
13415            v => {
13416                tracing::warn!(
13417                    "Unknown value '{}' for enum '{}'",
13418                    v,
13419                    "UpdatePaymentIntentPaymentMethodDataAllowRedisplay"
13420                );
13421                Ok(Unknown(v.to_owned()))
13422            }
13423        }
13424    }
13425}
13426impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13427    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13428        f.write_str(self.as_str())
13429    }
13430}
13431
13432impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13433    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13434        f.write_str(self.as_str())
13435    }
13436}
13437impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13438    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13439    where
13440        S: serde::Serializer,
13441    {
13442        serializer.serialize_str(self.as_str())
13443    }
13444}
13445#[cfg(feature = "deserialize")]
13446impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataAllowRedisplay {
13447    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13448        use std::str::FromStr;
13449        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13450        Ok(Self::from_str(&s).expect("infallible"))
13451    }
13452}
13453/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
13454#[derive(Clone, Debug, serde::Serialize)]
13455pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
13456    /// The account number for the bank account.
13457    pub account_number: String,
13458    /// Bank-State-Branch number of the bank account.
13459    pub bsb_number: String,
13460}
13461impl UpdatePaymentIntentPaymentMethodDataAuBecsDebit {
13462    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
13463        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
13464    }
13465}
13466/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
13467#[derive(Clone, Debug, serde::Serialize)]
13468pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit {
13469    /// Account number of the bank account that the funds will be debited from.
13470    #[serde(skip_serializing_if = "Option::is_none")]
13471    pub account_number: Option<String>,
13472    /// Sort code of the bank account. (e.g., `10-20-30`)
13473    #[serde(skip_serializing_if = "Option::is_none")]
13474    pub sort_code: Option<String>,
13475}
13476impl UpdatePaymentIntentPaymentMethodDataBacsDebit {
13477    pub fn new() -> Self {
13478        Self { account_number: None, sort_code: None }
13479    }
13480}
13481impl Default for UpdatePaymentIntentPaymentMethodDataBacsDebit {
13482    fn default() -> Self {
13483        Self::new()
13484    }
13485}
13486/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
13487#[derive(Clone, Debug, serde::Serialize)]
13488pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails {
13489    /// Billing address.
13490    #[serde(skip_serializing_if = "Option::is_none")]
13491    pub address: Option<UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress>,
13492    /// Email address.
13493    #[serde(skip_serializing_if = "Option::is_none")]
13494    pub email: Option<String>,
13495    /// Full name.
13496    #[serde(skip_serializing_if = "Option::is_none")]
13497    pub name: Option<String>,
13498    /// Billing phone number (including extension).
13499    #[serde(skip_serializing_if = "Option::is_none")]
13500    pub phone: Option<String>,
13501    /// Taxpayer identification number.
13502    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
13503    #[serde(skip_serializing_if = "Option::is_none")]
13504    pub tax_id: Option<String>,
13505}
13506impl UpdatePaymentIntentPaymentMethodDataBillingDetails {
13507    pub fn new() -> Self {
13508        Self { address: None, email: None, name: None, phone: None, tax_id: None }
13509    }
13510}
13511impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetails {
13512    fn default() -> Self {
13513        Self::new()
13514    }
13515}
13516/// Billing address.
13517#[derive(Clone, Debug, serde::Serialize)]
13518pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
13519    /// City, district, suburb, town, or village.
13520    #[serde(skip_serializing_if = "Option::is_none")]
13521    pub city: Option<String>,
13522    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
13523    #[serde(skip_serializing_if = "Option::is_none")]
13524    pub country: Option<String>,
13525    /// Address line 1, such as the street, PO Box, or company name.
13526    #[serde(skip_serializing_if = "Option::is_none")]
13527    pub line1: Option<String>,
13528    /// Address line 2, such as the apartment, suite, unit, or building.
13529    #[serde(skip_serializing_if = "Option::is_none")]
13530    pub line2: Option<String>,
13531    /// ZIP or postal code.
13532    #[serde(skip_serializing_if = "Option::is_none")]
13533    pub postal_code: Option<String>,
13534    /// State, county, province, or region.
13535    #[serde(skip_serializing_if = "Option::is_none")]
13536    pub state: Option<String>,
13537}
13538impl UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
13539    pub fn new() -> Self {
13540        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
13541    }
13542}
13543impl Default for UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress {
13544    fn default() -> Self {
13545        Self::new()
13546    }
13547}
13548/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
13549#[derive(Clone, Debug, serde::Serialize)]
13550pub struct UpdatePaymentIntentPaymentMethodDataBoleto {
13551    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
13552    pub tax_id: String,
13553}
13554impl UpdatePaymentIntentPaymentMethodDataBoleto {
13555    pub fn new(tax_id: impl Into<String>) -> Self {
13556        Self { tax_id: tax_id.into() }
13557    }
13558}
13559/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
13560#[derive(Clone, Debug, serde::Serialize)]
13561pub struct UpdatePaymentIntentPaymentMethodDataEps {
13562    /// The customer's bank.
13563    #[serde(skip_serializing_if = "Option::is_none")]
13564    pub bank: Option<UpdatePaymentIntentPaymentMethodDataEpsBank>,
13565}
13566impl UpdatePaymentIntentPaymentMethodDataEps {
13567    pub fn new() -> Self {
13568        Self { bank: None }
13569    }
13570}
13571impl Default for UpdatePaymentIntentPaymentMethodDataEps {
13572    fn default() -> Self {
13573        Self::new()
13574    }
13575}
13576/// The customer's bank.
13577#[derive(Clone, Eq, PartialEq)]
13578#[non_exhaustive]
13579pub enum UpdatePaymentIntentPaymentMethodDataEpsBank {
13580    ArzteUndApothekerBank,
13581    AustrianAnadiBankAg,
13582    BankAustria,
13583    BankhausCarlSpangler,
13584    BankhausSchelhammerUndSchatteraAg,
13585    BawagPskAg,
13586    BksBankAg,
13587    BrullKallmusBankAg,
13588    BtvVierLanderBank,
13589    CapitalBankGraweGruppeAg,
13590    DeutscheBankAg,
13591    Dolomitenbank,
13592    EasybankAg,
13593    ErsteBankUndSparkassen,
13594    HypoAlpeadriabankInternationalAg,
13595    HypoBankBurgenlandAktiengesellschaft,
13596    HypoNoeLbFurNiederosterreichUWien,
13597    HypoOberosterreichSalzburgSteiermark,
13598    HypoTirolBankAg,
13599    HypoVorarlbergBankAg,
13600    MarchfelderBank,
13601    OberbankAg,
13602    RaiffeisenBankengruppeOsterreich,
13603    SchoellerbankAg,
13604    SpardaBankWien,
13605    VolksbankGruppe,
13606    VolkskreditbankAg,
13607    VrBankBraunau,
13608    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13609    Unknown(String),
13610}
13611impl UpdatePaymentIntentPaymentMethodDataEpsBank {
13612    pub fn as_str(&self) -> &str {
13613        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
13614        match self {
13615            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
13616            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
13617            BankAustria => "bank_austria",
13618            BankhausCarlSpangler => "bankhaus_carl_spangler",
13619            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
13620            BawagPskAg => "bawag_psk_ag",
13621            BksBankAg => "bks_bank_ag",
13622            BrullKallmusBankAg => "brull_kallmus_bank_ag",
13623            BtvVierLanderBank => "btv_vier_lander_bank",
13624            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
13625            DeutscheBankAg => "deutsche_bank_ag",
13626            Dolomitenbank => "dolomitenbank",
13627            EasybankAg => "easybank_ag",
13628            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
13629            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
13630            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
13631            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
13632            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
13633            HypoTirolBankAg => "hypo_tirol_bank_ag",
13634            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
13635            MarchfelderBank => "marchfelder_bank",
13636            OberbankAg => "oberbank_ag",
13637            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
13638            SchoellerbankAg => "schoellerbank_ag",
13639            SpardaBankWien => "sparda_bank_wien",
13640            VolksbankGruppe => "volksbank_gruppe",
13641            VolkskreditbankAg => "volkskreditbank_ag",
13642            VrBankBraunau => "vr_bank_braunau",
13643            Unknown(v) => v,
13644        }
13645    }
13646}
13647
13648impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataEpsBank {
13649    type Err = std::convert::Infallible;
13650    fn from_str(s: &str) -> Result<Self, Self::Err> {
13651        use UpdatePaymentIntentPaymentMethodDataEpsBank::*;
13652        match s {
13653            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
13654            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
13655            "bank_austria" => Ok(BankAustria),
13656            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
13657            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
13658            "bawag_psk_ag" => Ok(BawagPskAg),
13659            "bks_bank_ag" => Ok(BksBankAg),
13660            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
13661            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
13662            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
13663            "deutsche_bank_ag" => Ok(DeutscheBankAg),
13664            "dolomitenbank" => Ok(Dolomitenbank),
13665            "easybank_ag" => Ok(EasybankAg),
13666            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
13667            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
13668            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
13669            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
13670            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
13671            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
13672            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
13673            "marchfelder_bank" => Ok(MarchfelderBank),
13674            "oberbank_ag" => Ok(OberbankAg),
13675            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
13676            "schoellerbank_ag" => Ok(SchoellerbankAg),
13677            "sparda_bank_wien" => Ok(SpardaBankWien),
13678            "volksbank_gruppe" => Ok(VolksbankGruppe),
13679            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
13680            "vr_bank_braunau" => Ok(VrBankBraunau),
13681            v => {
13682                tracing::warn!(
13683                    "Unknown value '{}' for enum '{}'",
13684                    v,
13685                    "UpdatePaymentIntentPaymentMethodDataEpsBank"
13686                );
13687                Ok(Unknown(v.to_owned()))
13688            }
13689        }
13690    }
13691}
13692impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank {
13693    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13694        f.write_str(self.as_str())
13695    }
13696}
13697
13698impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataEpsBank {
13699    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13700        f.write_str(self.as_str())
13701    }
13702}
13703impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataEpsBank {
13704    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13705    where
13706        S: serde::Serializer,
13707    {
13708        serializer.serialize_str(self.as_str())
13709    }
13710}
13711#[cfg(feature = "deserialize")]
13712impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataEpsBank {
13713    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13714        use std::str::FromStr;
13715        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13716        Ok(Self::from_str(&s).expect("infallible"))
13717    }
13718}
13719/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
13720#[derive(Clone, Debug, serde::Serialize)]
13721pub struct UpdatePaymentIntentPaymentMethodDataFpx {
13722    /// Account holder type for FPX transaction
13723    #[serde(skip_serializing_if = "Option::is_none")]
13724    pub account_holder_type: Option<UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType>,
13725    /// The customer's bank.
13726    pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank,
13727}
13728impl UpdatePaymentIntentPaymentMethodDataFpx {
13729    pub fn new(bank: impl Into<UpdatePaymentIntentPaymentMethodDataFpxBank>) -> Self {
13730        Self { account_holder_type: None, bank: bank.into() }
13731    }
13732}
13733/// Account holder type for FPX transaction
13734#[derive(Clone, Eq, PartialEq)]
13735#[non_exhaustive]
13736pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13737    Company,
13738    Individual,
13739    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13740    Unknown(String),
13741}
13742impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13743    pub fn as_str(&self) -> &str {
13744        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
13745        match self {
13746            Company => "company",
13747            Individual => "individual",
13748            Unknown(v) => v,
13749        }
13750    }
13751}
13752
13753impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13754    type Err = std::convert::Infallible;
13755    fn from_str(s: &str) -> Result<Self, Self::Err> {
13756        use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*;
13757        match s {
13758            "company" => Ok(Company),
13759            "individual" => Ok(Individual),
13760            v => {
13761                tracing::warn!(
13762                    "Unknown value '{}' for enum '{}'",
13763                    v,
13764                    "UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType"
13765                );
13766                Ok(Unknown(v.to_owned()))
13767            }
13768        }
13769    }
13770}
13771impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13773        f.write_str(self.as_str())
13774    }
13775}
13776
13777impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13778    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13779        f.write_str(self.as_str())
13780    }
13781}
13782impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13783    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13784    where
13785        S: serde::Serializer,
13786    {
13787        serializer.serialize_str(self.as_str())
13788    }
13789}
13790#[cfg(feature = "deserialize")]
13791impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType {
13792    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13793        use std::str::FromStr;
13794        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13795        Ok(Self::from_str(&s).expect("infallible"))
13796    }
13797}
13798/// The customer's bank.
13799#[derive(Clone, Eq, PartialEq)]
13800#[non_exhaustive]
13801pub enum UpdatePaymentIntentPaymentMethodDataFpxBank {
13802    AffinBank,
13803    Agrobank,
13804    AllianceBank,
13805    Ambank,
13806    BankIslam,
13807    BankMuamalat,
13808    BankOfChina,
13809    BankRakyat,
13810    Bsn,
13811    Cimb,
13812    DeutscheBank,
13813    HongLeongBank,
13814    Hsbc,
13815    Kfh,
13816    Maybank2e,
13817    Maybank2u,
13818    Ocbc,
13819    PbEnterprise,
13820    PublicBank,
13821    Rhb,
13822    StandardChartered,
13823    Uob,
13824    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13825    Unknown(String),
13826}
13827impl UpdatePaymentIntentPaymentMethodDataFpxBank {
13828    pub fn as_str(&self) -> &str {
13829        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
13830        match self {
13831            AffinBank => "affin_bank",
13832            Agrobank => "agrobank",
13833            AllianceBank => "alliance_bank",
13834            Ambank => "ambank",
13835            BankIslam => "bank_islam",
13836            BankMuamalat => "bank_muamalat",
13837            BankOfChina => "bank_of_china",
13838            BankRakyat => "bank_rakyat",
13839            Bsn => "bsn",
13840            Cimb => "cimb",
13841            DeutscheBank => "deutsche_bank",
13842            HongLeongBank => "hong_leong_bank",
13843            Hsbc => "hsbc",
13844            Kfh => "kfh",
13845            Maybank2e => "maybank2e",
13846            Maybank2u => "maybank2u",
13847            Ocbc => "ocbc",
13848            PbEnterprise => "pb_enterprise",
13849            PublicBank => "public_bank",
13850            Rhb => "rhb",
13851            StandardChartered => "standard_chartered",
13852            Uob => "uob",
13853            Unknown(v) => v,
13854        }
13855    }
13856}
13857
13858impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxBank {
13859    type Err = std::convert::Infallible;
13860    fn from_str(s: &str) -> Result<Self, Self::Err> {
13861        use UpdatePaymentIntentPaymentMethodDataFpxBank::*;
13862        match s {
13863            "affin_bank" => Ok(AffinBank),
13864            "agrobank" => Ok(Agrobank),
13865            "alliance_bank" => Ok(AllianceBank),
13866            "ambank" => Ok(Ambank),
13867            "bank_islam" => Ok(BankIslam),
13868            "bank_muamalat" => Ok(BankMuamalat),
13869            "bank_of_china" => Ok(BankOfChina),
13870            "bank_rakyat" => Ok(BankRakyat),
13871            "bsn" => Ok(Bsn),
13872            "cimb" => Ok(Cimb),
13873            "deutsche_bank" => Ok(DeutscheBank),
13874            "hong_leong_bank" => Ok(HongLeongBank),
13875            "hsbc" => Ok(Hsbc),
13876            "kfh" => Ok(Kfh),
13877            "maybank2e" => Ok(Maybank2e),
13878            "maybank2u" => Ok(Maybank2u),
13879            "ocbc" => Ok(Ocbc),
13880            "pb_enterprise" => Ok(PbEnterprise),
13881            "public_bank" => Ok(PublicBank),
13882            "rhb" => Ok(Rhb),
13883            "standard_chartered" => Ok(StandardChartered),
13884            "uob" => Ok(Uob),
13885            v => {
13886                tracing::warn!(
13887                    "Unknown value '{}' for enum '{}'",
13888                    v,
13889                    "UpdatePaymentIntentPaymentMethodDataFpxBank"
13890                );
13891                Ok(Unknown(v.to_owned()))
13892            }
13893        }
13894    }
13895}
13896impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank {
13897    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13898        f.write_str(self.as_str())
13899    }
13900}
13901
13902impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxBank {
13903    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
13904        f.write_str(self.as_str())
13905    }
13906}
13907impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxBank {
13908    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
13909    where
13910        S: serde::Serializer,
13911    {
13912        serializer.serialize_str(self.as_str())
13913    }
13914}
13915#[cfg(feature = "deserialize")]
13916impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataFpxBank {
13917    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
13918        use std::str::FromStr;
13919        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
13920        Ok(Self::from_str(&s).expect("infallible"))
13921    }
13922}
13923/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
13924#[derive(Clone, Debug, serde::Serialize)]
13925pub struct UpdatePaymentIntentPaymentMethodDataIdeal {
13926    /// The customer's bank.
13927    /// Only use this parameter for existing customers.
13928    /// Don't use it for new customers.
13929    #[serde(skip_serializing_if = "Option::is_none")]
13930    pub bank: Option<UpdatePaymentIntentPaymentMethodDataIdealBank>,
13931}
13932impl UpdatePaymentIntentPaymentMethodDataIdeal {
13933    pub fn new() -> Self {
13934        Self { bank: None }
13935    }
13936}
13937impl Default for UpdatePaymentIntentPaymentMethodDataIdeal {
13938    fn default() -> Self {
13939        Self::new()
13940    }
13941}
13942/// The customer's bank.
13943/// Only use this parameter for existing customers.
13944/// Don't use it for new customers.
13945#[derive(Clone, Eq, PartialEq)]
13946#[non_exhaustive]
13947pub enum UpdatePaymentIntentPaymentMethodDataIdealBank {
13948    AbnAmro,
13949    AsnBank,
13950    Bunq,
13951    Buut,
13952    Finom,
13953    Handelsbanken,
13954    Ing,
13955    Knab,
13956    Moneyou,
13957    N26,
13958    Nn,
13959    Rabobank,
13960    Regiobank,
13961    Revolut,
13962    SnsBank,
13963    TriodosBank,
13964    VanLanschot,
13965    Yoursafe,
13966    /// An unrecognized value from Stripe. Should not be used as a request parameter.
13967    Unknown(String),
13968}
13969impl UpdatePaymentIntentPaymentMethodDataIdealBank {
13970    pub fn as_str(&self) -> &str {
13971        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
13972        match self {
13973            AbnAmro => "abn_amro",
13974            AsnBank => "asn_bank",
13975            Bunq => "bunq",
13976            Buut => "buut",
13977            Finom => "finom",
13978            Handelsbanken => "handelsbanken",
13979            Ing => "ing",
13980            Knab => "knab",
13981            Moneyou => "moneyou",
13982            N26 => "n26",
13983            Nn => "nn",
13984            Rabobank => "rabobank",
13985            Regiobank => "regiobank",
13986            Revolut => "revolut",
13987            SnsBank => "sns_bank",
13988            TriodosBank => "triodos_bank",
13989            VanLanschot => "van_lanschot",
13990            Yoursafe => "yoursafe",
13991            Unknown(v) => v,
13992        }
13993    }
13994}
13995
13996impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataIdealBank {
13997    type Err = std::convert::Infallible;
13998    fn from_str(s: &str) -> Result<Self, Self::Err> {
13999        use UpdatePaymentIntentPaymentMethodDataIdealBank::*;
14000        match s {
14001            "abn_amro" => Ok(AbnAmro),
14002            "asn_bank" => Ok(AsnBank),
14003            "bunq" => Ok(Bunq),
14004            "buut" => Ok(Buut),
14005            "finom" => Ok(Finom),
14006            "handelsbanken" => Ok(Handelsbanken),
14007            "ing" => Ok(Ing),
14008            "knab" => Ok(Knab),
14009            "moneyou" => Ok(Moneyou),
14010            "n26" => Ok(N26),
14011            "nn" => Ok(Nn),
14012            "rabobank" => Ok(Rabobank),
14013            "regiobank" => Ok(Regiobank),
14014            "revolut" => Ok(Revolut),
14015            "sns_bank" => Ok(SnsBank),
14016            "triodos_bank" => Ok(TriodosBank),
14017            "van_lanschot" => Ok(VanLanschot),
14018            "yoursafe" => Ok(Yoursafe),
14019            v => {
14020                tracing::warn!(
14021                    "Unknown value '{}' for enum '{}'",
14022                    v,
14023                    "UpdatePaymentIntentPaymentMethodDataIdealBank"
14024                );
14025                Ok(Unknown(v.to_owned()))
14026            }
14027        }
14028    }
14029}
14030impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank {
14031    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14032        f.write_str(self.as_str())
14033    }
14034}
14035
14036impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataIdealBank {
14037    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14038        f.write_str(self.as_str())
14039    }
14040}
14041impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataIdealBank {
14042    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14043    where
14044        S: serde::Serializer,
14045    {
14046        serializer.serialize_str(self.as_str())
14047    }
14048}
14049#[cfg(feature = "deserialize")]
14050impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataIdealBank {
14051    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14052        use std::str::FromStr;
14053        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14054        Ok(Self::from_str(&s).expect("infallible"))
14055    }
14056}
14057/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
14058#[derive(Copy, Clone, Debug, serde::Serialize)]
14059pub struct UpdatePaymentIntentPaymentMethodDataKlarna {
14060    /// Customer's date of birth
14061    #[serde(skip_serializing_if = "Option::is_none")]
14062    pub dob: Option<DateOfBirth>,
14063}
14064impl UpdatePaymentIntentPaymentMethodDataKlarna {
14065    pub fn new() -> Self {
14066        Self { dob: None }
14067    }
14068}
14069impl Default for UpdatePaymentIntentPaymentMethodDataKlarna {
14070    fn default() -> Self {
14071        Self::new()
14072    }
14073}
14074/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
14075#[derive(Clone, Debug, serde::Serialize)]
14076pub struct UpdatePaymentIntentPaymentMethodDataNaverPay {
14077    /// Whether to use Naver Pay points or a card to fund this transaction.
14078    /// If not provided, this defaults to `card`.
14079    #[serde(skip_serializing_if = "Option::is_none")]
14080    pub funding: Option<UpdatePaymentIntentPaymentMethodDataNaverPayFunding>,
14081}
14082impl UpdatePaymentIntentPaymentMethodDataNaverPay {
14083    pub fn new() -> Self {
14084        Self { funding: None }
14085    }
14086}
14087impl Default for UpdatePaymentIntentPaymentMethodDataNaverPay {
14088    fn default() -> Self {
14089        Self::new()
14090    }
14091}
14092/// Whether to use Naver Pay points or a card to fund this transaction.
14093/// If not provided, this defaults to `card`.
14094#[derive(Clone, Eq, PartialEq)]
14095#[non_exhaustive]
14096pub enum UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14097    Card,
14098    Points,
14099    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14100    Unknown(String),
14101}
14102impl UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14103    pub fn as_str(&self) -> &str {
14104        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
14105        match self {
14106            Card => "card",
14107            Points => "points",
14108            Unknown(v) => v,
14109        }
14110    }
14111}
14112
14113impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14114    type Err = std::convert::Infallible;
14115    fn from_str(s: &str) -> Result<Self, Self::Err> {
14116        use UpdatePaymentIntentPaymentMethodDataNaverPayFunding::*;
14117        match s {
14118            "card" => Ok(Card),
14119            "points" => Ok(Points),
14120            v => {
14121                tracing::warn!(
14122                    "Unknown value '{}' for enum '{}'",
14123                    v,
14124                    "UpdatePaymentIntentPaymentMethodDataNaverPayFunding"
14125                );
14126                Ok(Unknown(v.to_owned()))
14127            }
14128        }
14129    }
14130}
14131impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14132    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14133        f.write_str(self.as_str())
14134    }
14135}
14136
14137impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14138    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14139        f.write_str(self.as_str())
14140    }
14141}
14142impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14143    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14144    where
14145        S: serde::Serializer,
14146    {
14147        serializer.serialize_str(self.as_str())
14148    }
14149}
14150#[cfg(feature = "deserialize")]
14151impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataNaverPayFunding {
14152    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14153        use std::str::FromStr;
14154        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14155        Ok(Self::from_str(&s).expect("infallible"))
14156    }
14157}
14158/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
14159#[derive(Clone, Debug, serde::Serialize)]
14160pub struct UpdatePaymentIntentPaymentMethodDataNzBankAccount {
14161    /// The name on the bank account.
14162    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
14163    #[serde(skip_serializing_if = "Option::is_none")]
14164    pub account_holder_name: Option<String>,
14165    /// The account number for the bank account.
14166    pub account_number: String,
14167    /// The numeric code for the bank account's bank.
14168    pub bank_code: String,
14169    /// The numeric code for the bank account's bank branch.
14170    pub branch_code: String,
14171    #[serde(skip_serializing_if = "Option::is_none")]
14172    pub reference: Option<String>,
14173    /// The suffix of the bank account number.
14174    pub suffix: String,
14175}
14176impl UpdatePaymentIntentPaymentMethodDataNzBankAccount {
14177    pub fn new(
14178        account_number: impl Into<String>,
14179        bank_code: impl Into<String>,
14180        branch_code: impl Into<String>,
14181        suffix: impl Into<String>,
14182    ) -> Self {
14183        Self {
14184            account_holder_name: None,
14185            account_number: account_number.into(),
14186            bank_code: bank_code.into(),
14187            branch_code: branch_code.into(),
14188            reference: None,
14189            suffix: suffix.into(),
14190        }
14191    }
14192}
14193/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
14194#[derive(Clone, Debug, serde::Serialize)]
14195pub struct UpdatePaymentIntentPaymentMethodDataP24 {
14196    /// The customer's bank.
14197    #[serde(skip_serializing_if = "Option::is_none")]
14198    pub bank: Option<UpdatePaymentIntentPaymentMethodDataP24Bank>,
14199}
14200impl UpdatePaymentIntentPaymentMethodDataP24 {
14201    pub fn new() -> Self {
14202        Self { bank: None }
14203    }
14204}
14205impl Default for UpdatePaymentIntentPaymentMethodDataP24 {
14206    fn default() -> Self {
14207        Self::new()
14208    }
14209}
14210/// The customer's bank.
14211#[derive(Clone, Eq, PartialEq)]
14212#[non_exhaustive]
14213pub enum UpdatePaymentIntentPaymentMethodDataP24Bank {
14214    AliorBank,
14215    BankMillennium,
14216    BankNowyBfgSa,
14217    BankPekaoSa,
14218    BankiSpbdzielcze,
14219    Blik,
14220    BnpParibas,
14221    Boz,
14222    CitiHandlowy,
14223    CreditAgricole,
14224    Envelobank,
14225    EtransferPocztowy24,
14226    GetinBank,
14227    Ideabank,
14228    Ing,
14229    Inteligo,
14230    MbankMtransfer,
14231    NestPrzelew,
14232    NoblePay,
14233    PbacZIpko,
14234    PlusBank,
14235    SantanderPrzelew24,
14236    TmobileUsbugiBankowe,
14237    ToyotaBank,
14238    Velobank,
14239    VolkswagenBank,
14240    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14241    Unknown(String),
14242}
14243impl UpdatePaymentIntentPaymentMethodDataP24Bank {
14244    pub fn as_str(&self) -> &str {
14245        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
14246        match self {
14247            AliorBank => "alior_bank",
14248            BankMillennium => "bank_millennium",
14249            BankNowyBfgSa => "bank_nowy_bfg_sa",
14250            BankPekaoSa => "bank_pekao_sa",
14251            BankiSpbdzielcze => "banki_spbdzielcze",
14252            Blik => "blik",
14253            BnpParibas => "bnp_paribas",
14254            Boz => "boz",
14255            CitiHandlowy => "citi_handlowy",
14256            CreditAgricole => "credit_agricole",
14257            Envelobank => "envelobank",
14258            EtransferPocztowy24 => "etransfer_pocztowy24",
14259            GetinBank => "getin_bank",
14260            Ideabank => "ideabank",
14261            Ing => "ing",
14262            Inteligo => "inteligo",
14263            MbankMtransfer => "mbank_mtransfer",
14264            NestPrzelew => "nest_przelew",
14265            NoblePay => "noble_pay",
14266            PbacZIpko => "pbac_z_ipko",
14267            PlusBank => "plus_bank",
14268            SantanderPrzelew24 => "santander_przelew24",
14269            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
14270            ToyotaBank => "toyota_bank",
14271            Velobank => "velobank",
14272            VolkswagenBank => "volkswagen_bank",
14273            Unknown(v) => v,
14274        }
14275    }
14276}
14277
14278impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataP24Bank {
14279    type Err = std::convert::Infallible;
14280    fn from_str(s: &str) -> Result<Self, Self::Err> {
14281        use UpdatePaymentIntentPaymentMethodDataP24Bank::*;
14282        match s {
14283            "alior_bank" => Ok(AliorBank),
14284            "bank_millennium" => Ok(BankMillennium),
14285            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
14286            "bank_pekao_sa" => Ok(BankPekaoSa),
14287            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
14288            "blik" => Ok(Blik),
14289            "bnp_paribas" => Ok(BnpParibas),
14290            "boz" => Ok(Boz),
14291            "citi_handlowy" => Ok(CitiHandlowy),
14292            "credit_agricole" => Ok(CreditAgricole),
14293            "envelobank" => Ok(Envelobank),
14294            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
14295            "getin_bank" => Ok(GetinBank),
14296            "ideabank" => Ok(Ideabank),
14297            "ing" => Ok(Ing),
14298            "inteligo" => Ok(Inteligo),
14299            "mbank_mtransfer" => Ok(MbankMtransfer),
14300            "nest_przelew" => Ok(NestPrzelew),
14301            "noble_pay" => Ok(NoblePay),
14302            "pbac_z_ipko" => Ok(PbacZIpko),
14303            "plus_bank" => Ok(PlusBank),
14304            "santander_przelew24" => Ok(SantanderPrzelew24),
14305            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
14306            "toyota_bank" => Ok(ToyotaBank),
14307            "velobank" => Ok(Velobank),
14308            "volkswagen_bank" => Ok(VolkswagenBank),
14309            v => {
14310                tracing::warn!(
14311                    "Unknown value '{}' for enum '{}'",
14312                    v,
14313                    "UpdatePaymentIntentPaymentMethodDataP24Bank"
14314                );
14315                Ok(Unknown(v.to_owned()))
14316            }
14317        }
14318    }
14319}
14320impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank {
14321    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14322        f.write_str(self.as_str())
14323    }
14324}
14325
14326impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataP24Bank {
14327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14328        f.write_str(self.as_str())
14329    }
14330}
14331impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataP24Bank {
14332    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14333    where
14334        S: serde::Serializer,
14335    {
14336        serializer.serialize_str(self.as_str())
14337    }
14338}
14339#[cfg(feature = "deserialize")]
14340impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataP24Bank {
14341    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14342        use std::str::FromStr;
14343        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14344        Ok(Self::from_str(&s).expect("infallible"))
14345    }
14346}
14347/// Options to configure Radar.
14348/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
14349#[derive(Clone, Debug, serde::Serialize)]
14350pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions {
14351    /// 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.
14352    #[serde(skip_serializing_if = "Option::is_none")]
14353    pub session: Option<String>,
14354}
14355impl UpdatePaymentIntentPaymentMethodDataRadarOptions {
14356    pub fn new() -> Self {
14357        Self { session: None }
14358    }
14359}
14360impl Default for UpdatePaymentIntentPaymentMethodDataRadarOptions {
14361    fn default() -> Self {
14362        Self::new()
14363    }
14364}
14365/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
14366#[derive(Clone, Debug, serde::Serialize)]
14367pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit {
14368    /// IBAN of the bank account.
14369    pub iban: String,
14370}
14371impl UpdatePaymentIntentPaymentMethodDataSepaDebit {
14372    pub fn new(iban: impl Into<String>) -> Self {
14373        Self { iban: iban.into() }
14374    }
14375}
14376/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
14377#[derive(Clone, Debug, serde::Serialize)]
14378pub struct UpdatePaymentIntentPaymentMethodDataSofort {
14379    /// Two-letter ISO code representing the country the bank account is located in.
14380    pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry,
14381}
14382impl UpdatePaymentIntentPaymentMethodDataSofort {
14383    pub fn new(country: impl Into<UpdatePaymentIntentPaymentMethodDataSofortCountry>) -> Self {
14384        Self { country: country.into() }
14385    }
14386}
14387/// Two-letter ISO code representing the country the bank account is located in.
14388#[derive(Clone, Eq, PartialEq)]
14389#[non_exhaustive]
14390pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry {
14391    At,
14392    Be,
14393    De,
14394    Es,
14395    It,
14396    Nl,
14397    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14398    Unknown(String),
14399}
14400impl UpdatePaymentIntentPaymentMethodDataSofortCountry {
14401    pub fn as_str(&self) -> &str {
14402        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
14403        match self {
14404            At => "AT",
14405            Be => "BE",
14406            De => "DE",
14407            Es => "ES",
14408            It => "IT",
14409            Nl => "NL",
14410            Unknown(v) => v,
14411        }
14412    }
14413}
14414
14415impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataSofortCountry {
14416    type Err = std::convert::Infallible;
14417    fn from_str(s: &str) -> Result<Self, Self::Err> {
14418        use UpdatePaymentIntentPaymentMethodDataSofortCountry::*;
14419        match s {
14420            "AT" => Ok(At),
14421            "BE" => Ok(Be),
14422            "DE" => Ok(De),
14423            "ES" => Ok(Es),
14424            "IT" => Ok(It),
14425            "NL" => Ok(Nl),
14426            v => {
14427                tracing::warn!(
14428                    "Unknown value '{}' for enum '{}'",
14429                    v,
14430                    "UpdatePaymentIntentPaymentMethodDataSofortCountry"
14431                );
14432                Ok(Unknown(v.to_owned()))
14433            }
14434        }
14435    }
14436}
14437impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry {
14438    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14439        f.write_str(self.as_str())
14440    }
14441}
14442
14443impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataSofortCountry {
14444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14445        f.write_str(self.as_str())
14446    }
14447}
14448impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataSofortCountry {
14449    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14450    where
14451        S: serde::Serializer,
14452    {
14453        serializer.serialize_str(self.as_str())
14454    }
14455}
14456#[cfg(feature = "deserialize")]
14457impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataSofortCountry {
14458    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14459        use std::str::FromStr;
14460        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14461        Ok(Self::from_str(&s).expect("infallible"))
14462    }
14463}
14464/// The type of the PaymentMethod.
14465/// An additional hash is included on the PaymentMethod with a name matching this value.
14466/// It contains additional information specific to the PaymentMethod type.
14467#[derive(Clone, Eq, PartialEq)]
14468#[non_exhaustive]
14469pub enum UpdatePaymentIntentPaymentMethodDataType {
14470    AcssDebit,
14471    Affirm,
14472    AfterpayClearpay,
14473    Alipay,
14474    Alma,
14475    AmazonPay,
14476    AuBecsDebit,
14477    BacsDebit,
14478    Bancontact,
14479    Billie,
14480    Blik,
14481    Boleto,
14482    Cashapp,
14483    Crypto,
14484    CustomerBalance,
14485    Eps,
14486    Fpx,
14487    Giropay,
14488    Grabpay,
14489    Ideal,
14490    KakaoPay,
14491    Klarna,
14492    Konbini,
14493    KrCard,
14494    Link,
14495    MbWay,
14496    Mobilepay,
14497    Multibanco,
14498    NaverPay,
14499    NzBankAccount,
14500    Oxxo,
14501    P24,
14502    PayByBank,
14503    Payco,
14504    Paynow,
14505    Paypal,
14506    Pix,
14507    Promptpay,
14508    RevolutPay,
14509    SamsungPay,
14510    Satispay,
14511    SepaDebit,
14512    Sofort,
14513    Swish,
14514    Twint,
14515    UsBankAccount,
14516    WechatPay,
14517    Zip,
14518    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14519    Unknown(String),
14520}
14521impl UpdatePaymentIntentPaymentMethodDataType {
14522    pub fn as_str(&self) -> &str {
14523        use UpdatePaymentIntentPaymentMethodDataType::*;
14524        match self {
14525            AcssDebit => "acss_debit",
14526            Affirm => "affirm",
14527            AfterpayClearpay => "afterpay_clearpay",
14528            Alipay => "alipay",
14529            Alma => "alma",
14530            AmazonPay => "amazon_pay",
14531            AuBecsDebit => "au_becs_debit",
14532            BacsDebit => "bacs_debit",
14533            Bancontact => "bancontact",
14534            Billie => "billie",
14535            Blik => "blik",
14536            Boleto => "boleto",
14537            Cashapp => "cashapp",
14538            Crypto => "crypto",
14539            CustomerBalance => "customer_balance",
14540            Eps => "eps",
14541            Fpx => "fpx",
14542            Giropay => "giropay",
14543            Grabpay => "grabpay",
14544            Ideal => "ideal",
14545            KakaoPay => "kakao_pay",
14546            Klarna => "klarna",
14547            Konbini => "konbini",
14548            KrCard => "kr_card",
14549            Link => "link",
14550            MbWay => "mb_way",
14551            Mobilepay => "mobilepay",
14552            Multibanco => "multibanco",
14553            NaverPay => "naver_pay",
14554            NzBankAccount => "nz_bank_account",
14555            Oxxo => "oxxo",
14556            P24 => "p24",
14557            PayByBank => "pay_by_bank",
14558            Payco => "payco",
14559            Paynow => "paynow",
14560            Paypal => "paypal",
14561            Pix => "pix",
14562            Promptpay => "promptpay",
14563            RevolutPay => "revolut_pay",
14564            SamsungPay => "samsung_pay",
14565            Satispay => "satispay",
14566            SepaDebit => "sepa_debit",
14567            Sofort => "sofort",
14568            Swish => "swish",
14569            Twint => "twint",
14570            UsBankAccount => "us_bank_account",
14571            WechatPay => "wechat_pay",
14572            Zip => "zip",
14573            Unknown(v) => v,
14574        }
14575    }
14576}
14577
14578impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataType {
14579    type Err = std::convert::Infallible;
14580    fn from_str(s: &str) -> Result<Self, Self::Err> {
14581        use UpdatePaymentIntentPaymentMethodDataType::*;
14582        match s {
14583            "acss_debit" => Ok(AcssDebit),
14584            "affirm" => Ok(Affirm),
14585            "afterpay_clearpay" => Ok(AfterpayClearpay),
14586            "alipay" => Ok(Alipay),
14587            "alma" => Ok(Alma),
14588            "amazon_pay" => Ok(AmazonPay),
14589            "au_becs_debit" => Ok(AuBecsDebit),
14590            "bacs_debit" => Ok(BacsDebit),
14591            "bancontact" => Ok(Bancontact),
14592            "billie" => Ok(Billie),
14593            "blik" => Ok(Blik),
14594            "boleto" => Ok(Boleto),
14595            "cashapp" => Ok(Cashapp),
14596            "crypto" => Ok(Crypto),
14597            "customer_balance" => Ok(CustomerBalance),
14598            "eps" => Ok(Eps),
14599            "fpx" => Ok(Fpx),
14600            "giropay" => Ok(Giropay),
14601            "grabpay" => Ok(Grabpay),
14602            "ideal" => Ok(Ideal),
14603            "kakao_pay" => Ok(KakaoPay),
14604            "klarna" => Ok(Klarna),
14605            "konbini" => Ok(Konbini),
14606            "kr_card" => Ok(KrCard),
14607            "link" => Ok(Link),
14608            "mb_way" => Ok(MbWay),
14609            "mobilepay" => Ok(Mobilepay),
14610            "multibanco" => Ok(Multibanco),
14611            "naver_pay" => Ok(NaverPay),
14612            "nz_bank_account" => Ok(NzBankAccount),
14613            "oxxo" => Ok(Oxxo),
14614            "p24" => Ok(P24),
14615            "pay_by_bank" => Ok(PayByBank),
14616            "payco" => Ok(Payco),
14617            "paynow" => Ok(Paynow),
14618            "paypal" => Ok(Paypal),
14619            "pix" => Ok(Pix),
14620            "promptpay" => Ok(Promptpay),
14621            "revolut_pay" => Ok(RevolutPay),
14622            "samsung_pay" => Ok(SamsungPay),
14623            "satispay" => Ok(Satispay),
14624            "sepa_debit" => Ok(SepaDebit),
14625            "sofort" => Ok(Sofort),
14626            "swish" => Ok(Swish),
14627            "twint" => Ok(Twint),
14628            "us_bank_account" => Ok(UsBankAccount),
14629            "wechat_pay" => Ok(WechatPay),
14630            "zip" => Ok(Zip),
14631            v => {
14632                tracing::warn!(
14633                    "Unknown value '{}' for enum '{}'",
14634                    v,
14635                    "UpdatePaymentIntentPaymentMethodDataType"
14636                );
14637                Ok(Unknown(v.to_owned()))
14638            }
14639        }
14640    }
14641}
14642impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType {
14643    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14644        f.write_str(self.as_str())
14645    }
14646}
14647
14648impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataType {
14649    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14650        f.write_str(self.as_str())
14651    }
14652}
14653impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataType {
14654    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14655    where
14656        S: serde::Serializer,
14657    {
14658        serializer.serialize_str(self.as_str())
14659    }
14660}
14661#[cfg(feature = "deserialize")]
14662impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataType {
14663    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14664        use std::str::FromStr;
14665        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14666        Ok(Self::from_str(&s).expect("infallible"))
14667    }
14668}
14669/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
14670#[derive(Clone, Debug, serde::Serialize)]
14671pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount {
14672    /// Account holder type: individual or company.
14673    #[serde(skip_serializing_if = "Option::is_none")]
14674    pub account_holder_type:
14675        Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
14676    /// Account number of the bank account.
14677    #[serde(skip_serializing_if = "Option::is_none")]
14678    pub account_number: Option<String>,
14679    /// Account type: checkings or savings. Defaults to checking if omitted.
14680    #[serde(skip_serializing_if = "Option::is_none")]
14681    pub account_type: Option<UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType>,
14682    /// The ID of a Financial Connections Account to use as a payment method.
14683    #[serde(skip_serializing_if = "Option::is_none")]
14684    pub financial_connections_account: Option<String>,
14685    /// Routing number of the bank account.
14686    #[serde(skip_serializing_if = "Option::is_none")]
14687    pub routing_number: Option<String>,
14688}
14689impl UpdatePaymentIntentPaymentMethodDataUsBankAccount {
14690    pub fn new() -> Self {
14691        Self {
14692            account_holder_type: None,
14693            account_number: None,
14694            account_type: None,
14695            financial_connections_account: None,
14696            routing_number: None,
14697        }
14698    }
14699}
14700impl Default for UpdatePaymentIntentPaymentMethodDataUsBankAccount {
14701    fn default() -> Self {
14702        Self::new()
14703    }
14704}
14705/// Account holder type: individual or company.
14706#[derive(Clone, Eq, PartialEq)]
14707#[non_exhaustive]
14708pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
14709    Company,
14710    Individual,
14711    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14712    Unknown(String),
14713}
14714impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
14715    pub fn as_str(&self) -> &str {
14716        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
14717        match self {
14718            Company => "company",
14719            Individual => "individual",
14720            Unknown(v) => v,
14721        }
14722    }
14723}
14724
14725impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
14726    type Err = std::convert::Infallible;
14727    fn from_str(s: &str) -> Result<Self, Self::Err> {
14728        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
14729        match s {
14730            "company" => Ok(Company),
14731            "individual" => Ok(Individual),
14732            v => {
14733                tracing::warn!(
14734                    "Unknown value '{}' for enum '{}'",
14735                    v,
14736                    "UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"
14737                );
14738                Ok(Unknown(v.to_owned()))
14739            }
14740        }
14741    }
14742}
14743impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
14744    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14745        f.write_str(self.as_str())
14746    }
14747}
14748
14749impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
14750    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14751        f.write_str(self.as_str())
14752    }
14753}
14754impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
14755    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14756    where
14757        S: serde::Serializer,
14758    {
14759        serializer.serialize_str(self.as_str())
14760    }
14761}
14762#[cfg(feature = "deserialize")]
14763impl<'de> serde::Deserialize<'de>
14764    for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
14765{
14766    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14767        use std::str::FromStr;
14768        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14769        Ok(Self::from_str(&s).expect("infallible"))
14770    }
14771}
14772/// Account type: checkings or savings. Defaults to checking if omitted.
14773#[derive(Clone, Eq, PartialEq)]
14774#[non_exhaustive]
14775pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14776    Checking,
14777    Savings,
14778    /// An unrecognized value from Stripe. Should not be used as a request parameter.
14779    Unknown(String),
14780}
14781impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14782    pub fn as_str(&self) -> &str {
14783        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
14784        match self {
14785            Checking => "checking",
14786            Savings => "savings",
14787            Unknown(v) => v,
14788        }
14789    }
14790}
14791
14792impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14793    type Err = std::convert::Infallible;
14794    fn from_str(s: &str) -> Result<Self, Self::Err> {
14795        use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
14796        match s {
14797            "checking" => Ok(Checking),
14798            "savings" => Ok(Savings),
14799            v => {
14800                tracing::warn!(
14801                    "Unknown value '{}' for enum '{}'",
14802                    v,
14803                    "UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType"
14804                );
14805                Ok(Unknown(v.to_owned()))
14806            }
14807        }
14808    }
14809}
14810impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14812        f.write_str(self.as_str())
14813    }
14814}
14815
14816impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
14818        f.write_str(self.as_str())
14819    }
14820}
14821impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14822    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
14823    where
14824        S: serde::Serializer,
14825    {
14826        serializer.serialize_str(self.as_str())
14827    }
14828}
14829#[cfg(feature = "deserialize")]
14830impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType {
14831    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
14832        use std::str::FromStr;
14833        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
14834        Ok(Self::from_str(&s).expect("infallible"))
14835    }
14836}
14837/// Payment-method-specific configuration for this PaymentIntent.
14838#[derive(Clone, Debug, serde::Serialize)]
14839pub struct UpdatePaymentIntentPaymentMethodOptions {
14840    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
14841    #[serde(skip_serializing_if = "Option::is_none")]
14842    pub acss_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebit>,
14843    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
14844    #[serde(skip_serializing_if = "Option::is_none")]
14845    pub affirm: Option<UpdatePaymentIntentPaymentMethodOptionsAffirm>,
14846    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
14847    #[serde(skip_serializing_if = "Option::is_none")]
14848    pub afterpay_clearpay: Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay>,
14849    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
14850    #[serde(skip_serializing_if = "Option::is_none")]
14851    pub alipay: Option<UpdatePaymentIntentPaymentMethodOptionsAlipay>,
14852    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
14853    #[serde(skip_serializing_if = "Option::is_none")]
14854    pub alma: Option<UpdatePaymentIntentPaymentMethodOptionsAlma>,
14855    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
14856    #[serde(skip_serializing_if = "Option::is_none")]
14857    pub amazon_pay: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPay>,
14858    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
14859    #[serde(skip_serializing_if = "Option::is_none")]
14860    pub au_becs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit>,
14861    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
14862    #[serde(skip_serializing_if = "Option::is_none")]
14863    pub bacs_debit: Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebit>,
14864    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
14865    #[serde(skip_serializing_if = "Option::is_none")]
14866    pub bancontact: Option<UpdatePaymentIntentPaymentMethodOptionsBancontact>,
14867    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
14868    #[serde(skip_serializing_if = "Option::is_none")]
14869    pub billie: Option<UpdatePaymentIntentPaymentMethodOptionsBillie>,
14870    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
14871    #[serde(skip_serializing_if = "Option::is_none")]
14872    pub blik: Option<UpdatePaymentIntentPaymentMethodOptionsBlik>,
14873    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
14874    #[serde(skip_serializing_if = "Option::is_none")]
14875    pub boleto: Option<UpdatePaymentIntentPaymentMethodOptionsBoleto>,
14876    /// Configuration for any card payments attempted on this PaymentIntent.
14877    #[serde(skip_serializing_if = "Option::is_none")]
14878    pub card: Option<UpdatePaymentIntentPaymentMethodOptionsCard>,
14879    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
14880    #[serde(skip_serializing_if = "Option::is_none")]
14881    pub card_present: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresent>,
14882    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
14883    #[serde(skip_serializing_if = "Option::is_none")]
14884    pub cashapp: Option<UpdatePaymentIntentPaymentMethodOptionsCashapp>,
14885    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
14886    #[serde(skip_serializing_if = "Option::is_none")]
14887    pub crypto: Option<UpdatePaymentIntentPaymentMethodOptionsCrypto>,
14888    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
14889    #[serde(skip_serializing_if = "Option::is_none")]
14890    pub customer_balance: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalance>,
14891    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
14892    #[serde(skip_serializing_if = "Option::is_none")]
14893    pub eps: Option<UpdatePaymentIntentPaymentMethodOptionsEps>,
14894    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
14895    #[serde(skip_serializing_if = "Option::is_none")]
14896    pub fpx: Option<UpdatePaymentIntentPaymentMethodOptionsFpx>,
14897    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
14898    #[serde(skip_serializing_if = "Option::is_none")]
14899    pub giropay: Option<UpdatePaymentIntentPaymentMethodOptionsGiropay>,
14900    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
14901    #[serde(skip_serializing_if = "Option::is_none")]
14902    pub grabpay: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpay>,
14903    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
14904    #[serde(skip_serializing_if = "Option::is_none")]
14905    pub ideal: Option<UpdatePaymentIntentPaymentMethodOptionsIdeal>,
14906    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
14907    #[serde(skip_serializing_if = "Option::is_none")]
14908    #[serde(with = "stripe_types::with_serde_json_opt")]
14909    pub interac_present: Option<miniserde::json::Value>,
14910    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
14911    #[serde(skip_serializing_if = "Option::is_none")]
14912    pub kakao_pay: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPay>,
14913    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
14914    #[serde(skip_serializing_if = "Option::is_none")]
14915    pub klarna: Option<UpdatePaymentIntentPaymentMethodOptionsKlarna>,
14916    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
14917    #[serde(skip_serializing_if = "Option::is_none")]
14918    pub konbini: Option<UpdatePaymentIntentPaymentMethodOptionsKonbini>,
14919    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
14920    #[serde(skip_serializing_if = "Option::is_none")]
14921    pub kr_card: Option<UpdatePaymentIntentPaymentMethodOptionsKrCard>,
14922    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
14923    #[serde(skip_serializing_if = "Option::is_none")]
14924    pub link: Option<UpdatePaymentIntentPaymentMethodOptionsLink>,
14925    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
14926    #[serde(skip_serializing_if = "Option::is_none")]
14927    pub mb_way: Option<UpdatePaymentIntentPaymentMethodOptionsMbWay>,
14928    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
14929    #[serde(skip_serializing_if = "Option::is_none")]
14930    pub mobilepay: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepay>,
14931    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
14932    #[serde(skip_serializing_if = "Option::is_none")]
14933    pub multibanco: Option<UpdatePaymentIntentPaymentMethodOptionsMultibanco>,
14934    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
14935    #[serde(skip_serializing_if = "Option::is_none")]
14936    pub naver_pay: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPay>,
14937    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
14938    #[serde(skip_serializing_if = "Option::is_none")]
14939    pub nz_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccount>,
14940    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
14941    #[serde(skip_serializing_if = "Option::is_none")]
14942    pub oxxo: Option<UpdatePaymentIntentPaymentMethodOptionsOxxo>,
14943    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
14944    #[serde(skip_serializing_if = "Option::is_none")]
14945    pub p24: Option<UpdatePaymentIntentPaymentMethodOptionsP24>,
14946    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
14947    #[serde(skip_serializing_if = "Option::is_none")]
14948    #[serde(with = "stripe_types::with_serde_json_opt")]
14949    pub pay_by_bank: Option<miniserde::json::Value>,
14950    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
14951    #[serde(skip_serializing_if = "Option::is_none")]
14952    pub payco: Option<UpdatePaymentIntentPaymentMethodOptionsPayco>,
14953    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
14954    #[serde(skip_serializing_if = "Option::is_none")]
14955    pub paynow: Option<UpdatePaymentIntentPaymentMethodOptionsPaynow>,
14956    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
14957    #[serde(skip_serializing_if = "Option::is_none")]
14958    pub paypal: Option<UpdatePaymentIntentPaymentMethodOptionsPaypal>,
14959    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
14960    #[serde(skip_serializing_if = "Option::is_none")]
14961    pub pix: Option<UpdatePaymentIntentPaymentMethodOptionsPix>,
14962    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
14963    #[serde(skip_serializing_if = "Option::is_none")]
14964    pub promptpay: Option<UpdatePaymentIntentPaymentMethodOptionsPromptpay>,
14965    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
14966    #[serde(skip_serializing_if = "Option::is_none")]
14967    pub revolut_pay: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPay>,
14968    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
14969    #[serde(skip_serializing_if = "Option::is_none")]
14970    pub samsung_pay: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPay>,
14971    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
14972    #[serde(skip_serializing_if = "Option::is_none")]
14973    pub satispay: Option<UpdatePaymentIntentPaymentMethodOptionsSatispay>,
14974    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
14975    #[serde(skip_serializing_if = "Option::is_none")]
14976    pub sepa_debit: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebit>,
14977    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
14978    #[serde(skip_serializing_if = "Option::is_none")]
14979    pub sofort: Option<UpdatePaymentIntentPaymentMethodOptionsSofort>,
14980    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
14981    #[serde(skip_serializing_if = "Option::is_none")]
14982    pub swish: Option<UpdatePaymentIntentPaymentMethodOptionsSwish>,
14983    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
14984    #[serde(skip_serializing_if = "Option::is_none")]
14985    pub twint: Option<UpdatePaymentIntentPaymentMethodOptionsTwint>,
14986    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
14987    #[serde(skip_serializing_if = "Option::is_none")]
14988    pub us_bank_account: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccount>,
14989    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
14990    #[serde(skip_serializing_if = "Option::is_none")]
14991    pub wechat_pay: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPay>,
14992    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
14993    #[serde(skip_serializing_if = "Option::is_none")]
14994    pub zip: Option<UpdatePaymentIntentPaymentMethodOptionsZip>,
14995}
14996impl UpdatePaymentIntentPaymentMethodOptions {
14997    pub fn new() -> Self {
14998        Self {
14999            acss_debit: None,
15000            affirm: None,
15001            afterpay_clearpay: None,
15002            alipay: None,
15003            alma: None,
15004            amazon_pay: None,
15005            au_becs_debit: None,
15006            bacs_debit: None,
15007            bancontact: None,
15008            billie: None,
15009            blik: None,
15010            boleto: None,
15011            card: None,
15012            card_present: None,
15013            cashapp: None,
15014            crypto: None,
15015            customer_balance: None,
15016            eps: None,
15017            fpx: None,
15018            giropay: None,
15019            grabpay: None,
15020            ideal: None,
15021            interac_present: None,
15022            kakao_pay: None,
15023            klarna: None,
15024            konbini: None,
15025            kr_card: None,
15026            link: None,
15027            mb_way: None,
15028            mobilepay: None,
15029            multibanco: None,
15030            naver_pay: None,
15031            nz_bank_account: None,
15032            oxxo: None,
15033            p24: None,
15034            pay_by_bank: None,
15035            payco: None,
15036            paynow: None,
15037            paypal: None,
15038            pix: None,
15039            promptpay: None,
15040            revolut_pay: None,
15041            samsung_pay: None,
15042            satispay: None,
15043            sepa_debit: None,
15044            sofort: None,
15045            swish: None,
15046            twint: None,
15047            us_bank_account: None,
15048            wechat_pay: None,
15049            zip: None,
15050        }
15051    }
15052}
15053impl Default for UpdatePaymentIntentPaymentMethodOptions {
15054    fn default() -> Self {
15055        Self::new()
15056    }
15057}
15058/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
15059#[derive(Clone, Debug, serde::Serialize)]
15060pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
15061    /// Additional fields for Mandate creation
15062    #[serde(skip_serializing_if = "Option::is_none")]
15063    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
15064    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15065    ///
15066    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15067    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15068    ///
15069    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15070    ///
15071    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15072    ///
15073    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15074    #[serde(skip_serializing_if = "Option::is_none")]
15075    pub setup_future_usage:
15076        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
15077    /// Controls when Stripe will attempt to debit the funds from the customer's account.
15078    /// The date must be a string in YYYY-MM-DD format.
15079    /// The date must be in the future and between 3 and 15 calendar days from now.
15080    #[serde(skip_serializing_if = "Option::is_none")]
15081    pub target_date: Option<String>,
15082    /// Bank account verification method.
15083    #[serde(skip_serializing_if = "Option::is_none")]
15084    pub verification_method:
15085        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
15086}
15087impl UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
15088    pub fn new() -> Self {
15089        Self {
15090            mandate_options: None,
15091            setup_future_usage: None,
15092            target_date: None,
15093            verification_method: None,
15094        }
15095    }
15096}
15097impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebit {
15098    fn default() -> Self {
15099        Self::new()
15100    }
15101}
15102/// Additional fields for Mandate creation
15103#[derive(Clone, Debug, serde::Serialize)]
15104pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
15105    /// A URL for custom mandate text to render during confirmation step.
15106    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
15107    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
15108    #[serde(skip_serializing_if = "Option::is_none")]
15109    pub custom_mandate_url: Option<String>,
15110    /// Description of the mandate interval.
15111    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
15112    #[serde(skip_serializing_if = "Option::is_none")]
15113    pub interval_description: Option<String>,
15114    /// Payment schedule for the mandate.
15115    #[serde(skip_serializing_if = "Option::is_none")]
15116    pub payment_schedule:
15117        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
15118    /// Transaction type of the mandate.
15119    #[serde(skip_serializing_if = "Option::is_none")]
15120    pub transaction_type:
15121        Option<UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
15122}
15123impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
15124    pub fn new() -> Self {
15125        Self {
15126            custom_mandate_url: None,
15127            interval_description: None,
15128            payment_schedule: None,
15129            transaction_type: None,
15130        }
15131    }
15132}
15133impl Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
15134    fn default() -> Self {
15135        Self::new()
15136    }
15137}
15138/// Payment schedule for the mandate.
15139#[derive(Clone, Eq, PartialEq)]
15140#[non_exhaustive]
15141pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
15142    Combined,
15143    Interval,
15144    Sporadic,
15145    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15146    Unknown(String),
15147}
15148impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
15149    pub fn as_str(&self) -> &str {
15150        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
15151        match self {
15152            Combined => "combined",
15153            Interval => "interval",
15154            Sporadic => "sporadic",
15155            Unknown(v) => v,
15156        }
15157    }
15158}
15159
15160impl std::str::FromStr
15161    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15162{
15163    type Err = std::convert::Infallible;
15164    fn from_str(s: &str) -> Result<Self, Self::Err> {
15165        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
15166        match s {
15167            "combined" => Ok(Combined),
15168            "interval" => Ok(Interval),
15169            "sporadic" => Ok(Sporadic),
15170            v => {
15171                tracing::warn!(
15172                    "Unknown value '{}' for enum '{}'",
15173                    v,
15174                    "UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
15175                );
15176                Ok(Unknown(v.to_owned()))
15177            }
15178        }
15179    }
15180}
15181impl std::fmt::Display
15182    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15183{
15184    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15185        f.write_str(self.as_str())
15186    }
15187}
15188
15189impl std::fmt::Debug
15190    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15191{
15192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15193        f.write_str(self.as_str())
15194    }
15195}
15196impl serde::Serialize
15197    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15198{
15199    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15200    where
15201        S: serde::Serializer,
15202    {
15203        serializer.serialize_str(self.as_str())
15204    }
15205}
15206#[cfg(feature = "deserialize")]
15207impl<'de> serde::Deserialize<'de>
15208    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
15209{
15210    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15211        use std::str::FromStr;
15212        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15213        Ok(Self::from_str(&s).expect("infallible"))
15214    }
15215}
15216/// Transaction type of the mandate.
15217#[derive(Clone, Eq, PartialEq)]
15218#[non_exhaustive]
15219pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
15220    Business,
15221    Personal,
15222    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15223    Unknown(String),
15224}
15225impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
15226    pub fn as_str(&self) -> &str {
15227        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
15228        match self {
15229            Business => "business",
15230            Personal => "personal",
15231            Unknown(v) => v,
15232        }
15233    }
15234}
15235
15236impl std::str::FromStr
15237    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15238{
15239    type Err = std::convert::Infallible;
15240    fn from_str(s: &str) -> Result<Self, Self::Err> {
15241        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
15242        match s {
15243            "business" => Ok(Business),
15244            "personal" => Ok(Personal),
15245            v => {
15246                tracing::warn!(
15247                    "Unknown value '{}' for enum '{}'",
15248                    v,
15249                    "UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
15250                );
15251                Ok(Unknown(v.to_owned()))
15252            }
15253        }
15254    }
15255}
15256impl std::fmt::Display
15257    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15258{
15259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15260        f.write_str(self.as_str())
15261    }
15262}
15263
15264impl std::fmt::Debug
15265    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15266{
15267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15268        f.write_str(self.as_str())
15269    }
15270}
15271impl serde::Serialize
15272    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15273{
15274    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15275    where
15276        S: serde::Serializer,
15277    {
15278        serializer.serialize_str(self.as_str())
15279    }
15280}
15281#[cfg(feature = "deserialize")]
15282impl<'de> serde::Deserialize<'de>
15283    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
15284{
15285    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15286        use std::str::FromStr;
15287        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15288        Ok(Self::from_str(&s).expect("infallible"))
15289    }
15290}
15291/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15292///
15293/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15294/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15295///
15296/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15297///
15298/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15299///
15300/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15301#[derive(Clone, Eq, PartialEq)]
15302#[non_exhaustive]
15303pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
15304    None,
15305    OffSession,
15306    OnSession,
15307    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15308    Unknown(String),
15309}
15310impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
15311    pub fn as_str(&self) -> &str {
15312        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
15313        match self {
15314            None => "none",
15315            OffSession => "off_session",
15316            OnSession => "on_session",
15317            Unknown(v) => v,
15318        }
15319    }
15320}
15321
15322impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
15323    type Err = std::convert::Infallible;
15324    fn from_str(s: &str) -> Result<Self, Self::Err> {
15325        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
15326        match s {
15327            "none" => Ok(None),
15328            "off_session" => Ok(OffSession),
15329            "on_session" => Ok(OnSession),
15330            v => {
15331                tracing::warn!(
15332                    "Unknown value '{}' for enum '{}'",
15333                    v,
15334                    "UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"
15335                );
15336                Ok(Unknown(v.to_owned()))
15337            }
15338        }
15339    }
15340}
15341impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
15342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15343        f.write_str(self.as_str())
15344    }
15345}
15346
15347impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
15348    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15349        f.write_str(self.as_str())
15350    }
15351}
15352impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
15353    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15354    where
15355        S: serde::Serializer,
15356    {
15357        serializer.serialize_str(self.as_str())
15358    }
15359}
15360#[cfg(feature = "deserialize")]
15361impl<'de> serde::Deserialize<'de>
15362    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
15363{
15364    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15365        use std::str::FromStr;
15366        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15367        Ok(Self::from_str(&s).expect("infallible"))
15368    }
15369}
15370/// Bank account verification method.
15371#[derive(Clone, Eq, PartialEq)]
15372#[non_exhaustive]
15373pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15374    Automatic,
15375    Instant,
15376    Microdeposits,
15377    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15378    Unknown(String),
15379}
15380impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15381    pub fn as_str(&self) -> &str {
15382        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
15383        match self {
15384            Automatic => "automatic",
15385            Instant => "instant",
15386            Microdeposits => "microdeposits",
15387            Unknown(v) => v,
15388        }
15389    }
15390}
15391
15392impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15393    type Err = std::convert::Infallible;
15394    fn from_str(s: &str) -> Result<Self, Self::Err> {
15395        use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
15396        match s {
15397            "automatic" => Ok(Automatic),
15398            "instant" => Ok(Instant),
15399            "microdeposits" => Ok(Microdeposits),
15400            v => {
15401                tracing::warn!(
15402                    "Unknown value '{}' for enum '{}'",
15403                    v,
15404                    "UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"
15405                );
15406                Ok(Unknown(v.to_owned()))
15407            }
15408        }
15409    }
15410}
15411impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15412    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15413        f.write_str(self.as_str())
15414    }
15415}
15416
15417impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15418    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15419        f.write_str(self.as_str())
15420    }
15421}
15422impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
15423    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15424    where
15425        S: serde::Serializer,
15426    {
15427        serializer.serialize_str(self.as_str())
15428    }
15429}
15430#[cfg(feature = "deserialize")]
15431impl<'de> serde::Deserialize<'de>
15432    for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
15433{
15434    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15435        use std::str::FromStr;
15436        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15437        Ok(Self::from_str(&s).expect("infallible"))
15438    }
15439}
15440/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
15441#[derive(Clone, Debug, serde::Serialize)]
15442pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm {
15443    /// Controls when the funds are captured from the customer's account.
15444    ///
15445    /// 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.
15446    ///
15447    /// 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.
15448    #[serde(skip_serializing_if = "Option::is_none")]
15449    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
15450    /// Preferred language of the Affirm authorization page that the customer is redirected to.
15451    #[serde(skip_serializing_if = "Option::is_none")]
15452    pub preferred_locale: Option<String>,
15453    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15454    ///
15455    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15456    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15457    ///
15458    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15459    ///
15460    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15461    ///
15462    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15463    #[serde(skip_serializing_if = "Option::is_none")]
15464    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
15465}
15466impl UpdatePaymentIntentPaymentMethodOptionsAffirm {
15467    pub fn new() -> Self {
15468        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
15469    }
15470}
15471impl Default for UpdatePaymentIntentPaymentMethodOptionsAffirm {
15472    fn default() -> Self {
15473        Self::new()
15474    }
15475}
15476/// Controls when the funds are captured from the customer's account.
15477///
15478/// 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.
15479///
15480/// 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.
15481#[derive(Clone, Eq, PartialEq)]
15482#[non_exhaustive]
15483pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15484    Manual,
15485    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15486    Unknown(String),
15487}
15488impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15489    pub fn as_str(&self) -> &str {
15490        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
15491        match self {
15492            Manual => "manual",
15493            Unknown(v) => v,
15494        }
15495    }
15496}
15497
15498impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15499    type Err = std::convert::Infallible;
15500    fn from_str(s: &str) -> Result<Self, Self::Err> {
15501        use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
15502        match s {
15503            "manual" => Ok(Manual),
15504            v => {
15505                tracing::warn!(
15506                    "Unknown value '{}' for enum '{}'",
15507                    v,
15508                    "UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod"
15509                );
15510                Ok(Unknown(v.to_owned()))
15511            }
15512        }
15513    }
15514}
15515impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15516    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15517        f.write_str(self.as_str())
15518    }
15519}
15520
15521impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15522    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15523        f.write_str(self.as_str())
15524    }
15525}
15526impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15527    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15528    where
15529        S: serde::Serializer,
15530    {
15531        serializer.serialize_str(self.as_str())
15532    }
15533}
15534#[cfg(feature = "deserialize")]
15535impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
15536    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15537        use std::str::FromStr;
15538        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15539        Ok(Self::from_str(&s).expect("infallible"))
15540    }
15541}
15542/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15543///
15544/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15545/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15546///
15547/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15548///
15549/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15550///
15551/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15552#[derive(Clone, Eq, PartialEq)]
15553#[non_exhaustive]
15554pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
15555    None,
15556    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15557    Unknown(String),
15558}
15559impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
15560    pub fn as_str(&self) -> &str {
15561        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
15562        match self {
15563            None => "none",
15564            Unknown(v) => v,
15565        }
15566    }
15567}
15568
15569impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
15570    type Err = std::convert::Infallible;
15571    fn from_str(s: &str) -> Result<Self, Self::Err> {
15572        use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
15573        match s {
15574            "none" => Ok(None),
15575            v => {
15576                tracing::warn!(
15577                    "Unknown value '{}' for enum '{}'",
15578                    v,
15579                    "UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage"
15580                );
15581                Ok(Unknown(v.to_owned()))
15582            }
15583        }
15584    }
15585}
15586impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
15587    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15588        f.write_str(self.as_str())
15589    }
15590}
15591
15592impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
15593    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15594        f.write_str(self.as_str())
15595    }
15596}
15597impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
15598    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15599    where
15600        S: serde::Serializer,
15601    {
15602        serializer.serialize_str(self.as_str())
15603    }
15604}
15605#[cfg(feature = "deserialize")]
15606impl<'de> serde::Deserialize<'de>
15607    for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
15608{
15609    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15610        use std::str::FromStr;
15611        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15612        Ok(Self::from_str(&s).expect("infallible"))
15613    }
15614}
15615/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
15616#[derive(Clone, Debug, serde::Serialize)]
15617pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
15618    /// Controls when the funds are captured from the customer's account.
15619    ///
15620    /// 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.
15621    ///
15622    /// 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.
15623    #[serde(skip_serializing_if = "Option::is_none")]
15624    pub capture_method:
15625        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
15626    /// An internal identifier or reference that this payment corresponds to.
15627    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
15628    /// This field differs from the statement descriptor and item name.
15629    #[serde(skip_serializing_if = "Option::is_none")]
15630    pub reference: Option<String>,
15631    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15632    ///
15633    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15634    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15635    ///
15636    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15637    ///
15638    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15639    ///
15640    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15641    #[serde(skip_serializing_if = "Option::is_none")]
15642    pub setup_future_usage:
15643        Option<UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
15644}
15645impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
15646    pub fn new() -> Self {
15647        Self { capture_method: None, reference: None, setup_future_usage: None }
15648    }
15649}
15650impl Default for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay {
15651    fn default() -> Self {
15652        Self::new()
15653    }
15654}
15655/// Controls when the funds are captured from the customer's account.
15656///
15657/// 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.
15658///
15659/// 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.
15660#[derive(Clone, Eq, PartialEq)]
15661#[non_exhaustive]
15662pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
15663    Manual,
15664    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15665    Unknown(String),
15666}
15667impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
15668    pub fn as_str(&self) -> &str {
15669        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
15670        match self {
15671            Manual => "manual",
15672            Unknown(v) => v,
15673        }
15674    }
15675}
15676
15677impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
15678    type Err = std::convert::Infallible;
15679    fn from_str(s: &str) -> Result<Self, Self::Err> {
15680        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
15681        match s {
15682            "manual" => Ok(Manual),
15683            v => {
15684                tracing::warn!(
15685                    "Unknown value '{}' for enum '{}'",
15686                    v,
15687                    "UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"
15688                );
15689                Ok(Unknown(v.to_owned()))
15690            }
15691        }
15692    }
15693}
15694impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
15695    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15696        f.write_str(self.as_str())
15697    }
15698}
15699
15700impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
15701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15702        f.write_str(self.as_str())
15703    }
15704}
15705impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
15706    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15707    where
15708        S: serde::Serializer,
15709    {
15710        serializer.serialize_str(self.as_str())
15711    }
15712}
15713#[cfg(feature = "deserialize")]
15714impl<'de> serde::Deserialize<'de>
15715    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
15716{
15717    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15718        use std::str::FromStr;
15719        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15720        Ok(Self::from_str(&s).expect("infallible"))
15721    }
15722}
15723/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15724///
15725/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15726/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15727///
15728/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15729///
15730/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15731///
15732/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15733#[derive(Clone, Eq, PartialEq)]
15734#[non_exhaustive]
15735pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
15736    None,
15737    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15738    Unknown(String),
15739}
15740impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
15741    pub fn as_str(&self) -> &str {
15742        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
15743        match self {
15744            None => "none",
15745            Unknown(v) => v,
15746        }
15747    }
15748}
15749
15750impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
15751    type Err = std::convert::Infallible;
15752    fn from_str(s: &str) -> Result<Self, Self::Err> {
15753        use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
15754        match s {
15755            "none" => Ok(None),
15756            v => {
15757                tracing::warn!(
15758                    "Unknown value '{}' for enum '{}'",
15759                    v,
15760                    "UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"
15761                );
15762                Ok(Unknown(v.to_owned()))
15763            }
15764        }
15765    }
15766}
15767impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
15768    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15769        f.write_str(self.as_str())
15770    }
15771}
15772
15773impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
15774    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15775        f.write_str(self.as_str())
15776    }
15777}
15778impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
15779    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15780    where
15781        S: serde::Serializer,
15782    {
15783        serializer.serialize_str(self.as_str())
15784    }
15785}
15786#[cfg(feature = "deserialize")]
15787impl<'de> serde::Deserialize<'de>
15788    for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
15789{
15790    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15791        use std::str::FromStr;
15792        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15793        Ok(Self::from_str(&s).expect("infallible"))
15794    }
15795}
15796/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
15797#[derive(Clone, Debug, serde::Serialize)]
15798pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay {
15799    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15800    ///
15801    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15802    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15803    ///
15804    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15805    ///
15806    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15807    ///
15808    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15809    #[serde(skip_serializing_if = "Option::is_none")]
15810    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
15811}
15812impl UpdatePaymentIntentPaymentMethodOptionsAlipay {
15813    pub fn new() -> Self {
15814        Self { setup_future_usage: None }
15815    }
15816}
15817impl Default for UpdatePaymentIntentPaymentMethodOptionsAlipay {
15818    fn default() -> Self {
15819        Self::new()
15820    }
15821}
15822/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15823///
15824/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15825/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15826///
15827/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
15828///
15829/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
15830///
15831/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
15832#[derive(Clone, Eq, PartialEq)]
15833#[non_exhaustive]
15834pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
15835    None,
15836    OffSession,
15837    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15838    Unknown(String),
15839}
15840impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
15841    pub fn as_str(&self) -> &str {
15842        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
15843        match self {
15844            None => "none",
15845            OffSession => "off_session",
15846            Unknown(v) => v,
15847        }
15848    }
15849}
15850
15851impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
15852    type Err = std::convert::Infallible;
15853    fn from_str(s: &str) -> Result<Self, Self::Err> {
15854        use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
15855        match s {
15856            "none" => Ok(None),
15857            "off_session" => Ok(OffSession),
15858            v => {
15859                tracing::warn!(
15860                    "Unknown value '{}' for enum '{}'",
15861                    v,
15862                    "UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage"
15863                );
15864                Ok(Unknown(v.to_owned()))
15865            }
15866        }
15867    }
15868}
15869impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
15870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15871        f.write_str(self.as_str())
15872    }
15873}
15874
15875impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
15876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15877        f.write_str(self.as_str())
15878    }
15879}
15880impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
15881    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15882    where
15883        S: serde::Serializer,
15884    {
15885        serializer.serialize_str(self.as_str())
15886    }
15887}
15888#[cfg(feature = "deserialize")]
15889impl<'de> serde::Deserialize<'de>
15890    for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
15891{
15892    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
15893        use std::str::FromStr;
15894        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
15895        Ok(Self::from_str(&s).expect("infallible"))
15896    }
15897}
15898/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
15899#[derive(Clone, Debug, serde::Serialize)]
15900pub struct UpdatePaymentIntentPaymentMethodOptionsAlma {
15901    /// Controls when the funds are captured from the customer's account.
15902    ///
15903    /// 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.
15904    ///
15905    /// 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.
15906    #[serde(skip_serializing_if = "Option::is_none")]
15907    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
15908}
15909impl UpdatePaymentIntentPaymentMethodOptionsAlma {
15910    pub fn new() -> Self {
15911        Self { capture_method: None }
15912    }
15913}
15914impl Default for UpdatePaymentIntentPaymentMethodOptionsAlma {
15915    fn default() -> Self {
15916        Self::new()
15917    }
15918}
15919/// Controls when the funds are captured from the customer's account.
15920///
15921/// 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.
15922///
15923/// 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.
15924#[derive(Clone, Eq, PartialEq)]
15925#[non_exhaustive]
15926pub enum UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
15927    Manual,
15928    /// An unrecognized value from Stripe. Should not be used as a request parameter.
15929    Unknown(String),
15930}
15931impl UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
15932    pub fn as_str(&self) -> &str {
15933        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
15934        match self {
15935            Manual => "manual",
15936            Unknown(v) => v,
15937        }
15938    }
15939}
15940
15941impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
15942    type Err = std::convert::Infallible;
15943    fn from_str(s: &str) -> Result<Self, Self::Err> {
15944        use UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
15945        match s {
15946            "manual" => Ok(Manual),
15947            v => {
15948                tracing::warn!(
15949                    "Unknown value '{}' for enum '{}'",
15950                    v,
15951                    "UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod"
15952                );
15953                Ok(Unknown(v.to_owned()))
15954            }
15955        }
15956    }
15957}
15958impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
15959    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15960        f.write_str(self.as_str())
15961    }
15962}
15963
15964impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
15965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15966        f.write_str(self.as_str())
15967    }
15968}
15969impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
15970    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15971    where
15972        S: serde::Serializer,
15973    {
15974        serializer.serialize_str(self.as_str())
15975    }
15976}
15977#[cfg(feature = "deserialize")]
15978impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
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        Ok(Self::from_str(&s).expect("infallible"))
15983    }
15984}
15985/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
15986#[derive(Clone, Debug, serde::Serialize)]
15987pub struct UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
15988    /// Controls when the funds are captured from the customer's account.
15989    ///
15990    /// 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.
15991    ///
15992    /// 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.
15993    #[serde(skip_serializing_if = "Option::is_none")]
15994    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
15995    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
15996    ///
15997    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
15998    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
15999    ///
16000    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16001    ///
16002    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16003    #[serde(skip_serializing_if = "Option::is_none")]
16004    pub setup_future_usage:
16005        Option<UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
16006}
16007impl UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
16008    pub fn new() -> Self {
16009        Self { capture_method: None, setup_future_usage: None }
16010    }
16011}
16012impl Default for UpdatePaymentIntentPaymentMethodOptionsAmazonPay {
16013    fn default() -> Self {
16014        Self::new()
16015    }
16016}
16017/// Controls when the funds are captured from the customer's account.
16018///
16019/// 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.
16020///
16021/// 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.
16022#[derive(Clone, Eq, PartialEq)]
16023#[non_exhaustive]
16024pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
16025    Manual,
16026    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16027    Unknown(String),
16028}
16029impl UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
16030    pub fn as_str(&self) -> &str {
16031        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
16032        match self {
16033            Manual => "manual",
16034            Unknown(v) => v,
16035        }
16036    }
16037}
16038
16039impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
16040    type Err = std::convert::Infallible;
16041    fn from_str(s: &str) -> Result<Self, Self::Err> {
16042        use UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
16043        match s {
16044            "manual" => Ok(Manual),
16045            v => {
16046                tracing::warn!(
16047                    "Unknown value '{}' for enum '{}'",
16048                    v,
16049                    "UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod"
16050                );
16051                Ok(Unknown(v.to_owned()))
16052            }
16053        }
16054    }
16055}
16056impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
16057    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16058        f.write_str(self.as_str())
16059    }
16060}
16061
16062impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
16063    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16064        f.write_str(self.as_str())
16065    }
16066}
16067impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
16068    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16069    where
16070        S: serde::Serializer,
16071    {
16072        serializer.serialize_str(self.as_str())
16073    }
16074}
16075#[cfg(feature = "deserialize")]
16076impl<'de> serde::Deserialize<'de>
16077    for UpdatePaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
16078{
16079    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16080        use std::str::FromStr;
16081        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16082        Ok(Self::from_str(&s).expect("infallible"))
16083    }
16084}
16085/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16086///
16087/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16088/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16089///
16090/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16091///
16092/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16093#[derive(Clone, Eq, PartialEq)]
16094#[non_exhaustive]
16095pub enum UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
16096    None,
16097    OffSession,
16098    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16099    Unknown(String),
16100}
16101impl UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
16102    pub fn as_str(&self) -> &str {
16103        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
16104        match self {
16105            None => "none",
16106            OffSession => "off_session",
16107            Unknown(v) => v,
16108        }
16109    }
16110}
16111
16112impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
16113    type Err = std::convert::Infallible;
16114    fn from_str(s: &str) -> Result<Self, Self::Err> {
16115        use UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
16116        match s {
16117            "none" => Ok(None),
16118            "off_session" => Ok(OffSession),
16119            v => {
16120                tracing::warn!(
16121                    "Unknown value '{}' for enum '{}'",
16122                    v,
16123                    "UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"
16124                );
16125                Ok(Unknown(v.to_owned()))
16126            }
16127        }
16128    }
16129}
16130impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
16131    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16132        f.write_str(self.as_str())
16133    }
16134}
16135
16136impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
16137    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16138        f.write_str(self.as_str())
16139    }
16140}
16141impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
16142    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16143    where
16144        S: serde::Serializer,
16145    {
16146        serializer.serialize_str(self.as_str())
16147    }
16148}
16149#[cfg(feature = "deserialize")]
16150impl<'de> serde::Deserialize<'de>
16151    for UpdatePaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
16152{
16153    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16154        use std::str::FromStr;
16155        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16156        Ok(Self::from_str(&s).expect("infallible"))
16157    }
16158}
16159/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
16160#[derive(Clone, Debug, serde::Serialize)]
16161pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
16162    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16163    ///
16164    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16165    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16166    ///
16167    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16168    ///
16169    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16170    ///
16171    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16172    #[serde(skip_serializing_if = "Option::is_none")]
16173    pub setup_future_usage:
16174        Option<UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
16175    /// Controls when Stripe will attempt to debit the funds from the customer's account.
16176    /// The date must be a string in YYYY-MM-DD format.
16177    /// The date must be in the future and between 3 and 15 calendar days from now.
16178    #[serde(skip_serializing_if = "Option::is_none")]
16179    pub target_date: Option<String>,
16180}
16181impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
16182    pub fn new() -> Self {
16183        Self { setup_future_usage: None, target_date: None }
16184    }
16185}
16186impl Default for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit {
16187    fn default() -> Self {
16188        Self::new()
16189    }
16190}
16191/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16192///
16193/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16194/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16195///
16196/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16197///
16198/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16199///
16200/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16201#[derive(Clone, Eq, PartialEq)]
16202#[non_exhaustive]
16203pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
16204    None,
16205    OffSession,
16206    OnSession,
16207    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16208    Unknown(String),
16209}
16210impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
16211    pub fn as_str(&self) -> &str {
16212        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
16213        match self {
16214            None => "none",
16215            OffSession => "off_session",
16216            OnSession => "on_session",
16217            Unknown(v) => v,
16218        }
16219    }
16220}
16221
16222impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
16223    type Err = std::convert::Infallible;
16224    fn from_str(s: &str) -> Result<Self, Self::Err> {
16225        use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
16226        match s {
16227            "none" => Ok(None),
16228            "off_session" => Ok(OffSession),
16229            "on_session" => Ok(OnSession),
16230            v => {
16231                tracing::warn!(
16232                    "Unknown value '{}' for enum '{}'",
16233                    v,
16234                    "UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"
16235                );
16236                Ok(Unknown(v.to_owned()))
16237            }
16238        }
16239    }
16240}
16241impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
16242    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16243        f.write_str(self.as_str())
16244    }
16245}
16246
16247impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
16248    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16249        f.write_str(self.as_str())
16250    }
16251}
16252impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
16253    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16254    where
16255        S: serde::Serializer,
16256    {
16257        serializer.serialize_str(self.as_str())
16258    }
16259}
16260#[cfg(feature = "deserialize")]
16261impl<'de> serde::Deserialize<'de>
16262    for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
16263{
16264    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16265        use std::str::FromStr;
16266        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16267        Ok(Self::from_str(&s).expect("infallible"))
16268    }
16269}
16270/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
16271#[derive(Clone, Debug, serde::Serialize)]
16272pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
16273    /// Additional fields for Mandate creation
16274    #[serde(skip_serializing_if = "Option::is_none")]
16275    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
16276    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16277    ///
16278    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16279    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16280    ///
16281    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16282    ///
16283    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16284    ///
16285    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16286    #[serde(skip_serializing_if = "Option::is_none")]
16287    pub setup_future_usage:
16288        Option<UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
16289    /// Controls when Stripe will attempt to debit the funds from the customer's account.
16290    /// The date must be a string in YYYY-MM-DD format.
16291    /// The date must be in the future and between 3 and 15 calendar days from now.
16292    #[serde(skip_serializing_if = "Option::is_none")]
16293    pub target_date: Option<String>,
16294}
16295impl UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
16296    pub fn new() -> Self {
16297        Self { mandate_options: None, setup_future_usage: None, target_date: None }
16298    }
16299}
16300impl Default for UpdatePaymentIntentPaymentMethodOptionsBacsDebit {
16301    fn default() -> Self {
16302        Self::new()
16303    }
16304}
16305/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16306///
16307/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16308/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16309///
16310/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16311///
16312/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16313///
16314/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16315#[derive(Clone, Eq, PartialEq)]
16316#[non_exhaustive]
16317pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
16318    None,
16319    OffSession,
16320    OnSession,
16321    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16322    Unknown(String),
16323}
16324impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
16325    pub fn as_str(&self) -> &str {
16326        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
16327        match self {
16328            None => "none",
16329            OffSession => "off_session",
16330            OnSession => "on_session",
16331            Unknown(v) => v,
16332        }
16333    }
16334}
16335
16336impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
16337    type Err = std::convert::Infallible;
16338    fn from_str(s: &str) -> Result<Self, Self::Err> {
16339        use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
16340        match s {
16341            "none" => Ok(None),
16342            "off_session" => Ok(OffSession),
16343            "on_session" => Ok(OnSession),
16344            v => {
16345                tracing::warn!(
16346                    "Unknown value '{}' for enum '{}'",
16347                    v,
16348                    "UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"
16349                );
16350                Ok(Unknown(v.to_owned()))
16351            }
16352        }
16353    }
16354}
16355impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
16356    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16357        f.write_str(self.as_str())
16358    }
16359}
16360
16361impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
16362    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16363        f.write_str(self.as_str())
16364    }
16365}
16366impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
16367    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16368    where
16369        S: serde::Serializer,
16370    {
16371        serializer.serialize_str(self.as_str())
16372    }
16373}
16374#[cfg(feature = "deserialize")]
16375impl<'de> serde::Deserialize<'de>
16376    for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
16377{
16378    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16379        use std::str::FromStr;
16380        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16381        Ok(Self::from_str(&s).expect("infallible"))
16382    }
16383}
16384/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
16385#[derive(Clone, Debug, serde::Serialize)]
16386pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact {
16387    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
16388    #[serde(skip_serializing_if = "Option::is_none")]
16389    pub preferred_language:
16390        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
16391    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16392    ///
16393    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16394    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16395    ///
16396    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16397    ///
16398    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16399    ///
16400    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16401    #[serde(skip_serializing_if = "Option::is_none")]
16402    pub setup_future_usage:
16403        Option<UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
16404}
16405impl UpdatePaymentIntentPaymentMethodOptionsBancontact {
16406    pub fn new() -> Self {
16407        Self { preferred_language: None, setup_future_usage: None }
16408    }
16409}
16410impl Default for UpdatePaymentIntentPaymentMethodOptionsBancontact {
16411    fn default() -> Self {
16412        Self::new()
16413    }
16414}
16415/// Preferred language of the Bancontact authorization page that the customer is redirected to.
16416#[derive(Clone, Eq, PartialEq)]
16417#[non_exhaustive]
16418pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
16419    De,
16420    En,
16421    Fr,
16422    Nl,
16423    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16424    Unknown(String),
16425}
16426impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
16427    pub fn as_str(&self) -> &str {
16428        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
16429        match self {
16430            De => "de",
16431            En => "en",
16432            Fr => "fr",
16433            Nl => "nl",
16434            Unknown(v) => v,
16435        }
16436    }
16437}
16438
16439impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
16440    type Err = std::convert::Infallible;
16441    fn from_str(s: &str) -> Result<Self, Self::Err> {
16442        use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
16443        match s {
16444            "de" => Ok(De),
16445            "en" => Ok(En),
16446            "fr" => Ok(Fr),
16447            "nl" => Ok(Nl),
16448            v => {
16449                tracing::warn!(
16450                    "Unknown value '{}' for enum '{}'",
16451                    v,
16452                    "UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"
16453                );
16454                Ok(Unknown(v.to_owned()))
16455            }
16456        }
16457    }
16458}
16459impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
16460    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16461        f.write_str(self.as_str())
16462    }
16463}
16464
16465impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
16466    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16467        f.write_str(self.as_str())
16468    }
16469}
16470impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
16471    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16472    where
16473        S: serde::Serializer,
16474    {
16475        serializer.serialize_str(self.as_str())
16476    }
16477}
16478#[cfg(feature = "deserialize")]
16479impl<'de> serde::Deserialize<'de>
16480    for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
16481{
16482    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16483        use std::str::FromStr;
16484        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16485        Ok(Self::from_str(&s).expect("infallible"))
16486    }
16487}
16488/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16489///
16490/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16491/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16492///
16493/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16494///
16495/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16496///
16497/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16498#[derive(Clone, Eq, PartialEq)]
16499#[non_exhaustive]
16500pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
16501    None,
16502    OffSession,
16503    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16504    Unknown(String),
16505}
16506impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
16507    pub fn as_str(&self) -> &str {
16508        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
16509        match self {
16510            None => "none",
16511            OffSession => "off_session",
16512            Unknown(v) => v,
16513        }
16514    }
16515}
16516
16517impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
16518    type Err = std::convert::Infallible;
16519    fn from_str(s: &str) -> Result<Self, Self::Err> {
16520        use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
16521        match s {
16522            "none" => Ok(None),
16523            "off_session" => Ok(OffSession),
16524            v => {
16525                tracing::warn!(
16526                    "Unknown value '{}' for enum '{}'",
16527                    v,
16528                    "UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"
16529                );
16530                Ok(Unknown(v.to_owned()))
16531            }
16532        }
16533    }
16534}
16535impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
16536    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16537        f.write_str(self.as_str())
16538    }
16539}
16540
16541impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
16542    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16543        f.write_str(self.as_str())
16544    }
16545}
16546impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
16547    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16548    where
16549        S: serde::Serializer,
16550    {
16551        serializer.serialize_str(self.as_str())
16552    }
16553}
16554#[cfg(feature = "deserialize")]
16555impl<'de> serde::Deserialize<'de>
16556    for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
16557{
16558    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16559        use std::str::FromStr;
16560        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16561        Ok(Self::from_str(&s).expect("infallible"))
16562    }
16563}
16564/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
16565#[derive(Clone, Debug, serde::Serialize)]
16566pub struct UpdatePaymentIntentPaymentMethodOptionsBillie {
16567    /// Controls when the funds are captured from the customer's account.
16568    ///
16569    /// 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.
16570    ///
16571    /// 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.
16572    #[serde(skip_serializing_if = "Option::is_none")]
16573    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
16574}
16575impl UpdatePaymentIntentPaymentMethodOptionsBillie {
16576    pub fn new() -> Self {
16577        Self { capture_method: None }
16578    }
16579}
16580impl Default for UpdatePaymentIntentPaymentMethodOptionsBillie {
16581    fn default() -> Self {
16582        Self::new()
16583    }
16584}
16585/// Controls when the funds are captured from the customer's account.
16586///
16587/// 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.
16588///
16589/// 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.
16590#[derive(Clone, Eq, PartialEq)]
16591#[non_exhaustive]
16592pub enum UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16593    Manual,
16594    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16595    Unknown(String),
16596}
16597impl UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16598    pub fn as_str(&self) -> &str {
16599        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
16600        match self {
16601            Manual => "manual",
16602            Unknown(v) => v,
16603        }
16604    }
16605}
16606
16607impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16608    type Err = std::convert::Infallible;
16609    fn from_str(s: &str) -> Result<Self, Self::Err> {
16610        use UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
16611        match s {
16612            "manual" => Ok(Manual),
16613            v => {
16614                tracing::warn!(
16615                    "Unknown value '{}' for enum '{}'",
16616                    v,
16617                    "UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod"
16618                );
16619                Ok(Unknown(v.to_owned()))
16620            }
16621        }
16622    }
16623}
16624impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16625    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16626        f.write_str(self.as_str())
16627    }
16628}
16629
16630impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16631    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16632        f.write_str(self.as_str())
16633    }
16634}
16635impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16636    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16637    where
16638        S: serde::Serializer,
16639    {
16640        serializer.serialize_str(self.as_str())
16641    }
16642}
16643#[cfg(feature = "deserialize")]
16644impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBillieCaptureMethod {
16645    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16646        use std::str::FromStr;
16647        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16648        Ok(Self::from_str(&s).expect("infallible"))
16649    }
16650}
16651/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
16652#[derive(Clone, Debug, serde::Serialize)]
16653pub struct UpdatePaymentIntentPaymentMethodOptionsBlik {
16654    /// The 6-digit BLIK code that a customer has generated using their banking application.
16655    /// Can only be set on confirmation.
16656    #[serde(skip_serializing_if = "Option::is_none")]
16657    pub code: Option<String>,
16658    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16659    ///
16660    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16661    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16662    ///
16663    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16664    ///
16665    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16666    ///
16667    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16668    #[serde(skip_serializing_if = "Option::is_none")]
16669    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
16670}
16671impl UpdatePaymentIntentPaymentMethodOptionsBlik {
16672    pub fn new() -> Self {
16673        Self { code: None, setup_future_usage: None }
16674    }
16675}
16676impl Default for UpdatePaymentIntentPaymentMethodOptionsBlik {
16677    fn default() -> Self {
16678        Self::new()
16679    }
16680}
16681/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16682///
16683/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16684/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16685///
16686/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16687///
16688/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16689///
16690/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16691#[derive(Clone, Eq, PartialEq)]
16692#[non_exhaustive]
16693pub enum UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16694    None,
16695    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16696    Unknown(String),
16697}
16698impl UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16699    pub fn as_str(&self) -> &str {
16700        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
16701        match self {
16702            None => "none",
16703            Unknown(v) => v,
16704        }
16705    }
16706}
16707
16708impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16709    type Err = std::convert::Infallible;
16710    fn from_str(s: &str) -> Result<Self, Self::Err> {
16711        use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
16712        match s {
16713            "none" => Ok(None),
16714            v => {
16715                tracing::warn!(
16716                    "Unknown value '{}' for enum '{}'",
16717                    v,
16718                    "UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage"
16719                );
16720                Ok(Unknown(v.to_owned()))
16721            }
16722        }
16723    }
16724}
16725impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16726    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16727        f.write_str(self.as_str())
16728    }
16729}
16730
16731impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16733        f.write_str(self.as_str())
16734    }
16735}
16736impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16737    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16738    where
16739        S: serde::Serializer,
16740    {
16741        serializer.serialize_str(self.as_str())
16742    }
16743}
16744#[cfg(feature = "deserialize")]
16745impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
16746    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16747        use std::str::FromStr;
16748        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16749        Ok(Self::from_str(&s).expect("infallible"))
16750    }
16751}
16752/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
16753#[derive(Clone, Debug, serde::Serialize)]
16754pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto {
16755    /// The number of calendar days before a Boleto voucher expires.
16756    /// 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.
16757    #[serde(skip_serializing_if = "Option::is_none")]
16758    pub expires_after_days: Option<u32>,
16759    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16760    ///
16761    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16762    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16763    ///
16764    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16765    ///
16766    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16767    ///
16768    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16769    #[serde(skip_serializing_if = "Option::is_none")]
16770    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
16771}
16772impl UpdatePaymentIntentPaymentMethodOptionsBoleto {
16773    pub fn new() -> Self {
16774        Self { expires_after_days: None, setup_future_usage: None }
16775    }
16776}
16777impl Default for UpdatePaymentIntentPaymentMethodOptionsBoleto {
16778    fn default() -> Self {
16779        Self::new()
16780    }
16781}
16782/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16783///
16784/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16785/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16786///
16787/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16788///
16789/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16790///
16791/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16792#[derive(Clone, Eq, PartialEq)]
16793#[non_exhaustive]
16794pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
16795    None,
16796    OffSession,
16797    OnSession,
16798    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16799    Unknown(String),
16800}
16801impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
16802    pub fn as_str(&self) -> &str {
16803        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
16804        match self {
16805            None => "none",
16806            OffSession => "off_session",
16807            OnSession => "on_session",
16808            Unknown(v) => v,
16809        }
16810    }
16811}
16812
16813impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
16814    type Err = std::convert::Infallible;
16815    fn from_str(s: &str) -> Result<Self, Self::Err> {
16816        use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
16817        match s {
16818            "none" => Ok(None),
16819            "off_session" => Ok(OffSession),
16820            "on_session" => Ok(OnSession),
16821            v => {
16822                tracing::warn!(
16823                    "Unknown value '{}' for enum '{}'",
16824                    v,
16825                    "UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage"
16826                );
16827                Ok(Unknown(v.to_owned()))
16828            }
16829        }
16830    }
16831}
16832impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
16833    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16834        f.write_str(self.as_str())
16835    }
16836}
16837
16838impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
16839    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
16840        f.write_str(self.as_str())
16841    }
16842}
16843impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
16844    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
16845    where
16846        S: serde::Serializer,
16847    {
16848        serializer.serialize_str(self.as_str())
16849    }
16850}
16851#[cfg(feature = "deserialize")]
16852impl<'de> serde::Deserialize<'de>
16853    for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
16854{
16855    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
16856        use std::str::FromStr;
16857        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
16858        Ok(Self::from_str(&s).expect("infallible"))
16859    }
16860}
16861/// Configuration for any card payments attempted on this PaymentIntent.
16862#[derive(Clone, Debug, serde::Serialize)]
16863pub struct UpdatePaymentIntentPaymentMethodOptionsCard {
16864    /// Controls when the funds are captured from the customer's account.
16865    ///
16866    /// 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.
16867    ///
16868    /// 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.
16869    #[serde(skip_serializing_if = "Option::is_none")]
16870    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod>,
16871    /// A single-use `cvc_update` Token that represents a card CVC value.
16872    /// When provided, the CVC value will be verified during the card payment attempt.
16873    /// This parameter can only be provided during confirmation.
16874    #[serde(skip_serializing_if = "Option::is_none")]
16875    pub cvc_token: Option<String>,
16876    /// Installment configuration for payments attempted on this PaymentIntent.
16877    ///
16878    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
16879    #[serde(skip_serializing_if = "Option::is_none")]
16880    pub installments: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallments>,
16881    /// Configuration options for setting up an eMandate for cards issued in India.
16882    #[serde(skip_serializing_if = "Option::is_none")]
16883    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions>,
16884    /// When specified, this parameter indicates that a transaction will be marked
16885    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
16886    /// parameter can only be provided during confirmation.
16887    #[serde(skip_serializing_if = "Option::is_none")]
16888    pub moto: Option<bool>,
16889    /// Selected network to process this PaymentIntent on.
16890    /// Depends on the available networks of the card attached to the PaymentIntent.
16891    /// Can be only set confirm-time.
16892    #[serde(skip_serializing_if = "Option::is_none")]
16893    pub network: Option<UpdatePaymentIntentPaymentMethodOptionsCardNetwork>,
16894    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
16895    #[serde(skip_serializing_if = "Option::is_none")]
16896    pub request_extended_authorization:
16897        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
16898    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
16899    #[serde(skip_serializing_if = "Option::is_none")]
16900    pub request_incremental_authorization:
16901        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
16902    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
16903    #[serde(skip_serializing_if = "Option::is_none")]
16904    pub request_multicapture:
16905        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
16906    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
16907    #[serde(skip_serializing_if = "Option::is_none")]
16908    pub request_overcapture: Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
16909    /// 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).
16910    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
16911    /// If not provided, this value defaults to `automatic`.
16912    /// 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.
16913    #[serde(skip_serializing_if = "Option::is_none")]
16914    pub request_three_d_secure:
16915        Option<UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
16916    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
16917    /// using the cvc_token parameter).
16918    #[serde(skip_serializing_if = "Option::is_none")]
16919    pub require_cvc_recollection: Option<bool>,
16920    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
16921    ///
16922    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
16923    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
16924    ///
16925    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
16926    ///
16927    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
16928    ///
16929    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
16930    #[serde(skip_serializing_if = "Option::is_none")]
16931    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
16932    /// Provides information about a card payment that customers see on their statements.
16933    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
16934    /// Maximum 22 characters.
16935    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
16936    #[serde(skip_serializing_if = "Option::is_none")]
16937    pub statement_descriptor_suffix_kana: Option<String>,
16938    /// Provides information about a card payment that customers see on their statements.
16939    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
16940    /// Maximum 17 characters.
16941    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
16942    #[serde(skip_serializing_if = "Option::is_none")]
16943    pub statement_descriptor_suffix_kanji: Option<String>,
16944    /// If 3D Secure authentication was performed with a third-party provider,
16945    /// the authentication details to use for this payment.
16946    #[serde(skip_serializing_if = "Option::is_none")]
16947    pub three_d_secure: Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure>,
16948}
16949impl UpdatePaymentIntentPaymentMethodOptionsCard {
16950    pub fn new() -> Self {
16951        Self {
16952            capture_method: None,
16953            cvc_token: None,
16954            installments: None,
16955            mandate_options: None,
16956            moto: None,
16957            network: None,
16958            request_extended_authorization: None,
16959            request_incremental_authorization: None,
16960            request_multicapture: None,
16961            request_overcapture: None,
16962            request_three_d_secure: None,
16963            require_cvc_recollection: None,
16964            setup_future_usage: None,
16965            statement_descriptor_suffix_kana: None,
16966            statement_descriptor_suffix_kanji: None,
16967            three_d_secure: None,
16968        }
16969    }
16970}
16971impl Default for UpdatePaymentIntentPaymentMethodOptionsCard {
16972    fn default() -> Self {
16973        Self::new()
16974    }
16975}
16976/// Controls when the funds are captured from the customer's account.
16977///
16978/// 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.
16979///
16980/// 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.
16981#[derive(Clone, Eq, PartialEq)]
16982#[non_exhaustive]
16983pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
16984    Manual,
16985    /// An unrecognized value from Stripe. Should not be used as a request parameter.
16986    Unknown(String),
16987}
16988impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
16989    pub fn as_str(&self) -> &str {
16990        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
16991        match self {
16992            Manual => "manual",
16993            Unknown(v) => v,
16994        }
16995    }
16996}
16997
16998impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
16999    type Err = std::convert::Infallible;
17000    fn from_str(s: &str) -> Result<Self, Self::Err> {
17001        use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
17002        match s {
17003            "manual" => Ok(Manual),
17004            v => {
17005                tracing::warn!(
17006                    "Unknown value '{}' for enum '{}'",
17007                    v,
17008                    "UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod"
17009                );
17010                Ok(Unknown(v.to_owned()))
17011            }
17012        }
17013    }
17014}
17015impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
17016    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17017        f.write_str(self.as_str())
17018    }
17019}
17020
17021impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
17022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17023        f.write_str(self.as_str())
17024    }
17025}
17026impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
17027    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17028    where
17029        S: serde::Serializer,
17030    {
17031        serializer.serialize_str(self.as_str())
17032    }
17033}
17034#[cfg(feature = "deserialize")]
17035impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod {
17036    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17037        use std::str::FromStr;
17038        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17039        Ok(Self::from_str(&s).expect("infallible"))
17040    }
17041}
17042/// Installment configuration for payments attempted on this PaymentIntent.
17043///
17044/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
17045#[derive(Clone, Debug, serde::Serialize)]
17046pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
17047    /// Setting to true enables installments for this PaymentIntent.
17048    /// This will cause the response to contain a list of available installment plans.
17049    /// Setting to false will prevent any selected plan from applying to a charge.
17050    #[serde(skip_serializing_if = "Option::is_none")]
17051    pub enabled: Option<bool>,
17052    /// The selected installment plan to use for this payment attempt.
17053    /// This parameter can only be provided during confirmation.
17054    #[serde(skip_serializing_if = "Option::is_none")]
17055    pub plan: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
17056}
17057impl UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
17058    pub fn new() -> Self {
17059        Self { enabled: None, plan: None }
17060    }
17061}
17062impl Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallments {
17063    fn default() -> Self {
17064        Self::new()
17065    }
17066}
17067/// The selected installment plan to use for this payment attempt.
17068/// This parameter can only be provided during confirmation.
17069#[derive(Clone, Debug, serde::Serialize)]
17070pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
17071    /// For `fixed_count` installment plans, this is required.
17072    /// It represents the number of installment payments your customer will make to their credit card.
17073    #[serde(skip_serializing_if = "Option::is_none")]
17074    pub count: Option<u64>,
17075    /// For `fixed_count` installment plans, this is required.
17076    /// It represents the interval between installment payments your customer will make to their credit card.
17077    /// One of `month`.
17078    #[serde(skip_serializing_if = "Option::is_none")]
17079    pub interval: Option<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
17080    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
17081    #[serde(rename = "type")]
17082    pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
17083}
17084impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
17085    pub fn new(
17086        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
17087    ) -> Self {
17088        Self { count: None, interval: None, type_: type_.into() }
17089    }
17090}
17091/// For `fixed_count` installment plans, this is required.
17092/// It represents the interval between installment payments your customer will make to their credit card.
17093/// One of `month`.
17094#[derive(Clone, Eq, PartialEq)]
17095#[non_exhaustive]
17096pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
17097    Month,
17098    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17099    Unknown(String),
17100}
17101impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
17102    pub fn as_str(&self) -> &str {
17103        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
17104        match self {
17105            Month => "month",
17106            Unknown(v) => v,
17107        }
17108    }
17109}
17110
17111impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
17112    type Err = std::convert::Infallible;
17113    fn from_str(s: &str) -> Result<Self, Self::Err> {
17114        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
17115        match s {
17116            "month" => Ok(Month),
17117            v => {
17118                tracing::warn!(
17119                    "Unknown value '{}' for enum '{}'",
17120                    v,
17121                    "UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"
17122                );
17123                Ok(Unknown(v.to_owned()))
17124            }
17125        }
17126    }
17127}
17128impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
17129    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17130        f.write_str(self.as_str())
17131    }
17132}
17133
17134impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
17135    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17136        f.write_str(self.as_str())
17137    }
17138}
17139impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
17140    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17141    where
17142        S: serde::Serializer,
17143    {
17144        serializer.serialize_str(self.as_str())
17145    }
17146}
17147#[cfg(feature = "deserialize")]
17148impl<'de> serde::Deserialize<'de>
17149    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
17150{
17151    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17152        use std::str::FromStr;
17153        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17154        Ok(Self::from_str(&s).expect("infallible"))
17155    }
17156}
17157/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
17158#[derive(Clone, Eq, PartialEq)]
17159#[non_exhaustive]
17160pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
17161    Bonus,
17162    FixedCount,
17163    Revolving,
17164    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17165    Unknown(String),
17166}
17167impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
17168    pub fn as_str(&self) -> &str {
17169        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
17170        match self {
17171            Bonus => "bonus",
17172            FixedCount => "fixed_count",
17173            Revolving => "revolving",
17174            Unknown(v) => v,
17175        }
17176    }
17177}
17178
17179impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
17180    type Err = std::convert::Infallible;
17181    fn from_str(s: &str) -> Result<Self, Self::Err> {
17182        use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
17183        match s {
17184            "bonus" => Ok(Bonus),
17185            "fixed_count" => Ok(FixedCount),
17186            "revolving" => Ok(Revolving),
17187            v => {
17188                tracing::warn!(
17189                    "Unknown value '{}' for enum '{}'",
17190                    v,
17191                    "UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType"
17192                );
17193                Ok(Unknown(v.to_owned()))
17194            }
17195        }
17196    }
17197}
17198impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
17199    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17200        f.write_str(self.as_str())
17201    }
17202}
17203
17204impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
17205    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17206        f.write_str(self.as_str())
17207    }
17208}
17209impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
17210    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17211    where
17212        S: serde::Serializer,
17213    {
17214        serializer.serialize_str(self.as_str())
17215    }
17216}
17217#[cfg(feature = "deserialize")]
17218impl<'de> serde::Deserialize<'de>
17219    for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
17220{
17221    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17222        use std::str::FromStr;
17223        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17224        Ok(Self::from_str(&s).expect("infallible"))
17225    }
17226}
17227/// Configuration options for setting up an eMandate for cards issued in India.
17228#[derive(Clone, Debug, serde::Serialize)]
17229pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
17230    /// Amount to be charged for future payments.
17231    pub amount: i64,
17232    /// One of `fixed` or `maximum`.
17233    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
17234    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
17235    pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
17236    /// A description of the mandate or subscription that is meant to be displayed to the customer.
17237    #[serde(skip_serializing_if = "Option::is_none")]
17238    pub description: Option<String>,
17239    /// End date of the mandate or subscription.
17240    /// If not provided, the mandate will be active until canceled.
17241    /// If provided, end date should be after start date.
17242    #[serde(skip_serializing_if = "Option::is_none")]
17243    pub end_date: Option<stripe_types::Timestamp>,
17244    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
17245    pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
17246    /// The number of intervals between payments.
17247    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
17248    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
17249    /// This parameter is optional when `interval=sporadic`.
17250    #[serde(skip_serializing_if = "Option::is_none")]
17251    pub interval_count: Option<u64>,
17252    /// Unique identifier for the mandate or subscription.
17253    pub reference: String,
17254    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
17255    pub start_date: stripe_types::Timestamp,
17256    /// Specifies the type of mandates supported. Possible values are `india`.
17257    #[serde(skip_serializing_if = "Option::is_none")]
17258    pub supported_types:
17259        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
17260}
17261impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {
17262    pub fn new(
17263        amount: impl Into<i64>,
17264        amount_type: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
17265        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
17266        reference: impl Into<String>,
17267        start_date: impl Into<stripe_types::Timestamp>,
17268    ) -> Self {
17269        Self {
17270            amount: amount.into(),
17271            amount_type: amount_type.into(),
17272            description: None,
17273            end_date: None,
17274            interval: interval.into(),
17275            interval_count: None,
17276            reference: reference.into(),
17277            start_date: start_date.into(),
17278            supported_types: None,
17279        }
17280    }
17281}
17282/// One of `fixed` or `maximum`.
17283/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
17284/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
17285#[derive(Clone, Eq, PartialEq)]
17286#[non_exhaustive]
17287pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
17288    Fixed,
17289    Maximum,
17290    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17291    Unknown(String),
17292}
17293impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
17294    pub fn as_str(&self) -> &str {
17295        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
17296        match self {
17297            Fixed => "fixed",
17298            Maximum => "maximum",
17299            Unknown(v) => v,
17300        }
17301    }
17302}
17303
17304impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
17305    type Err = std::convert::Infallible;
17306    fn from_str(s: &str) -> Result<Self, Self::Err> {
17307        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
17308        match s {
17309            "fixed" => Ok(Fixed),
17310            "maximum" => Ok(Maximum),
17311            v => {
17312                tracing::warn!(
17313                    "Unknown value '{}' for enum '{}'",
17314                    v,
17315                    "UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"
17316                );
17317                Ok(Unknown(v.to_owned()))
17318            }
17319        }
17320    }
17321}
17322impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
17323    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17324        f.write_str(self.as_str())
17325    }
17326}
17327
17328impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
17329    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17330        f.write_str(self.as_str())
17331    }
17332}
17333impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
17334    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17335    where
17336        S: serde::Serializer,
17337    {
17338        serializer.serialize_str(self.as_str())
17339    }
17340}
17341#[cfg(feature = "deserialize")]
17342impl<'de> serde::Deserialize<'de>
17343    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
17344{
17345    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17346        use std::str::FromStr;
17347        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17348        Ok(Self::from_str(&s).expect("infallible"))
17349    }
17350}
17351/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
17352#[derive(Clone, Eq, PartialEq)]
17353#[non_exhaustive]
17354pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
17355    Day,
17356    Month,
17357    Sporadic,
17358    Week,
17359    Year,
17360    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17361    Unknown(String),
17362}
17363impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
17364    pub fn as_str(&self) -> &str {
17365        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
17366        match self {
17367            Day => "day",
17368            Month => "month",
17369            Sporadic => "sporadic",
17370            Week => "week",
17371            Year => "year",
17372            Unknown(v) => v,
17373        }
17374    }
17375}
17376
17377impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
17378    type Err = std::convert::Infallible;
17379    fn from_str(s: &str) -> Result<Self, Self::Err> {
17380        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
17381        match s {
17382            "day" => Ok(Day),
17383            "month" => Ok(Month),
17384            "sporadic" => Ok(Sporadic),
17385            "week" => Ok(Week),
17386            "year" => Ok(Year),
17387            v => {
17388                tracing::warn!(
17389                    "Unknown value '{}' for enum '{}'",
17390                    v,
17391                    "UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"
17392                );
17393                Ok(Unknown(v.to_owned()))
17394            }
17395        }
17396    }
17397}
17398impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
17399    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17400        f.write_str(self.as_str())
17401    }
17402}
17403
17404impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
17405    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17406        f.write_str(self.as_str())
17407    }
17408}
17409impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
17410    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17411    where
17412        S: serde::Serializer,
17413    {
17414        serializer.serialize_str(self.as_str())
17415    }
17416}
17417#[cfg(feature = "deserialize")]
17418impl<'de> serde::Deserialize<'de>
17419    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
17420{
17421    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17422        use std::str::FromStr;
17423        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17424        Ok(Self::from_str(&s).expect("infallible"))
17425    }
17426}
17427/// Specifies the type of mandates supported. Possible values are `india`.
17428#[derive(Clone, Eq, PartialEq)]
17429#[non_exhaustive]
17430pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
17431    India,
17432    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17433    Unknown(String),
17434}
17435impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
17436    pub fn as_str(&self) -> &str {
17437        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
17438        match self {
17439            India => "india",
17440            Unknown(v) => v,
17441        }
17442    }
17443}
17444
17445impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
17446    type Err = std::convert::Infallible;
17447    fn from_str(s: &str) -> Result<Self, Self::Err> {
17448        use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
17449        match s {
17450            "india" => Ok(India),
17451            v => {
17452                tracing::warn!(
17453                    "Unknown value '{}' for enum '{}'",
17454                    v,
17455                    "UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
17456                );
17457                Ok(Unknown(v.to_owned()))
17458            }
17459        }
17460    }
17461}
17462impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
17463    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17464        f.write_str(self.as_str())
17465    }
17466}
17467
17468impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
17469    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17470        f.write_str(self.as_str())
17471    }
17472}
17473impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
17474    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17475    where
17476        S: serde::Serializer,
17477    {
17478        serializer.serialize_str(self.as_str())
17479    }
17480}
17481#[cfg(feature = "deserialize")]
17482impl<'de> serde::Deserialize<'de>
17483    for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
17484{
17485    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17486        use std::str::FromStr;
17487        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17488        Ok(Self::from_str(&s).expect("infallible"))
17489    }
17490}
17491/// Selected network to process this PaymentIntent on.
17492/// Depends on the available networks of the card attached to the PaymentIntent.
17493/// Can be only set confirm-time.
17494#[derive(Clone, Eq, PartialEq)]
17495#[non_exhaustive]
17496pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17497    Amex,
17498    CartesBancaires,
17499    Diners,
17500    Discover,
17501    EftposAu,
17502    Girocard,
17503    Interac,
17504    Jcb,
17505    Link,
17506    Mastercard,
17507    Unionpay,
17508    Unknown,
17509    Visa,
17510    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17511    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
17512    _Unknown(String),
17513}
17514impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17515    pub fn as_str(&self) -> &str {
17516        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
17517        match self {
17518            Amex => "amex",
17519            CartesBancaires => "cartes_bancaires",
17520            Diners => "diners",
17521            Discover => "discover",
17522            EftposAu => "eftpos_au",
17523            Girocard => "girocard",
17524            Interac => "interac",
17525            Jcb => "jcb",
17526            Link => "link",
17527            Mastercard => "mastercard",
17528            Unionpay => "unionpay",
17529            Unknown => "unknown",
17530            Visa => "visa",
17531            _Unknown(v) => v,
17532        }
17533    }
17534}
17535
17536impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17537    type Err = std::convert::Infallible;
17538    fn from_str(s: &str) -> Result<Self, Self::Err> {
17539        use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*;
17540        match s {
17541            "amex" => Ok(Amex),
17542            "cartes_bancaires" => Ok(CartesBancaires),
17543            "diners" => Ok(Diners),
17544            "discover" => Ok(Discover),
17545            "eftpos_au" => Ok(EftposAu),
17546            "girocard" => Ok(Girocard),
17547            "interac" => Ok(Interac),
17548            "jcb" => Ok(Jcb),
17549            "link" => Ok(Link),
17550            "mastercard" => Ok(Mastercard),
17551            "unionpay" => Ok(Unionpay),
17552            "unknown" => Ok(Unknown),
17553            "visa" => Ok(Visa),
17554            v => {
17555                tracing::warn!(
17556                    "Unknown value '{}' for enum '{}'",
17557                    v,
17558                    "UpdatePaymentIntentPaymentMethodOptionsCardNetwork"
17559                );
17560                Ok(_Unknown(v.to_owned()))
17561            }
17562        }
17563    }
17564}
17565impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17566    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17567        f.write_str(self.as_str())
17568    }
17569}
17570
17571impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17573        f.write_str(self.as_str())
17574    }
17575}
17576impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17577    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17578    where
17579        S: serde::Serializer,
17580    {
17581        serializer.serialize_str(self.as_str())
17582    }
17583}
17584#[cfg(feature = "deserialize")]
17585impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardNetwork {
17586    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17587        use std::str::FromStr;
17588        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17589        Ok(Self::from_str(&s).expect("infallible"))
17590    }
17591}
17592/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
17593#[derive(Clone, Eq, PartialEq)]
17594#[non_exhaustive]
17595pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
17596    IfAvailable,
17597    Never,
17598    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17599    Unknown(String),
17600}
17601impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
17602    pub fn as_str(&self) -> &str {
17603        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
17604        match self {
17605            IfAvailable => "if_available",
17606            Never => "never",
17607            Unknown(v) => v,
17608        }
17609    }
17610}
17611
17612impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
17613    type Err = std::convert::Infallible;
17614    fn from_str(s: &str) -> Result<Self, Self::Err> {
17615        use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
17616        match s {
17617            "if_available" => Ok(IfAvailable),
17618            "never" => Ok(Never),
17619            v => {
17620                tracing::warn!(
17621                    "Unknown value '{}' for enum '{}'",
17622                    v,
17623                    "UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"
17624                );
17625                Ok(Unknown(v.to_owned()))
17626            }
17627        }
17628    }
17629}
17630impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
17631    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17632        f.write_str(self.as_str())
17633    }
17634}
17635
17636impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
17637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17638        f.write_str(self.as_str())
17639    }
17640}
17641impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
17642    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17643    where
17644        S: serde::Serializer,
17645    {
17646        serializer.serialize_str(self.as_str())
17647    }
17648}
17649#[cfg(feature = "deserialize")]
17650impl<'de> serde::Deserialize<'de>
17651    for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
17652{
17653    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17654        use std::str::FromStr;
17655        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17656        Ok(Self::from_str(&s).expect("infallible"))
17657    }
17658}
17659/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
17660#[derive(Clone, Eq, PartialEq)]
17661#[non_exhaustive]
17662pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
17663    IfAvailable,
17664    Never,
17665    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17666    Unknown(String),
17667}
17668impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
17669    pub fn as_str(&self) -> &str {
17670        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
17671        match self {
17672            IfAvailable => "if_available",
17673            Never => "never",
17674            Unknown(v) => v,
17675        }
17676    }
17677}
17678
17679impl std::str::FromStr
17680    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
17681{
17682    type Err = std::convert::Infallible;
17683    fn from_str(s: &str) -> Result<Self, Self::Err> {
17684        use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
17685        match s {
17686            "if_available" => Ok(IfAvailable),
17687            "never" => Ok(Never),
17688            v => {
17689                tracing::warn!(
17690                    "Unknown value '{}' for enum '{}'",
17691                    v,
17692                    "UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"
17693                );
17694                Ok(Unknown(v.to_owned()))
17695            }
17696        }
17697    }
17698}
17699impl std::fmt::Display
17700    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
17701{
17702    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17703        f.write_str(self.as_str())
17704    }
17705}
17706
17707impl std::fmt::Debug
17708    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
17709{
17710    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17711        f.write_str(self.as_str())
17712    }
17713}
17714impl serde::Serialize
17715    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
17716{
17717    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17718    where
17719        S: serde::Serializer,
17720    {
17721        serializer.serialize_str(self.as_str())
17722    }
17723}
17724#[cfg(feature = "deserialize")]
17725impl<'de> serde::Deserialize<'de>
17726    for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
17727{
17728    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17729        use std::str::FromStr;
17730        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17731        Ok(Self::from_str(&s).expect("infallible"))
17732    }
17733}
17734/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
17735#[derive(Clone, Eq, PartialEq)]
17736#[non_exhaustive]
17737pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
17738    IfAvailable,
17739    Never,
17740    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17741    Unknown(String),
17742}
17743impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
17744    pub fn as_str(&self) -> &str {
17745        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
17746        match self {
17747            IfAvailable => "if_available",
17748            Never => "never",
17749            Unknown(v) => v,
17750        }
17751    }
17752}
17753
17754impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
17755    type Err = std::convert::Infallible;
17756    fn from_str(s: &str) -> Result<Self, Self::Err> {
17757        use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
17758        match s {
17759            "if_available" => Ok(IfAvailable),
17760            "never" => Ok(Never),
17761            v => {
17762                tracing::warn!(
17763                    "Unknown value '{}' for enum '{}'",
17764                    v,
17765                    "UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture"
17766                );
17767                Ok(Unknown(v.to_owned()))
17768            }
17769        }
17770    }
17771}
17772impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
17773    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17774        f.write_str(self.as_str())
17775    }
17776}
17777
17778impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
17779    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17780        f.write_str(self.as_str())
17781    }
17782}
17783impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture {
17784    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17785    where
17786        S: serde::Serializer,
17787    {
17788        serializer.serialize_str(self.as_str())
17789    }
17790}
17791#[cfg(feature = "deserialize")]
17792impl<'de> serde::Deserialize<'de>
17793    for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture
17794{
17795    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17796        use std::str::FromStr;
17797        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17798        Ok(Self::from_str(&s).expect("infallible"))
17799    }
17800}
17801/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
17802#[derive(Clone, Eq, PartialEq)]
17803#[non_exhaustive]
17804pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
17805    IfAvailable,
17806    Never,
17807    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17808    Unknown(String),
17809}
17810impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
17811    pub fn as_str(&self) -> &str {
17812        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
17813        match self {
17814            IfAvailable => "if_available",
17815            Never => "never",
17816            Unknown(v) => v,
17817        }
17818    }
17819}
17820
17821impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
17822    type Err = std::convert::Infallible;
17823    fn from_str(s: &str) -> Result<Self, Self::Err> {
17824        use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
17825        match s {
17826            "if_available" => Ok(IfAvailable),
17827            "never" => Ok(Never),
17828            v => {
17829                tracing::warn!(
17830                    "Unknown value '{}' for enum '{}'",
17831                    v,
17832                    "UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture"
17833                );
17834                Ok(Unknown(v.to_owned()))
17835            }
17836        }
17837    }
17838}
17839impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
17840    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17841        f.write_str(self.as_str())
17842    }
17843}
17844
17845impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
17846    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17847        f.write_str(self.as_str())
17848    }
17849}
17850impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture {
17851    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17852    where
17853        S: serde::Serializer,
17854    {
17855        serializer.serialize_str(self.as_str())
17856    }
17857}
17858#[cfg(feature = "deserialize")]
17859impl<'de> serde::Deserialize<'de>
17860    for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture
17861{
17862    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17863        use std::str::FromStr;
17864        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17865        Ok(Self::from_str(&s).expect("infallible"))
17866    }
17867}
17868/// 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).
17869/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
17870/// If not provided, this value defaults to `automatic`.
17871/// 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.
17872#[derive(Clone, Eq, PartialEq)]
17873#[non_exhaustive]
17874pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
17875    Any,
17876    Automatic,
17877    Challenge,
17878    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17879    Unknown(String),
17880}
17881impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
17882    pub fn as_str(&self) -> &str {
17883        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
17884        match self {
17885            Any => "any",
17886            Automatic => "automatic",
17887            Challenge => "challenge",
17888            Unknown(v) => v,
17889        }
17890    }
17891}
17892
17893impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
17894    type Err = std::convert::Infallible;
17895    fn from_str(s: &str) -> Result<Self, Self::Err> {
17896        use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
17897        match s {
17898            "any" => Ok(Any),
17899            "automatic" => Ok(Automatic),
17900            "challenge" => Ok(Challenge),
17901            v => {
17902                tracing::warn!(
17903                    "Unknown value '{}' for enum '{}'",
17904                    v,
17905                    "UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure"
17906                );
17907                Ok(Unknown(v.to_owned()))
17908            }
17909        }
17910    }
17911}
17912impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
17913    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17914        f.write_str(self.as_str())
17915    }
17916}
17917
17918impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
17919    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17920        f.write_str(self.as_str())
17921    }
17922}
17923impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
17924    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
17925    where
17926        S: serde::Serializer,
17927    {
17928        serializer.serialize_str(self.as_str())
17929    }
17930}
17931#[cfg(feature = "deserialize")]
17932impl<'de> serde::Deserialize<'de>
17933    for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
17934{
17935    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
17936        use std::str::FromStr;
17937        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
17938        Ok(Self::from_str(&s).expect("infallible"))
17939    }
17940}
17941/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
17942///
17943/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
17944/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
17945///
17946/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
17947///
17948/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
17949///
17950/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
17951#[derive(Clone, Eq, PartialEq)]
17952#[non_exhaustive]
17953pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
17954    None,
17955    OffSession,
17956    OnSession,
17957    /// An unrecognized value from Stripe. Should not be used as a request parameter.
17958    Unknown(String),
17959}
17960impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
17961    pub fn as_str(&self) -> &str {
17962        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
17963        match self {
17964            None => "none",
17965            OffSession => "off_session",
17966            OnSession => "on_session",
17967            Unknown(v) => v,
17968        }
17969    }
17970}
17971
17972impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
17973    type Err = std::convert::Infallible;
17974    fn from_str(s: &str) -> Result<Self, Self::Err> {
17975        use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
17976        match s {
17977            "none" => Ok(None),
17978            "off_session" => Ok(OffSession),
17979            "on_session" => Ok(OnSession),
17980            v => {
17981                tracing::warn!(
17982                    "Unknown value '{}' for enum '{}'",
17983                    v,
17984                    "UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage"
17985                );
17986                Ok(Unknown(v.to_owned()))
17987            }
17988        }
17989    }
17990}
17991impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
17992    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17993        f.write_str(self.as_str())
17994    }
17995}
17996
17997impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
17998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
17999        f.write_str(self.as_str())
18000    }
18001}
18002impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
18003    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18004    where
18005        S: serde::Serializer,
18006    {
18007        serializer.serialize_str(self.as_str())
18008    }
18009}
18010#[cfg(feature = "deserialize")]
18011impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
18012    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18013        use std::str::FromStr;
18014        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18015        Ok(Self::from_str(&s).expect("infallible"))
18016    }
18017}
18018/// If 3D Secure authentication was performed with a third-party provider,
18019/// the authentication details to use for this payment.
18020#[derive(Clone, Debug, serde::Serialize)]
18021pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
18022    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
18023    #[serde(skip_serializing_if = "Option::is_none")]
18024    pub ares_trans_status:
18025        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
18026    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
18027    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
18028    /// (Most 3D Secure providers will return the base64-encoded version, which
18029    /// is what you should specify here.)
18030    pub cryptogram: String,
18031    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
18032    /// provider and indicates what degree of authentication was performed.
18033    #[serde(skip_serializing_if = "Option::is_none")]
18034    pub electronic_commerce_indicator:
18035        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
18036    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
18037    #[serde(skip_serializing_if = "Option::is_none")]
18038    pub exemption_indicator:
18039        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
18040    /// Network specific 3DS fields. Network specific arguments require an
18041    /// explicit card brand choice. The parameter `payment_method_options.card.network``
18042    /// must be populated accordingly
18043    #[serde(skip_serializing_if = "Option::is_none")]
18044    pub network_options:
18045        Option<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
18046    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
18047    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
18048    #[serde(skip_serializing_if = "Option::is_none")]
18049    pub requestor_challenge_indicator: Option<String>,
18050    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
18051    /// Transaction ID (dsTransID).
18052    pub transaction_id: String,
18053    /// The version of 3D Secure that was performed.
18054    pub version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
18055}
18056impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure {
18057    pub fn new(
18058        cryptogram: impl Into<String>,
18059        transaction_id: impl Into<String>,
18060        version: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
18061    ) -> Self {
18062        Self {
18063            ares_trans_status: None,
18064            cryptogram: cryptogram.into(),
18065            electronic_commerce_indicator: None,
18066            exemption_indicator: None,
18067            network_options: None,
18068            requestor_challenge_indicator: None,
18069            transaction_id: transaction_id.into(),
18070            version: version.into(),
18071        }
18072    }
18073}
18074/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
18075#[derive(Clone, Eq, PartialEq)]
18076#[non_exhaustive]
18077pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
18078    A,
18079    C,
18080    I,
18081    N,
18082    R,
18083    U,
18084    Y,
18085    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18086    Unknown(String),
18087}
18088impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
18089    pub fn as_str(&self) -> &str {
18090        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
18091        match self {
18092            A => "A",
18093            C => "C",
18094            I => "I",
18095            N => "N",
18096            R => "R",
18097            U => "U",
18098            Y => "Y",
18099            Unknown(v) => v,
18100        }
18101    }
18102}
18103
18104impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
18105    type Err = std::convert::Infallible;
18106    fn from_str(s: &str) -> Result<Self, Self::Err> {
18107        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
18108        match s {
18109            "A" => Ok(A),
18110            "C" => Ok(C),
18111            "I" => Ok(I),
18112            "N" => Ok(N),
18113            "R" => Ok(R),
18114            "U" => Ok(U),
18115            "Y" => Ok(Y),
18116            v => {
18117                tracing::warn!(
18118                    "Unknown value '{}' for enum '{}'",
18119                    v,
18120                    "UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
18121                );
18122                Ok(Unknown(v.to_owned()))
18123            }
18124        }
18125    }
18126}
18127impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
18128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18129        f.write_str(self.as_str())
18130    }
18131}
18132
18133impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
18134    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18135        f.write_str(self.as_str())
18136    }
18137}
18138impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
18139    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18140    where
18141        S: serde::Serializer,
18142    {
18143        serializer.serialize_str(self.as_str())
18144    }
18145}
18146#[cfg(feature = "deserialize")]
18147impl<'de> serde::Deserialize<'de>
18148    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
18149{
18150    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18151        use std::str::FromStr;
18152        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18153        Ok(Self::from_str(&s).expect("infallible"))
18154    }
18155}
18156/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
18157/// provider and indicates what degree of authentication was performed.
18158#[derive(Clone, Eq, PartialEq)]
18159#[non_exhaustive]
18160pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
18161    V01,
18162    V02,
18163    V05,
18164    V06,
18165    V07,
18166    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18167    Unknown(String),
18168}
18169impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
18170    pub fn as_str(&self) -> &str {
18171        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
18172        match self {
18173            V01 => "01",
18174            V02 => "02",
18175            V05 => "05",
18176            V06 => "06",
18177            V07 => "07",
18178            Unknown(v) => v,
18179        }
18180    }
18181}
18182
18183impl std::str::FromStr
18184    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
18185{
18186    type Err = std::convert::Infallible;
18187    fn from_str(s: &str) -> Result<Self, Self::Err> {
18188        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
18189        match s {
18190            "01" => Ok(V01),
18191            "02" => Ok(V02),
18192            "05" => Ok(V05),
18193            "06" => Ok(V06),
18194            "07" => Ok(V07),
18195            v => {
18196                tracing::warn!(
18197                    "Unknown value '{}' for enum '{}'",
18198                    v,
18199                    "UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
18200                );
18201                Ok(Unknown(v.to_owned()))
18202            }
18203        }
18204    }
18205}
18206impl std::fmt::Display
18207    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
18208{
18209    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18210        f.write_str(self.as_str())
18211    }
18212}
18213
18214impl std::fmt::Debug
18215    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
18216{
18217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18218        f.write_str(self.as_str())
18219    }
18220}
18221impl serde::Serialize
18222    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
18223{
18224    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18225    where
18226        S: serde::Serializer,
18227    {
18228        serializer.serialize_str(self.as_str())
18229    }
18230}
18231#[cfg(feature = "deserialize")]
18232impl<'de> serde::Deserialize<'de>
18233    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
18234{
18235    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18236        use std::str::FromStr;
18237        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18238        Ok(Self::from_str(&s).expect("infallible"))
18239    }
18240}
18241/// The exemption requested via 3DS and accepted by the issuer at authentication time.
18242#[derive(Clone, Eq, PartialEq)]
18243#[non_exhaustive]
18244pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
18245    LowRisk,
18246    None,
18247    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18248    Unknown(String),
18249}
18250impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
18251    pub fn as_str(&self) -> &str {
18252        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
18253        match self {
18254            LowRisk => "low_risk",
18255            None => "none",
18256            Unknown(v) => v,
18257        }
18258    }
18259}
18260
18261impl std::str::FromStr
18262    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
18263{
18264    type Err = std::convert::Infallible;
18265    fn from_str(s: &str) -> Result<Self, Self::Err> {
18266        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
18267        match s {
18268            "low_risk" => Ok(LowRisk),
18269            "none" => Ok(None),
18270            v => {
18271                tracing::warn!(
18272                    "Unknown value '{}' for enum '{}'",
18273                    v,
18274                    "UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"
18275                );
18276                Ok(Unknown(v.to_owned()))
18277            }
18278        }
18279    }
18280}
18281impl std::fmt::Display
18282    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
18283{
18284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18285        f.write_str(self.as_str())
18286    }
18287}
18288
18289impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
18290    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18291        f.write_str(self.as_str())
18292    }
18293}
18294impl serde::Serialize
18295    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
18296{
18297    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18298    where
18299        S: serde::Serializer,
18300    {
18301        serializer.serialize_str(self.as_str())
18302    }
18303}
18304#[cfg(feature = "deserialize")]
18305impl<'de> serde::Deserialize<'de>
18306    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
18307{
18308    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18309        use std::str::FromStr;
18310        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18311        Ok(Self::from_str(&s).expect("infallible"))
18312    }
18313}
18314/// Network specific 3DS fields. Network specific arguments require an
18315/// explicit card brand choice. The parameter `payment_method_options.card.network``
18316/// must be populated accordingly
18317#[derive(Clone, Debug, serde::Serialize)]
18318pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
18319    /// Cartes Bancaires-specific 3DS fields.
18320    #[serde(skip_serializing_if = "Option::is_none")]
18321    pub cartes_bancaires: Option<
18322        UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
18323    >,
18324}
18325impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
18326    pub fn new() -> Self {
18327        Self { cartes_bancaires: None }
18328    }
18329}
18330impl Default for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
18331    fn default() -> Self {
18332        Self::new()
18333    }
18334}
18335/// Cartes Bancaires-specific 3DS fields.
18336#[derive(Clone, Debug, serde::Serialize)]
18337pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
18338    /// The cryptogram calculation algorithm used by the card Issuer's ACS
18339    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
18340    /// messageExtension: CB-AVALGO
18341pub cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
18342    /// The exemption indicator returned from Cartes Bancaires in the ARes.
18343    /// message extension: CB-EXEMPTION; string (4 characters)
18344    /// This is a 3 byte bitmap (low significant byte first and most significant
18345    /// bit first) that has been Base64 encoded
18346#[serde(skip_serializing_if = "Option::is_none")]
18347pub cb_exemption: Option<String>,
18348    /// The risk score returned from Cartes Bancaires in the ARes.
18349    /// message extension: CB-SCORE; numeric value 0-99
18350#[serde(skip_serializing_if = "Option::is_none")]
18351pub cb_score: Option<i64>,
18352
18353}
18354impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
18355    pub fn new(
18356        cb_avalgo: impl Into<UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
18357    ) -> Self {
18358        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
18359    }
18360}
18361/// The cryptogram calculation algorithm used by the card Issuer's ACS
18362/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
18363/// messageExtension: CB-AVALGO
18364#[derive(Clone, Eq, PartialEq)]
18365#[non_exhaustive]
18366pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
18367{
18368    V0,
18369    V1,
18370    V2,
18371    V3,
18372    V4,
18373    A,
18374    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18375    Unknown(String),
18376}
18377impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
18378    pub fn as_str(&self) -> &str {
18379        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
18380        match self {
18381            V0 => "0",
18382            V1 => "1",
18383            V2 => "2",
18384            V3 => "3",
18385            V4 => "4",
18386            A => "A",
18387            Unknown(v) => v,
18388        }
18389    }
18390}
18391
18392impl std::str::FromStr
18393    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
18394{
18395    type Err = std::convert::Infallible;
18396    fn from_str(s: &str) -> Result<Self, Self::Err> {
18397        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
18398        match s {
18399            "0" => Ok(V0),
18400            "1" => Ok(V1),
18401            "2" => Ok(V2),
18402            "3" => Ok(V3),
18403            "4" => Ok(V4),
18404            "A" => Ok(A),
18405            v => {
18406                tracing::warn!(
18407                    "Unknown value '{}' for enum '{}'",
18408                    v,
18409                    "UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
18410                );
18411                Ok(Unknown(v.to_owned()))
18412            }
18413        }
18414    }
18415}
18416impl std::fmt::Display
18417    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
18418{
18419    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18420        f.write_str(self.as_str())
18421    }
18422}
18423
18424impl std::fmt::Debug
18425    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
18426{
18427    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18428        f.write_str(self.as_str())
18429    }
18430}
18431impl serde::Serialize
18432    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
18433{
18434    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18435    where
18436        S: serde::Serializer,
18437    {
18438        serializer.serialize_str(self.as_str())
18439    }
18440}
18441#[cfg(feature = "deserialize")]
18442impl<'de> serde::Deserialize<'de>
18443    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
18444{
18445    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18446        use std::str::FromStr;
18447        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18448        Ok(Self::from_str(&s).expect("infallible"))
18449    }
18450}
18451/// The version of 3D Secure that was performed.
18452#[derive(Clone, Eq, PartialEq)]
18453#[non_exhaustive]
18454pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
18455    V1_0_2,
18456    V2_1_0,
18457    V2_2_0,
18458    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18459    Unknown(String),
18460}
18461impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
18462    pub fn as_str(&self) -> &str {
18463        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
18464        match self {
18465            V1_0_2 => "1.0.2",
18466            V2_1_0 => "2.1.0",
18467            V2_2_0 => "2.2.0",
18468            Unknown(v) => v,
18469        }
18470    }
18471}
18472
18473impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
18474    type Err = std::convert::Infallible;
18475    fn from_str(s: &str) -> Result<Self, Self::Err> {
18476        use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
18477        match s {
18478            "1.0.2" => Ok(V1_0_2),
18479            "2.1.0" => Ok(V2_1_0),
18480            "2.2.0" => Ok(V2_2_0),
18481            v => {
18482                tracing::warn!(
18483                    "Unknown value '{}' for enum '{}'",
18484                    v,
18485                    "UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion"
18486                );
18487                Ok(Unknown(v.to_owned()))
18488            }
18489        }
18490    }
18491}
18492impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
18493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18494        f.write_str(self.as_str())
18495    }
18496}
18497
18498impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
18499    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18500        f.write_str(self.as_str())
18501    }
18502}
18503impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
18504    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18505    where
18506        S: serde::Serializer,
18507    {
18508        serializer.serialize_str(self.as_str())
18509    }
18510}
18511#[cfg(feature = "deserialize")]
18512impl<'de> serde::Deserialize<'de>
18513    for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
18514{
18515    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18516        use std::str::FromStr;
18517        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18518        Ok(Self::from_str(&s).expect("infallible"))
18519    }
18520}
18521/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
18522#[derive(Clone, Debug, serde::Serialize)]
18523pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent {
18524    /// Controls when the funds are captured from the customer's account.
18525    ///
18526    /// 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.
18527    ///
18528    /// 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.
18529    #[serde(skip_serializing_if = "Option::is_none")]
18530    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod>,
18531    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
18532    #[serde(skip_serializing_if = "Option::is_none")]
18533    pub request_extended_authorization: Option<bool>,
18534    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
18535    /// 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.
18536    #[serde(skip_serializing_if = "Option::is_none")]
18537    pub request_incremental_authorization_support: Option<bool>,
18538    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
18539    #[serde(skip_serializing_if = "Option::is_none")]
18540    pub routing: Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting>,
18541}
18542impl UpdatePaymentIntentPaymentMethodOptionsCardPresent {
18543    pub fn new() -> Self {
18544        Self {
18545            capture_method: None,
18546            request_extended_authorization: None,
18547            request_incremental_authorization_support: None,
18548            routing: None,
18549        }
18550    }
18551}
18552impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresent {
18553    fn default() -> Self {
18554        Self::new()
18555    }
18556}
18557/// Controls when the funds are captured from the customer's account.
18558///
18559/// 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.
18560///
18561/// 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.
18562#[derive(Clone, Eq, PartialEq)]
18563#[non_exhaustive]
18564pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
18565    Manual,
18566    ManualPreferred,
18567    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18568    Unknown(String),
18569}
18570impl UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
18571    pub fn as_str(&self) -> &str {
18572        use UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
18573        match self {
18574            Manual => "manual",
18575            ManualPreferred => "manual_preferred",
18576            Unknown(v) => v,
18577        }
18578    }
18579}
18580
18581impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
18582    type Err = std::convert::Infallible;
18583    fn from_str(s: &str) -> Result<Self, Self::Err> {
18584        use UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
18585        match s {
18586            "manual" => Ok(Manual),
18587            "manual_preferred" => Ok(ManualPreferred),
18588            v => {
18589                tracing::warn!(
18590                    "Unknown value '{}' for enum '{}'",
18591                    v,
18592                    "UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod"
18593                );
18594                Ok(Unknown(v.to_owned()))
18595            }
18596        }
18597    }
18598}
18599impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
18600    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18601        f.write_str(self.as_str())
18602    }
18603}
18604
18605impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
18606    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18607        f.write_str(self.as_str())
18608    }
18609}
18610impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
18611    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18612    where
18613        S: serde::Serializer,
18614    {
18615        serializer.serialize_str(self.as_str())
18616    }
18617}
18618#[cfg(feature = "deserialize")]
18619impl<'de> serde::Deserialize<'de>
18620    for UpdatePaymentIntentPaymentMethodOptionsCardPresentCaptureMethod
18621{
18622    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18623        use std::str::FromStr;
18624        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18625        Ok(Self::from_str(&s).expect("infallible"))
18626    }
18627}
18628/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
18629#[derive(Clone, Debug, serde::Serialize)]
18630pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
18631    /// Routing requested priority
18632    #[serde(skip_serializing_if = "Option::is_none")]
18633    pub requested_priority:
18634        Option<UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
18635}
18636impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
18637    pub fn new() -> Self {
18638        Self { requested_priority: None }
18639    }
18640}
18641impl Default for UpdatePaymentIntentPaymentMethodOptionsCardPresentRouting {
18642    fn default() -> Self {
18643        Self::new()
18644    }
18645}
18646/// Routing requested priority
18647#[derive(Clone, Eq, PartialEq)]
18648#[non_exhaustive]
18649pub enum UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
18650    Domestic,
18651    International,
18652    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18653    Unknown(String),
18654}
18655impl UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
18656    pub fn as_str(&self) -> &str {
18657        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
18658        match self {
18659            Domestic => "domestic",
18660            International => "international",
18661            Unknown(v) => v,
18662        }
18663    }
18664}
18665
18666impl std::str::FromStr
18667    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
18668{
18669    type Err = std::convert::Infallible;
18670    fn from_str(s: &str) -> Result<Self, Self::Err> {
18671        use UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
18672        match s {
18673            "domestic" => Ok(Domestic),
18674            "international" => Ok(International),
18675            v => {
18676                tracing::warn!(
18677                    "Unknown value '{}' for enum '{}'",
18678                    v,
18679                    "UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"
18680                );
18681                Ok(Unknown(v.to_owned()))
18682            }
18683        }
18684    }
18685}
18686impl std::fmt::Display
18687    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
18688{
18689    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18690        f.write_str(self.as_str())
18691    }
18692}
18693
18694impl std::fmt::Debug
18695    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
18696{
18697    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18698        f.write_str(self.as_str())
18699    }
18700}
18701impl serde::Serialize
18702    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
18703{
18704    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18705    where
18706        S: serde::Serializer,
18707    {
18708        serializer.serialize_str(self.as_str())
18709    }
18710}
18711#[cfg(feature = "deserialize")]
18712impl<'de> serde::Deserialize<'de>
18713    for UpdatePaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
18714{
18715    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18716        use std::str::FromStr;
18717        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18718        Ok(Self::from_str(&s).expect("infallible"))
18719    }
18720}
18721/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
18722#[derive(Clone, Debug, serde::Serialize)]
18723pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp {
18724    /// Controls when the funds are captured from the customer's account.
18725    ///
18726    /// 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.
18727    ///
18728    /// 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.
18729    #[serde(skip_serializing_if = "Option::is_none")]
18730    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
18731    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18732    ///
18733    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18734    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18735    ///
18736    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18737    ///
18738    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18739    ///
18740    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18741    #[serde(skip_serializing_if = "Option::is_none")]
18742    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
18743}
18744impl UpdatePaymentIntentPaymentMethodOptionsCashapp {
18745    pub fn new() -> Self {
18746        Self { capture_method: None, setup_future_usage: None }
18747    }
18748}
18749impl Default for UpdatePaymentIntentPaymentMethodOptionsCashapp {
18750    fn default() -> Self {
18751        Self::new()
18752    }
18753}
18754/// Controls when the funds are captured from the customer's account.
18755///
18756/// 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.
18757///
18758/// 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.
18759#[derive(Clone, Eq, PartialEq)]
18760#[non_exhaustive]
18761pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18762    Manual,
18763    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18764    Unknown(String),
18765}
18766impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18767    pub fn as_str(&self) -> &str {
18768        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
18769        match self {
18770            Manual => "manual",
18771            Unknown(v) => v,
18772        }
18773    }
18774}
18775
18776impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18777    type Err = std::convert::Infallible;
18778    fn from_str(s: &str) -> Result<Self, Self::Err> {
18779        use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
18780        match s {
18781            "manual" => Ok(Manual),
18782            v => {
18783                tracing::warn!(
18784                    "Unknown value '{}' for enum '{}'",
18785                    v,
18786                    "UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod"
18787                );
18788                Ok(Unknown(v.to_owned()))
18789            }
18790        }
18791    }
18792}
18793impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18794    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18795        f.write_str(self.as_str())
18796    }
18797}
18798
18799impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18800    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18801        f.write_str(self.as_str())
18802    }
18803}
18804impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18805    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18806    where
18807        S: serde::Serializer,
18808    {
18809        serializer.serialize_str(self.as_str())
18810    }
18811}
18812#[cfg(feature = "deserialize")]
18813impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod {
18814    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18815        use std::str::FromStr;
18816        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18817        Ok(Self::from_str(&s).expect("infallible"))
18818    }
18819}
18820/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18821///
18822/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18823/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18824///
18825/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18826///
18827/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18828///
18829/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18830#[derive(Clone, Eq, PartialEq)]
18831#[non_exhaustive]
18832pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
18833    None,
18834    OffSession,
18835    OnSession,
18836    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18837    Unknown(String),
18838}
18839impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
18840    pub fn as_str(&self) -> &str {
18841        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
18842        match self {
18843            None => "none",
18844            OffSession => "off_session",
18845            OnSession => "on_session",
18846            Unknown(v) => v,
18847        }
18848    }
18849}
18850
18851impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
18852    type Err = std::convert::Infallible;
18853    fn from_str(s: &str) -> Result<Self, Self::Err> {
18854        use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
18855        match s {
18856            "none" => Ok(None),
18857            "off_session" => Ok(OffSession),
18858            "on_session" => Ok(OnSession),
18859            v => {
18860                tracing::warn!(
18861                    "Unknown value '{}' for enum '{}'",
18862                    v,
18863                    "UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage"
18864                );
18865                Ok(Unknown(v.to_owned()))
18866            }
18867        }
18868    }
18869}
18870impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
18871    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18872        f.write_str(self.as_str())
18873    }
18874}
18875
18876impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
18877    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18878        f.write_str(self.as_str())
18879    }
18880}
18881impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
18882    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18883    where
18884        S: serde::Serializer,
18885    {
18886        serializer.serialize_str(self.as_str())
18887    }
18888}
18889#[cfg(feature = "deserialize")]
18890impl<'de> serde::Deserialize<'de>
18891    for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
18892{
18893    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18894        use std::str::FromStr;
18895        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18896        Ok(Self::from_str(&s).expect("infallible"))
18897    }
18898}
18899/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
18900#[derive(Clone, Debug, serde::Serialize)]
18901pub struct UpdatePaymentIntentPaymentMethodOptionsCrypto {
18902    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18903    ///
18904    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18905    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18906    ///
18907    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18908    ///
18909    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18910    ///
18911    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18912    #[serde(skip_serializing_if = "Option::is_none")]
18913    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
18914}
18915impl UpdatePaymentIntentPaymentMethodOptionsCrypto {
18916    pub fn new() -> Self {
18917        Self { setup_future_usage: None }
18918    }
18919}
18920impl Default for UpdatePaymentIntentPaymentMethodOptionsCrypto {
18921    fn default() -> Self {
18922        Self::new()
18923    }
18924}
18925/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
18926///
18927/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
18928/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
18929///
18930/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
18931///
18932/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
18933///
18934/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
18935#[derive(Clone, Eq, PartialEq)]
18936#[non_exhaustive]
18937pub enum UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
18938    None,
18939    /// An unrecognized value from Stripe. Should not be used as a request parameter.
18940    Unknown(String),
18941}
18942impl UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
18943    pub fn as_str(&self) -> &str {
18944        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
18945        match self {
18946            None => "none",
18947            Unknown(v) => v,
18948        }
18949    }
18950}
18951
18952impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
18953    type Err = std::convert::Infallible;
18954    fn from_str(s: &str) -> Result<Self, Self::Err> {
18955        use UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
18956        match s {
18957            "none" => Ok(None),
18958            v => {
18959                tracing::warn!(
18960                    "Unknown value '{}' for enum '{}'",
18961                    v,
18962                    "UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage"
18963                );
18964                Ok(Unknown(v.to_owned()))
18965            }
18966        }
18967    }
18968}
18969impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
18970    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18971        f.write_str(self.as_str())
18972    }
18973}
18974
18975impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
18976    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18977        f.write_str(self.as_str())
18978    }
18979}
18980impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
18981    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
18982    where
18983        S: serde::Serializer,
18984    {
18985        serializer.serialize_str(self.as_str())
18986    }
18987}
18988#[cfg(feature = "deserialize")]
18989impl<'de> serde::Deserialize<'de>
18990    for UpdatePaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
18991{
18992    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
18993        use std::str::FromStr;
18994        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
18995        Ok(Self::from_str(&s).expect("infallible"))
18996    }
18997}
18998/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
18999#[derive(Clone, Debug, serde::Serialize)]
19000pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
19001    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
19002    #[serde(skip_serializing_if = "Option::is_none")]
19003    pub bank_transfer: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
19004    /// The funding method type to be used when there are not enough funds in the customer balance.
19005    /// Permitted values include: `bank_transfer`.
19006    #[serde(skip_serializing_if = "Option::is_none")]
19007    pub funding_type: Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
19008    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19009    ///
19010    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19011    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19012    ///
19013    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19014    ///
19015    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19016    ///
19017    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19018    #[serde(skip_serializing_if = "Option::is_none")]
19019    pub setup_future_usage:
19020        Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
19021}
19022impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
19023    pub fn new() -> Self {
19024        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
19025    }
19026}
19027impl Default for UpdatePaymentIntentPaymentMethodOptionsCustomerBalance {
19028    fn default() -> Self {
19029        Self::new()
19030    }
19031}
19032/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
19033#[derive(Clone, Debug, serde::Serialize)]
19034pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
19035    /// Configuration for the eu_bank_transfer funding type.
19036    #[serde(skip_serializing_if = "Option::is_none")]
19037    pub eu_bank_transfer: Option<EuBankTransferParams>,
19038    /// List of address types that should be returned in the financial_addresses response.
19039    /// If not specified, all valid types will be returned.
19040    ///
19041    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
19042    #[serde(skip_serializing_if = "Option::is_none")]
19043    pub requested_address_types: Option<
19044        Vec<
19045            UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes,
19046        >,
19047    >,
19048    /// 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`.
19049    #[serde(rename = "type")]
19050    pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
19051}
19052impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
19053    pub fn new(
19054        type_: impl Into<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
19055    ) -> Self {
19056        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
19057    }
19058}
19059/// List of address types that should be returned in the financial_addresses response.
19060/// If not specified, all valid types will be returned.
19061///
19062/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
19063#[derive(Clone, Eq, PartialEq)]
19064#[non_exhaustive]
19065pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
19066    Aba,
19067    Iban,
19068    Sepa,
19069    SortCode,
19070    Spei,
19071    Swift,
19072    Zengin,
19073    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19074    Unknown(String),
19075}
19076impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
19077    pub fn as_str(&self) -> &str {
19078        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
19079        match self {
19080            Aba => "aba",
19081            Iban => "iban",
19082            Sepa => "sepa",
19083            SortCode => "sort_code",
19084            Spei => "spei",
19085            Swift => "swift",
19086            Zengin => "zengin",
19087            Unknown(v) => v,
19088        }
19089    }
19090}
19091
19092impl std::str::FromStr
19093    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
19094{
19095    type Err = std::convert::Infallible;
19096    fn from_str(s: &str) -> Result<Self, Self::Err> {
19097        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
19098        match s {
19099            "aba" => Ok(Aba),
19100            "iban" => Ok(Iban),
19101            "sepa" => Ok(Sepa),
19102            "sort_code" => Ok(SortCode),
19103            "spei" => Ok(Spei),
19104            "swift" => Ok(Swift),
19105            "zengin" => Ok(Zengin),
19106            v => {
19107                tracing::warn!(
19108                    "Unknown value '{}' for enum '{}'",
19109                    v,
19110                    "UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"
19111                );
19112                Ok(Unknown(v.to_owned()))
19113            }
19114        }
19115    }
19116}
19117impl std::fmt::Display
19118    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
19119{
19120    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19121        f.write_str(self.as_str())
19122    }
19123}
19124
19125impl std::fmt::Debug
19126    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
19127{
19128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19129        f.write_str(self.as_str())
19130    }
19131}
19132impl serde::Serialize
19133    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
19134{
19135    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19136    where
19137        S: serde::Serializer,
19138    {
19139        serializer.serialize_str(self.as_str())
19140    }
19141}
19142#[cfg(feature = "deserialize")]
19143impl<'de> serde::Deserialize<'de>
19144    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
19145{
19146    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19147        use std::str::FromStr;
19148        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19149        Ok(Self::from_str(&s).expect("infallible"))
19150    }
19151}
19152/// 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`.
19153#[derive(Clone, Eq, PartialEq)]
19154#[non_exhaustive]
19155pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
19156    EuBankTransfer,
19157    GbBankTransfer,
19158    JpBankTransfer,
19159    MxBankTransfer,
19160    UsBankTransfer,
19161    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19162    Unknown(String),
19163}
19164impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
19165    pub fn as_str(&self) -> &str {
19166        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
19167        match self {
19168            EuBankTransfer => "eu_bank_transfer",
19169            GbBankTransfer => "gb_bank_transfer",
19170            JpBankTransfer => "jp_bank_transfer",
19171            MxBankTransfer => "mx_bank_transfer",
19172            UsBankTransfer => "us_bank_transfer",
19173            Unknown(v) => v,
19174        }
19175    }
19176}
19177
19178impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
19179    type Err = std::convert::Infallible;
19180    fn from_str(s: &str) -> Result<Self, Self::Err> {
19181        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
19182        match s {
19183            "eu_bank_transfer" => Ok(EuBankTransfer),
19184            "gb_bank_transfer" => Ok(GbBankTransfer),
19185            "jp_bank_transfer" => Ok(JpBankTransfer),
19186            "mx_bank_transfer" => Ok(MxBankTransfer),
19187            "us_bank_transfer" => Ok(UsBankTransfer),
19188            v => {
19189                tracing::warn!(
19190                    "Unknown value '{}' for enum '{}'",
19191                    v,
19192                    "UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"
19193                );
19194                Ok(Unknown(v.to_owned()))
19195            }
19196        }
19197    }
19198}
19199impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
19200    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19201        f.write_str(self.as_str())
19202    }
19203}
19204
19205impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
19206    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19207        f.write_str(self.as_str())
19208    }
19209}
19210impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
19211    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19212    where
19213        S: serde::Serializer,
19214    {
19215        serializer.serialize_str(self.as_str())
19216    }
19217}
19218#[cfg(feature = "deserialize")]
19219impl<'de> serde::Deserialize<'de>
19220    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
19221{
19222    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19223        use std::str::FromStr;
19224        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19225        Ok(Self::from_str(&s).expect("infallible"))
19226    }
19227}
19228/// The funding method type to be used when there are not enough funds in the customer balance.
19229/// Permitted values include: `bank_transfer`.
19230#[derive(Clone, Eq, PartialEq)]
19231#[non_exhaustive]
19232pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
19233    BankTransfer,
19234    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19235    Unknown(String),
19236}
19237impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
19238    pub fn as_str(&self) -> &str {
19239        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
19240        match self {
19241            BankTransfer => "bank_transfer",
19242            Unknown(v) => v,
19243        }
19244    }
19245}
19246
19247impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
19248    type Err = std::convert::Infallible;
19249    fn from_str(s: &str) -> Result<Self, Self::Err> {
19250        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
19251        match s {
19252            "bank_transfer" => Ok(BankTransfer),
19253            v => {
19254                tracing::warn!(
19255                    "Unknown value '{}' for enum '{}'",
19256                    v,
19257                    "UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"
19258                );
19259                Ok(Unknown(v.to_owned()))
19260            }
19261        }
19262    }
19263}
19264impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
19265    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19266        f.write_str(self.as_str())
19267    }
19268}
19269
19270impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
19271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19272        f.write_str(self.as_str())
19273    }
19274}
19275impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
19276    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19277    where
19278        S: serde::Serializer,
19279    {
19280        serializer.serialize_str(self.as_str())
19281    }
19282}
19283#[cfg(feature = "deserialize")]
19284impl<'de> serde::Deserialize<'de>
19285    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
19286{
19287    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19288        use std::str::FromStr;
19289        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19290        Ok(Self::from_str(&s).expect("infallible"))
19291    }
19292}
19293/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19294///
19295/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19296/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19297///
19298/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19299///
19300/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19301///
19302/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19303#[derive(Clone, Eq, PartialEq)]
19304#[non_exhaustive]
19305pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
19306    None,
19307    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19308    Unknown(String),
19309}
19310impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
19311    pub fn as_str(&self) -> &str {
19312        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
19313        match self {
19314            None => "none",
19315            Unknown(v) => v,
19316        }
19317    }
19318}
19319
19320impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
19321    type Err = std::convert::Infallible;
19322    fn from_str(s: &str) -> Result<Self, Self::Err> {
19323        use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
19324        match s {
19325            "none" => Ok(None),
19326            v => {
19327                tracing::warn!(
19328                    "Unknown value '{}' for enum '{}'",
19329                    v,
19330                    "UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"
19331                );
19332                Ok(Unknown(v.to_owned()))
19333            }
19334        }
19335    }
19336}
19337impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
19338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19339        f.write_str(self.as_str())
19340    }
19341}
19342
19343impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
19344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19345        f.write_str(self.as_str())
19346    }
19347}
19348impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
19349    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19350    where
19351        S: serde::Serializer,
19352    {
19353        serializer.serialize_str(self.as_str())
19354    }
19355}
19356#[cfg(feature = "deserialize")]
19357impl<'de> serde::Deserialize<'de>
19358    for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
19359{
19360    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19361        use std::str::FromStr;
19362        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19363        Ok(Self::from_str(&s).expect("infallible"))
19364    }
19365}
19366/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
19367#[derive(Clone, Debug, serde::Serialize)]
19368pub struct UpdatePaymentIntentPaymentMethodOptionsEps {
19369    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19370    ///
19371    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19372    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19373    ///
19374    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19375    ///
19376    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19377    ///
19378    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19379    #[serde(skip_serializing_if = "Option::is_none")]
19380    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
19381}
19382impl UpdatePaymentIntentPaymentMethodOptionsEps {
19383    pub fn new() -> Self {
19384        Self { setup_future_usage: None }
19385    }
19386}
19387impl Default for UpdatePaymentIntentPaymentMethodOptionsEps {
19388    fn default() -> Self {
19389        Self::new()
19390    }
19391}
19392/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19393///
19394/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19395/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19396///
19397/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19398///
19399/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19400///
19401/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19402#[derive(Clone, Eq, PartialEq)]
19403#[non_exhaustive]
19404pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19405    None,
19406    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19407    Unknown(String),
19408}
19409impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19410    pub fn as_str(&self) -> &str {
19411        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
19412        match self {
19413            None => "none",
19414            Unknown(v) => v,
19415        }
19416    }
19417}
19418
19419impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19420    type Err = std::convert::Infallible;
19421    fn from_str(s: &str) -> Result<Self, Self::Err> {
19422        use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
19423        match s {
19424            "none" => Ok(None),
19425            v => {
19426                tracing::warn!(
19427                    "Unknown value '{}' for enum '{}'",
19428                    v,
19429                    "UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage"
19430                );
19431                Ok(Unknown(v.to_owned()))
19432            }
19433        }
19434    }
19435}
19436impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19438        f.write_str(self.as_str())
19439    }
19440}
19441
19442impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19443    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19444        f.write_str(self.as_str())
19445    }
19446}
19447impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19448    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19449    where
19450        S: serde::Serializer,
19451    {
19452        serializer.serialize_str(self.as_str())
19453    }
19454}
19455#[cfg(feature = "deserialize")]
19456impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
19457    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19458        use std::str::FromStr;
19459        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19460        Ok(Self::from_str(&s).expect("infallible"))
19461    }
19462}
19463/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
19464#[derive(Clone, Debug, serde::Serialize)]
19465pub struct UpdatePaymentIntentPaymentMethodOptionsFpx {
19466    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19467    ///
19468    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19469    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19470    ///
19471    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19472    ///
19473    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19474    ///
19475    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19476    #[serde(skip_serializing_if = "Option::is_none")]
19477    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
19478}
19479impl UpdatePaymentIntentPaymentMethodOptionsFpx {
19480    pub fn new() -> Self {
19481        Self { setup_future_usage: None }
19482    }
19483}
19484impl Default for UpdatePaymentIntentPaymentMethodOptionsFpx {
19485    fn default() -> Self {
19486        Self::new()
19487    }
19488}
19489/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19490///
19491/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19492/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19493///
19494/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19495///
19496/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19497///
19498/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19499#[derive(Clone, Eq, PartialEq)]
19500#[non_exhaustive]
19501pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19502    None,
19503    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19504    Unknown(String),
19505}
19506impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19507    pub fn as_str(&self) -> &str {
19508        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
19509        match self {
19510            None => "none",
19511            Unknown(v) => v,
19512        }
19513    }
19514}
19515
19516impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19517    type Err = std::convert::Infallible;
19518    fn from_str(s: &str) -> Result<Self, Self::Err> {
19519        use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
19520        match s {
19521            "none" => Ok(None),
19522            v => {
19523                tracing::warn!(
19524                    "Unknown value '{}' for enum '{}'",
19525                    v,
19526                    "UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage"
19527                );
19528                Ok(Unknown(v.to_owned()))
19529            }
19530        }
19531    }
19532}
19533impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19534    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19535        f.write_str(self.as_str())
19536    }
19537}
19538
19539impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19540    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19541        f.write_str(self.as_str())
19542    }
19543}
19544impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19545    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19546    where
19547        S: serde::Serializer,
19548    {
19549        serializer.serialize_str(self.as_str())
19550    }
19551}
19552#[cfg(feature = "deserialize")]
19553impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
19554    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19555        use std::str::FromStr;
19556        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19557        Ok(Self::from_str(&s).expect("infallible"))
19558    }
19559}
19560/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
19561#[derive(Clone, Debug, serde::Serialize)]
19562pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay {
19563    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19564    ///
19565    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19566    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19567    ///
19568    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19569    ///
19570    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19571    ///
19572    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19573    #[serde(skip_serializing_if = "Option::is_none")]
19574    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
19575}
19576impl UpdatePaymentIntentPaymentMethodOptionsGiropay {
19577    pub fn new() -> Self {
19578        Self { setup_future_usage: None }
19579    }
19580}
19581impl Default for UpdatePaymentIntentPaymentMethodOptionsGiropay {
19582    fn default() -> Self {
19583        Self::new()
19584    }
19585}
19586/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19587///
19588/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19589/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19590///
19591/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19592///
19593/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19594///
19595/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19596#[derive(Clone, Eq, PartialEq)]
19597#[non_exhaustive]
19598pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
19599    None,
19600    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19601    Unknown(String),
19602}
19603impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
19604    pub fn as_str(&self) -> &str {
19605        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
19606        match self {
19607            None => "none",
19608            Unknown(v) => v,
19609        }
19610    }
19611}
19612
19613impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
19614    type Err = std::convert::Infallible;
19615    fn from_str(s: &str) -> Result<Self, Self::Err> {
19616        use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
19617        match s {
19618            "none" => Ok(None),
19619            v => {
19620                tracing::warn!(
19621                    "Unknown value '{}' for enum '{}'",
19622                    v,
19623                    "UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage"
19624                );
19625                Ok(Unknown(v.to_owned()))
19626            }
19627        }
19628    }
19629}
19630impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
19631    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19632        f.write_str(self.as_str())
19633    }
19634}
19635
19636impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
19637    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19638        f.write_str(self.as_str())
19639    }
19640}
19641impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
19642    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19643    where
19644        S: serde::Serializer,
19645    {
19646        serializer.serialize_str(self.as_str())
19647    }
19648}
19649#[cfg(feature = "deserialize")]
19650impl<'de> serde::Deserialize<'de>
19651    for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
19652{
19653    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19654        use std::str::FromStr;
19655        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19656        Ok(Self::from_str(&s).expect("infallible"))
19657    }
19658}
19659/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
19660#[derive(Clone, Debug, serde::Serialize)]
19661pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay {
19662    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19663    ///
19664    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19665    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19666    ///
19667    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19668    ///
19669    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19670    ///
19671    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19672    #[serde(skip_serializing_if = "Option::is_none")]
19673    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
19674}
19675impl UpdatePaymentIntentPaymentMethodOptionsGrabpay {
19676    pub fn new() -> Self {
19677        Self { setup_future_usage: None }
19678    }
19679}
19680impl Default for UpdatePaymentIntentPaymentMethodOptionsGrabpay {
19681    fn default() -> Self {
19682        Self::new()
19683    }
19684}
19685/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19686///
19687/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19688/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19689///
19690/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19691///
19692/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19693///
19694/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19695#[derive(Clone, Eq, PartialEq)]
19696#[non_exhaustive]
19697pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
19698    None,
19699    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19700    Unknown(String),
19701}
19702impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
19703    pub fn as_str(&self) -> &str {
19704        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
19705        match self {
19706            None => "none",
19707            Unknown(v) => v,
19708        }
19709    }
19710}
19711
19712impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
19713    type Err = std::convert::Infallible;
19714    fn from_str(s: &str) -> Result<Self, Self::Err> {
19715        use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
19716        match s {
19717            "none" => Ok(None),
19718            v => {
19719                tracing::warn!(
19720                    "Unknown value '{}' for enum '{}'",
19721                    v,
19722                    "UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage"
19723                );
19724                Ok(Unknown(v.to_owned()))
19725            }
19726        }
19727    }
19728}
19729impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
19730    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19731        f.write_str(self.as_str())
19732    }
19733}
19734
19735impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
19736    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19737        f.write_str(self.as_str())
19738    }
19739}
19740impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
19741    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19742    where
19743        S: serde::Serializer,
19744    {
19745        serializer.serialize_str(self.as_str())
19746    }
19747}
19748#[cfg(feature = "deserialize")]
19749impl<'de> serde::Deserialize<'de>
19750    for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
19751{
19752    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19753        use std::str::FromStr;
19754        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19755        Ok(Self::from_str(&s).expect("infallible"))
19756    }
19757}
19758/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
19759#[derive(Clone, Debug, serde::Serialize)]
19760pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal {
19761    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19762    ///
19763    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19764    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19765    ///
19766    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19767    ///
19768    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19769    ///
19770    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19771    #[serde(skip_serializing_if = "Option::is_none")]
19772    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
19773}
19774impl UpdatePaymentIntentPaymentMethodOptionsIdeal {
19775    pub fn new() -> Self {
19776        Self { setup_future_usage: None }
19777    }
19778}
19779impl Default for UpdatePaymentIntentPaymentMethodOptionsIdeal {
19780    fn default() -> Self {
19781        Self::new()
19782    }
19783}
19784/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19785///
19786/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19787/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19788///
19789/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19790///
19791/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19792///
19793/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
19794#[derive(Clone, Eq, PartialEq)]
19795#[non_exhaustive]
19796pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19797    None,
19798    OffSession,
19799    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19800    Unknown(String),
19801}
19802impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19803    pub fn as_str(&self) -> &str {
19804        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
19805        match self {
19806            None => "none",
19807            OffSession => "off_session",
19808            Unknown(v) => v,
19809        }
19810    }
19811}
19812
19813impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19814    type Err = std::convert::Infallible;
19815    fn from_str(s: &str) -> Result<Self, Self::Err> {
19816        use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
19817        match s {
19818            "none" => Ok(None),
19819            "off_session" => Ok(OffSession),
19820            v => {
19821                tracing::warn!(
19822                    "Unknown value '{}' for enum '{}'",
19823                    v,
19824                    "UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage"
19825                );
19826                Ok(Unknown(v.to_owned()))
19827            }
19828        }
19829    }
19830}
19831impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19832    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19833        f.write_str(self.as_str())
19834    }
19835}
19836
19837impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19838    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19839        f.write_str(self.as_str())
19840    }
19841}
19842impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19843    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19844    where
19845        S: serde::Serializer,
19846    {
19847        serializer.serialize_str(self.as_str())
19848    }
19849}
19850#[cfg(feature = "deserialize")]
19851impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
19852    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19853        use std::str::FromStr;
19854        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19855        Ok(Self::from_str(&s).expect("infallible"))
19856    }
19857}
19858/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
19859#[derive(Clone, Debug, serde::Serialize)]
19860pub struct UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
19861    /// Controls when the funds are captured from the customer's account.
19862    ///
19863    /// 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.
19864    ///
19865    /// 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.
19866    #[serde(skip_serializing_if = "Option::is_none")]
19867    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
19868    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19869    ///
19870    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19871    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19872    ///
19873    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19874    ///
19875    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19876    #[serde(skip_serializing_if = "Option::is_none")]
19877    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
19878}
19879impl UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
19880    pub fn new() -> Self {
19881        Self { capture_method: None, setup_future_usage: None }
19882    }
19883}
19884impl Default for UpdatePaymentIntentPaymentMethodOptionsKakaoPay {
19885    fn default() -> Self {
19886        Self::new()
19887    }
19888}
19889/// Controls when the funds are captured from the customer's account.
19890///
19891/// 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.
19892///
19893/// 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.
19894#[derive(Clone, Eq, PartialEq)]
19895#[non_exhaustive]
19896pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19897    Manual,
19898    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19899    Unknown(String),
19900}
19901impl UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19902    pub fn as_str(&self) -> &str {
19903        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
19904        match self {
19905            Manual => "manual",
19906            Unknown(v) => v,
19907        }
19908    }
19909}
19910
19911impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19912    type Err = std::convert::Infallible;
19913    fn from_str(s: &str) -> Result<Self, Self::Err> {
19914        use UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
19915        match s {
19916            "manual" => Ok(Manual),
19917            v => {
19918                tracing::warn!(
19919                    "Unknown value '{}' for enum '{}'",
19920                    v,
19921                    "UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod"
19922                );
19923                Ok(Unknown(v.to_owned()))
19924            }
19925        }
19926    }
19927}
19928impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19929    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19930        f.write_str(self.as_str())
19931    }
19932}
19933
19934impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
19936        f.write_str(self.as_str())
19937    }
19938}
19939impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19940    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
19941    where
19942        S: serde::Serializer,
19943    {
19944        serializer.serialize_str(self.as_str())
19945    }
19946}
19947#[cfg(feature = "deserialize")]
19948impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
19949    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
19950        use std::str::FromStr;
19951        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
19952        Ok(Self::from_str(&s).expect("infallible"))
19953    }
19954}
19955/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
19956///
19957/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
19958/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
19959///
19960/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
19961///
19962/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
19963#[derive(Clone, Eq, PartialEq)]
19964#[non_exhaustive]
19965pub enum UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
19966    None,
19967    OffSession,
19968    /// An unrecognized value from Stripe. Should not be used as a request parameter.
19969    Unknown(String),
19970}
19971impl UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
19972    pub fn as_str(&self) -> &str {
19973        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
19974        match self {
19975            None => "none",
19976            OffSession => "off_session",
19977            Unknown(v) => v,
19978        }
19979    }
19980}
19981
19982impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
19983    type Err = std::convert::Infallible;
19984    fn from_str(s: &str) -> Result<Self, Self::Err> {
19985        use UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
19986        match s {
19987            "none" => Ok(None),
19988            "off_session" => Ok(OffSession),
19989            v => {
19990                tracing::warn!(
19991                    "Unknown value '{}' for enum '{}'",
19992                    v,
19993                    "UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage"
19994                );
19995                Ok(Unknown(v.to_owned()))
19996            }
19997        }
19998    }
19999}
20000impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
20001    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20002        f.write_str(self.as_str())
20003    }
20004}
20005
20006impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
20007    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20008        f.write_str(self.as_str())
20009    }
20010}
20011impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
20012    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20013    where
20014        S: serde::Serializer,
20015    {
20016        serializer.serialize_str(self.as_str())
20017    }
20018}
20019#[cfg(feature = "deserialize")]
20020impl<'de> serde::Deserialize<'de>
20021    for UpdatePaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
20022{
20023    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20024        use std::str::FromStr;
20025        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20026        Ok(Self::from_str(&s).expect("infallible"))
20027    }
20028}
20029/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
20030#[derive(Clone, Debug, serde::Serialize)]
20031pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna {
20032    /// Controls when the funds are captured from the customer's account.
20033    ///
20034    /// 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.
20035    ///
20036    /// 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.
20037    #[serde(skip_serializing_if = "Option::is_none")]
20038    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
20039    /// On-demand details if setting up or charging an on-demand payment.
20040    #[serde(skip_serializing_if = "Option::is_none")]
20041    pub on_demand: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
20042    /// Preferred language of the Klarna authorization page that the customer is redirected to
20043    #[serde(skip_serializing_if = "Option::is_none")]
20044    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
20045    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20046    ///
20047    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20048    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20049    ///
20050    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20051    ///
20052    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20053    ///
20054    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20055    #[serde(skip_serializing_if = "Option::is_none")]
20056    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
20057    /// Subscription details if setting up or charging a subscription.
20058    #[serde(skip_serializing_if = "Option::is_none")]
20059    pub subscriptions: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
20060}
20061impl UpdatePaymentIntentPaymentMethodOptionsKlarna {
20062    pub fn new() -> Self {
20063        Self {
20064            capture_method: None,
20065            on_demand: None,
20066            preferred_locale: None,
20067            setup_future_usage: None,
20068            subscriptions: None,
20069        }
20070    }
20071}
20072impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarna {
20073    fn default() -> Self {
20074        Self::new()
20075    }
20076}
20077/// Controls when the funds are captured from the customer's account.
20078///
20079/// 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.
20080///
20081/// 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.
20082#[derive(Clone, Eq, PartialEq)]
20083#[non_exhaustive]
20084pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20085    Manual,
20086    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20087    Unknown(String),
20088}
20089impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20090    pub fn as_str(&self) -> &str {
20091        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
20092        match self {
20093            Manual => "manual",
20094            Unknown(v) => v,
20095        }
20096    }
20097}
20098
20099impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20100    type Err = std::convert::Infallible;
20101    fn from_str(s: &str) -> Result<Self, Self::Err> {
20102        use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
20103        match s {
20104            "manual" => Ok(Manual),
20105            v => {
20106                tracing::warn!(
20107                    "Unknown value '{}' for enum '{}'",
20108                    v,
20109                    "UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod"
20110                );
20111                Ok(Unknown(v.to_owned()))
20112            }
20113        }
20114    }
20115}
20116impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20117    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20118        f.write_str(self.as_str())
20119    }
20120}
20121
20122impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20123    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20124        f.write_str(self.as_str())
20125    }
20126}
20127impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20128    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20129    where
20130        S: serde::Serializer,
20131    {
20132        serializer.serialize_str(self.as_str())
20133    }
20134}
20135#[cfg(feature = "deserialize")]
20136impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
20137    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20138        use std::str::FromStr;
20139        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20140        Ok(Self::from_str(&s).expect("infallible"))
20141    }
20142}
20143/// On-demand details if setting up or charging an on-demand payment.
20144#[derive(Clone, Debug, serde::Serialize)]
20145pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
20146    /// Your average amount value.
20147    /// You can use a value across your customer base, or segment based on customer type, country, etc.
20148    #[serde(skip_serializing_if = "Option::is_none")]
20149    pub average_amount: Option<i64>,
20150    /// The maximum value you may charge a customer per purchase.
20151    /// You can use a value across your customer base, or segment based on customer type, country, etc.
20152    #[serde(skip_serializing_if = "Option::is_none")]
20153    pub maximum_amount: Option<i64>,
20154    /// The lowest or minimum value you may charge a customer per purchase.
20155    /// You can use a value across your customer base, or segment based on customer type, country, etc.
20156    #[serde(skip_serializing_if = "Option::is_none")]
20157    pub minimum_amount: Option<i64>,
20158    /// Interval at which the customer is making purchases
20159    #[serde(skip_serializing_if = "Option::is_none")]
20160    pub purchase_interval:
20161        Option<UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
20162    /// The number of `purchase_interval` between charges
20163    #[serde(skip_serializing_if = "Option::is_none")]
20164    pub purchase_interval_count: Option<u64>,
20165}
20166impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
20167    pub fn new() -> Self {
20168        Self {
20169            average_amount: None,
20170            maximum_amount: None,
20171            minimum_amount: None,
20172            purchase_interval: None,
20173            purchase_interval_count: None,
20174        }
20175    }
20176}
20177impl Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemand {
20178    fn default() -> Self {
20179        Self::new()
20180    }
20181}
20182/// Interval at which the customer is making purchases
20183#[derive(Clone, Eq, PartialEq)]
20184#[non_exhaustive]
20185pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
20186    Day,
20187    Month,
20188    Week,
20189    Year,
20190    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20191    Unknown(String),
20192}
20193impl UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
20194    pub fn as_str(&self) -> &str {
20195        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
20196        match self {
20197            Day => "day",
20198            Month => "month",
20199            Week => "week",
20200            Year => "year",
20201            Unknown(v) => v,
20202        }
20203    }
20204}
20205
20206impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
20207    type Err = std::convert::Infallible;
20208    fn from_str(s: &str) -> Result<Self, Self::Err> {
20209        use UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
20210        match s {
20211            "day" => Ok(Day),
20212            "month" => Ok(Month),
20213            "week" => Ok(Week),
20214            "year" => Ok(Year),
20215            v => {
20216                tracing::warn!(
20217                    "Unknown value '{}' for enum '{}'",
20218                    v,
20219                    "UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
20220                );
20221                Ok(Unknown(v.to_owned()))
20222            }
20223        }
20224    }
20225}
20226impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
20227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20228        f.write_str(self.as_str())
20229    }
20230}
20231
20232impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
20233    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20234        f.write_str(self.as_str())
20235    }
20236}
20237impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
20238    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20239    where
20240        S: serde::Serializer,
20241    {
20242        serializer.serialize_str(self.as_str())
20243    }
20244}
20245#[cfg(feature = "deserialize")]
20246impl<'de> serde::Deserialize<'de>
20247    for UpdatePaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
20248{
20249    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20250        use std::str::FromStr;
20251        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20252        Ok(Self::from_str(&s).expect("infallible"))
20253    }
20254}
20255/// Preferred language of the Klarna authorization page that the customer is redirected to
20256#[derive(Clone, Eq, PartialEq)]
20257#[non_exhaustive]
20258pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20259    CsMinusCz,
20260    DaMinusDk,
20261    DeMinusAt,
20262    DeMinusCh,
20263    DeMinusDe,
20264    ElMinusGr,
20265    EnMinusAt,
20266    EnMinusAu,
20267    EnMinusBe,
20268    EnMinusCa,
20269    EnMinusCh,
20270    EnMinusCz,
20271    EnMinusDe,
20272    EnMinusDk,
20273    EnMinusEs,
20274    EnMinusFi,
20275    EnMinusFr,
20276    EnMinusGb,
20277    EnMinusGr,
20278    EnMinusIe,
20279    EnMinusIt,
20280    EnMinusNl,
20281    EnMinusNo,
20282    EnMinusNz,
20283    EnMinusPl,
20284    EnMinusPt,
20285    EnMinusRo,
20286    EnMinusSe,
20287    EnMinusUs,
20288    EsMinusEs,
20289    EsMinusUs,
20290    FiMinusFi,
20291    FrMinusBe,
20292    FrMinusCa,
20293    FrMinusCh,
20294    FrMinusFr,
20295    ItMinusCh,
20296    ItMinusIt,
20297    NbMinusNo,
20298    NlMinusBe,
20299    NlMinusNl,
20300    PlMinusPl,
20301    PtMinusPt,
20302    RoMinusRo,
20303    SvMinusFi,
20304    SvMinusSe,
20305    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20306    Unknown(String),
20307}
20308impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20309    pub fn as_str(&self) -> &str {
20310        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
20311        match self {
20312            CsMinusCz => "cs-CZ",
20313            DaMinusDk => "da-DK",
20314            DeMinusAt => "de-AT",
20315            DeMinusCh => "de-CH",
20316            DeMinusDe => "de-DE",
20317            ElMinusGr => "el-GR",
20318            EnMinusAt => "en-AT",
20319            EnMinusAu => "en-AU",
20320            EnMinusBe => "en-BE",
20321            EnMinusCa => "en-CA",
20322            EnMinusCh => "en-CH",
20323            EnMinusCz => "en-CZ",
20324            EnMinusDe => "en-DE",
20325            EnMinusDk => "en-DK",
20326            EnMinusEs => "en-ES",
20327            EnMinusFi => "en-FI",
20328            EnMinusFr => "en-FR",
20329            EnMinusGb => "en-GB",
20330            EnMinusGr => "en-GR",
20331            EnMinusIe => "en-IE",
20332            EnMinusIt => "en-IT",
20333            EnMinusNl => "en-NL",
20334            EnMinusNo => "en-NO",
20335            EnMinusNz => "en-NZ",
20336            EnMinusPl => "en-PL",
20337            EnMinusPt => "en-PT",
20338            EnMinusRo => "en-RO",
20339            EnMinusSe => "en-SE",
20340            EnMinusUs => "en-US",
20341            EsMinusEs => "es-ES",
20342            EsMinusUs => "es-US",
20343            FiMinusFi => "fi-FI",
20344            FrMinusBe => "fr-BE",
20345            FrMinusCa => "fr-CA",
20346            FrMinusCh => "fr-CH",
20347            FrMinusFr => "fr-FR",
20348            ItMinusCh => "it-CH",
20349            ItMinusIt => "it-IT",
20350            NbMinusNo => "nb-NO",
20351            NlMinusBe => "nl-BE",
20352            NlMinusNl => "nl-NL",
20353            PlMinusPl => "pl-PL",
20354            PtMinusPt => "pt-PT",
20355            RoMinusRo => "ro-RO",
20356            SvMinusFi => "sv-FI",
20357            SvMinusSe => "sv-SE",
20358            Unknown(v) => v,
20359        }
20360    }
20361}
20362
20363impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20364    type Err = std::convert::Infallible;
20365    fn from_str(s: &str) -> Result<Self, Self::Err> {
20366        use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
20367        match s {
20368            "cs-CZ" => Ok(CsMinusCz),
20369            "da-DK" => Ok(DaMinusDk),
20370            "de-AT" => Ok(DeMinusAt),
20371            "de-CH" => Ok(DeMinusCh),
20372            "de-DE" => Ok(DeMinusDe),
20373            "el-GR" => Ok(ElMinusGr),
20374            "en-AT" => Ok(EnMinusAt),
20375            "en-AU" => Ok(EnMinusAu),
20376            "en-BE" => Ok(EnMinusBe),
20377            "en-CA" => Ok(EnMinusCa),
20378            "en-CH" => Ok(EnMinusCh),
20379            "en-CZ" => Ok(EnMinusCz),
20380            "en-DE" => Ok(EnMinusDe),
20381            "en-DK" => Ok(EnMinusDk),
20382            "en-ES" => Ok(EnMinusEs),
20383            "en-FI" => Ok(EnMinusFi),
20384            "en-FR" => Ok(EnMinusFr),
20385            "en-GB" => Ok(EnMinusGb),
20386            "en-GR" => Ok(EnMinusGr),
20387            "en-IE" => Ok(EnMinusIe),
20388            "en-IT" => Ok(EnMinusIt),
20389            "en-NL" => Ok(EnMinusNl),
20390            "en-NO" => Ok(EnMinusNo),
20391            "en-NZ" => Ok(EnMinusNz),
20392            "en-PL" => Ok(EnMinusPl),
20393            "en-PT" => Ok(EnMinusPt),
20394            "en-RO" => Ok(EnMinusRo),
20395            "en-SE" => Ok(EnMinusSe),
20396            "en-US" => Ok(EnMinusUs),
20397            "es-ES" => Ok(EsMinusEs),
20398            "es-US" => Ok(EsMinusUs),
20399            "fi-FI" => Ok(FiMinusFi),
20400            "fr-BE" => Ok(FrMinusBe),
20401            "fr-CA" => Ok(FrMinusCa),
20402            "fr-CH" => Ok(FrMinusCh),
20403            "fr-FR" => Ok(FrMinusFr),
20404            "it-CH" => Ok(ItMinusCh),
20405            "it-IT" => Ok(ItMinusIt),
20406            "nb-NO" => Ok(NbMinusNo),
20407            "nl-BE" => Ok(NlMinusBe),
20408            "nl-NL" => Ok(NlMinusNl),
20409            "pl-PL" => Ok(PlMinusPl),
20410            "pt-PT" => Ok(PtMinusPt),
20411            "ro-RO" => Ok(RoMinusRo),
20412            "sv-FI" => Ok(SvMinusFi),
20413            "sv-SE" => Ok(SvMinusSe),
20414            v => {
20415                tracing::warn!(
20416                    "Unknown value '{}' for enum '{}'",
20417                    v,
20418                    "UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale"
20419                );
20420                Ok(Unknown(v.to_owned()))
20421            }
20422        }
20423    }
20424}
20425impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20426    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20427        f.write_str(self.as_str())
20428    }
20429}
20430
20431impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20432    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20433        f.write_str(self.as_str())
20434    }
20435}
20436impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20437    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20438    where
20439        S: serde::Serializer,
20440    {
20441        serializer.serialize_str(self.as_str())
20442    }
20443}
20444#[cfg(feature = "deserialize")]
20445impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
20446    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20447        use std::str::FromStr;
20448        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20449        Ok(Self::from_str(&s).expect("infallible"))
20450    }
20451}
20452/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20453///
20454/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20455/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20456///
20457/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20458///
20459/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20460///
20461/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20462#[derive(Clone, Eq, PartialEq)]
20463#[non_exhaustive]
20464pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
20465    None,
20466    OffSession,
20467    OnSession,
20468    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20469    Unknown(String),
20470}
20471impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
20472    pub fn as_str(&self) -> &str {
20473        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
20474        match self {
20475            None => "none",
20476            OffSession => "off_session",
20477            OnSession => "on_session",
20478            Unknown(v) => v,
20479        }
20480    }
20481}
20482
20483impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
20484    type Err = std::convert::Infallible;
20485    fn from_str(s: &str) -> Result<Self, Self::Err> {
20486        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
20487        match s {
20488            "none" => Ok(None),
20489            "off_session" => Ok(OffSession),
20490            "on_session" => Ok(OnSession),
20491            v => {
20492                tracing::warn!(
20493                    "Unknown value '{}' for enum '{}'",
20494                    v,
20495                    "UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage"
20496                );
20497                Ok(Unknown(v.to_owned()))
20498            }
20499        }
20500    }
20501}
20502impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
20503    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20504        f.write_str(self.as_str())
20505    }
20506}
20507
20508impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
20509    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20510        f.write_str(self.as_str())
20511    }
20512}
20513impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
20514    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20515    where
20516        S: serde::Serializer,
20517    {
20518        serializer.serialize_str(self.as_str())
20519    }
20520}
20521#[cfg(feature = "deserialize")]
20522impl<'de> serde::Deserialize<'de>
20523    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
20524{
20525    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20526        use std::str::FromStr;
20527        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20528        Ok(Self::from_str(&s).expect("infallible"))
20529    }
20530}
20531/// Subscription details if setting up or charging a subscription.
20532#[derive(Clone, Debug, serde::Serialize)]
20533pub struct UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
20534    /// Unit of time between subscription charges.
20535    pub interval: UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
20536    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
20537    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
20538    #[serde(skip_serializing_if = "Option::is_none")]
20539    pub interval_count: Option<u64>,
20540    /// Name for subscription.
20541    #[serde(skip_serializing_if = "Option::is_none")]
20542    pub name: Option<String>,
20543    /// Describes the upcoming charge for this subscription.
20544    #[serde(skip_serializing_if = "Option::is_none")]
20545    pub next_billing: Option<SubscriptionNextBillingParam>,
20546    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
20547    /// Use a value that persists across subscription charges.
20548    pub reference: String,
20549}
20550impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
20551    pub fn new(
20552        interval: impl Into<UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
20553        reference: impl Into<String>,
20554    ) -> Self {
20555        Self {
20556            interval: interval.into(),
20557            interval_count: None,
20558            name: None,
20559            next_billing: None,
20560            reference: reference.into(),
20561        }
20562    }
20563}
20564/// Unit of time between subscription charges.
20565#[derive(Clone, Eq, PartialEq)]
20566#[non_exhaustive]
20567pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
20568    Day,
20569    Month,
20570    Week,
20571    Year,
20572    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20573    Unknown(String),
20574}
20575impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
20576    pub fn as_str(&self) -> &str {
20577        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
20578        match self {
20579            Day => "day",
20580            Month => "month",
20581            Week => "week",
20582            Year => "year",
20583            Unknown(v) => v,
20584        }
20585    }
20586}
20587
20588impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
20589    type Err = std::convert::Infallible;
20590    fn from_str(s: &str) -> Result<Self, Self::Err> {
20591        use UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
20592        match s {
20593            "day" => Ok(Day),
20594            "month" => Ok(Month),
20595            "week" => Ok(Week),
20596            "year" => Ok(Year),
20597            v => {
20598                tracing::warn!(
20599                    "Unknown value '{}' for enum '{}'",
20600                    v,
20601                    "UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
20602                );
20603                Ok(Unknown(v.to_owned()))
20604            }
20605        }
20606    }
20607}
20608impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
20609    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20610        f.write_str(self.as_str())
20611    }
20612}
20613
20614impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
20615    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20616        f.write_str(self.as_str())
20617    }
20618}
20619impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
20620    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20621    where
20622        S: serde::Serializer,
20623    {
20624        serializer.serialize_str(self.as_str())
20625    }
20626}
20627#[cfg(feature = "deserialize")]
20628impl<'de> serde::Deserialize<'de>
20629    for UpdatePaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
20630{
20631    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20632        use std::str::FromStr;
20633        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20634        Ok(Self::from_str(&s).expect("infallible"))
20635    }
20636}
20637/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
20638#[derive(Clone, Debug, serde::Serialize)]
20639pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini {
20640    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
20641    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
20642    /// We recommend to use the customer's phone number.
20643    #[serde(skip_serializing_if = "Option::is_none")]
20644    pub confirmation_number: Option<String>,
20645    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
20646    /// 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.
20647    /// Defaults to 3 days.
20648    #[serde(skip_serializing_if = "Option::is_none")]
20649    pub expires_after_days: Option<u32>,
20650    /// The timestamp at which the Konbini payment instructions will expire.
20651    /// Only one of `expires_after_days` or `expires_at` may be set.
20652    #[serde(skip_serializing_if = "Option::is_none")]
20653    pub expires_at: Option<stripe_types::Timestamp>,
20654    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
20655    #[serde(skip_serializing_if = "Option::is_none")]
20656    pub product_description: Option<String>,
20657    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20658    ///
20659    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20660    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20661    ///
20662    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20663    ///
20664    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20665    ///
20666    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20667    #[serde(skip_serializing_if = "Option::is_none")]
20668    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
20669}
20670impl UpdatePaymentIntentPaymentMethodOptionsKonbini {
20671    pub fn new() -> Self {
20672        Self {
20673            confirmation_number: None,
20674            expires_after_days: None,
20675            expires_at: None,
20676            product_description: None,
20677            setup_future_usage: None,
20678        }
20679    }
20680}
20681impl Default for UpdatePaymentIntentPaymentMethodOptionsKonbini {
20682    fn default() -> Self {
20683        Self::new()
20684    }
20685}
20686/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20687///
20688/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20689/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20690///
20691/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20692///
20693/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20694///
20695/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20696#[derive(Clone, Eq, PartialEq)]
20697#[non_exhaustive]
20698pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
20699    None,
20700    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20701    Unknown(String),
20702}
20703impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
20704    pub fn as_str(&self) -> &str {
20705        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
20706        match self {
20707            None => "none",
20708            Unknown(v) => v,
20709        }
20710    }
20711}
20712
20713impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
20714    type Err = std::convert::Infallible;
20715    fn from_str(s: &str) -> Result<Self, Self::Err> {
20716        use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
20717        match s {
20718            "none" => Ok(None),
20719            v => {
20720                tracing::warn!(
20721                    "Unknown value '{}' for enum '{}'",
20722                    v,
20723                    "UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage"
20724                );
20725                Ok(Unknown(v.to_owned()))
20726            }
20727        }
20728    }
20729}
20730impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
20731    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20732        f.write_str(self.as_str())
20733    }
20734}
20735
20736impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
20737    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20738        f.write_str(self.as_str())
20739    }
20740}
20741impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
20742    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20743    where
20744        S: serde::Serializer,
20745    {
20746        serializer.serialize_str(self.as_str())
20747    }
20748}
20749#[cfg(feature = "deserialize")]
20750impl<'de> serde::Deserialize<'de>
20751    for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
20752{
20753    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20754        use std::str::FromStr;
20755        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20756        Ok(Self::from_str(&s).expect("infallible"))
20757    }
20758}
20759/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
20760#[derive(Clone, Debug, serde::Serialize)]
20761pub struct UpdatePaymentIntentPaymentMethodOptionsKrCard {
20762    /// Controls when the funds are captured from the customer's account.
20763    ///
20764    /// 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.
20765    ///
20766    /// 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.
20767    #[serde(skip_serializing_if = "Option::is_none")]
20768    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
20769    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20770    ///
20771    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20772    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20773    ///
20774    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20775    ///
20776    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20777    #[serde(skip_serializing_if = "Option::is_none")]
20778    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
20779}
20780impl UpdatePaymentIntentPaymentMethodOptionsKrCard {
20781    pub fn new() -> Self {
20782        Self { capture_method: None, setup_future_usage: None }
20783    }
20784}
20785impl Default for UpdatePaymentIntentPaymentMethodOptionsKrCard {
20786    fn default() -> Self {
20787        Self::new()
20788    }
20789}
20790/// Controls when the funds are captured from the customer's account.
20791///
20792/// 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.
20793///
20794/// 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.
20795#[derive(Clone, Eq, PartialEq)]
20796#[non_exhaustive]
20797pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20798    Manual,
20799    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20800    Unknown(String),
20801}
20802impl UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20803    pub fn as_str(&self) -> &str {
20804        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
20805        match self {
20806            Manual => "manual",
20807            Unknown(v) => v,
20808        }
20809    }
20810}
20811
20812impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20813    type Err = std::convert::Infallible;
20814    fn from_str(s: &str) -> Result<Self, Self::Err> {
20815        use UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
20816        match s {
20817            "manual" => Ok(Manual),
20818            v => {
20819                tracing::warn!(
20820                    "Unknown value '{}' for enum '{}'",
20821                    v,
20822                    "UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod"
20823                );
20824                Ok(Unknown(v.to_owned()))
20825            }
20826        }
20827    }
20828}
20829impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20830    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20831        f.write_str(self.as_str())
20832    }
20833}
20834
20835impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20836    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20837        f.write_str(self.as_str())
20838    }
20839}
20840impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20841    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20842    where
20843        S: serde::Serializer,
20844    {
20845        serializer.serialize_str(self.as_str())
20846    }
20847}
20848#[cfg(feature = "deserialize")]
20849impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
20850    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20851        use std::str::FromStr;
20852        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20853        Ok(Self::from_str(&s).expect("infallible"))
20854    }
20855}
20856/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20857///
20858/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20859/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20860///
20861/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20862///
20863/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20864#[derive(Clone, Eq, PartialEq)]
20865#[non_exhaustive]
20866pub enum UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
20867    None,
20868    OffSession,
20869    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20870    Unknown(String),
20871}
20872impl UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
20873    pub fn as_str(&self) -> &str {
20874        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
20875        match self {
20876            None => "none",
20877            OffSession => "off_session",
20878            Unknown(v) => v,
20879        }
20880    }
20881}
20882
20883impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
20884    type Err = std::convert::Infallible;
20885    fn from_str(s: &str) -> Result<Self, Self::Err> {
20886        use UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
20887        match s {
20888            "none" => Ok(None),
20889            "off_session" => Ok(OffSession),
20890            v => {
20891                tracing::warn!(
20892                    "Unknown value '{}' for enum '{}'",
20893                    v,
20894                    "UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage"
20895                );
20896                Ok(Unknown(v.to_owned()))
20897            }
20898        }
20899    }
20900}
20901impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
20902    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20903        f.write_str(self.as_str())
20904    }
20905}
20906
20907impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
20908    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20909        f.write_str(self.as_str())
20910    }
20911}
20912impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
20913    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
20914    where
20915        S: serde::Serializer,
20916    {
20917        serializer.serialize_str(self.as_str())
20918    }
20919}
20920#[cfg(feature = "deserialize")]
20921impl<'de> serde::Deserialize<'de>
20922    for UpdatePaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
20923{
20924    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
20925        use std::str::FromStr;
20926        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
20927        Ok(Self::from_str(&s).expect("infallible"))
20928    }
20929}
20930/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
20931#[derive(Clone, Debug, serde::Serialize)]
20932pub struct UpdatePaymentIntentPaymentMethodOptionsLink {
20933    /// Controls when the funds are captured from the customer's account.
20934    ///
20935    /// 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.
20936    ///
20937    /// 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.
20938    #[serde(skip_serializing_if = "Option::is_none")]
20939    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
20940    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
20941    #[serde(skip_serializing_if = "Option::is_none")]
20942    pub persistent_token: Option<String>,
20943    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
20944    ///
20945    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
20946    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
20947    ///
20948    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
20949    ///
20950    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
20951    ///
20952    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
20953    #[serde(skip_serializing_if = "Option::is_none")]
20954    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
20955}
20956impl UpdatePaymentIntentPaymentMethodOptionsLink {
20957    pub fn new() -> Self {
20958        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
20959    }
20960}
20961impl Default for UpdatePaymentIntentPaymentMethodOptionsLink {
20962    fn default() -> Self {
20963        Self::new()
20964    }
20965}
20966/// Controls when the funds are captured from the customer's account.
20967///
20968/// 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.
20969///
20970/// 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.
20971#[derive(Clone, Eq, PartialEq)]
20972#[non_exhaustive]
20973pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
20974    Manual,
20975    /// An unrecognized value from Stripe. Should not be used as a request parameter.
20976    Unknown(String),
20977}
20978impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
20979    pub fn as_str(&self) -> &str {
20980        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
20981        match self {
20982            Manual => "manual",
20983            Unknown(v) => v,
20984        }
20985    }
20986}
20987
20988impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
20989    type Err = std::convert::Infallible;
20990    fn from_str(s: &str) -> Result<Self, Self::Err> {
20991        use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
20992        match s {
20993            "manual" => Ok(Manual),
20994            v => {
20995                tracing::warn!(
20996                    "Unknown value '{}' for enum '{}'",
20997                    v,
20998                    "UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod"
20999                );
21000                Ok(Unknown(v.to_owned()))
21001            }
21002        }
21003    }
21004}
21005impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
21006    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21007        f.write_str(self.as_str())
21008    }
21009}
21010
21011impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
21012    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21013        f.write_str(self.as_str())
21014    }
21015}
21016impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
21017    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21018    where
21019        S: serde::Serializer,
21020    {
21021        serializer.serialize_str(self.as_str())
21022    }
21023}
21024#[cfg(feature = "deserialize")]
21025impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod {
21026    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21027        use std::str::FromStr;
21028        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21029        Ok(Self::from_str(&s).expect("infallible"))
21030    }
21031}
21032/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21033///
21034/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21035/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21036///
21037/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21038///
21039/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21040///
21041/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21042#[derive(Clone, Eq, PartialEq)]
21043#[non_exhaustive]
21044pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21045    None,
21046    OffSession,
21047    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21048    Unknown(String),
21049}
21050impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21051    pub fn as_str(&self) -> &str {
21052        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
21053        match self {
21054            None => "none",
21055            OffSession => "off_session",
21056            Unknown(v) => v,
21057        }
21058    }
21059}
21060
21061impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21062    type Err = std::convert::Infallible;
21063    fn from_str(s: &str) -> Result<Self, Self::Err> {
21064        use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
21065        match s {
21066            "none" => Ok(None),
21067            "off_session" => Ok(OffSession),
21068            v => {
21069                tracing::warn!(
21070                    "Unknown value '{}' for enum '{}'",
21071                    v,
21072                    "UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage"
21073                );
21074                Ok(Unknown(v.to_owned()))
21075            }
21076        }
21077    }
21078}
21079impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21080    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21081        f.write_str(self.as_str())
21082    }
21083}
21084
21085impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21086    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21087        f.write_str(self.as_str())
21088    }
21089}
21090impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21092    where
21093        S: serde::Serializer,
21094    {
21095        serializer.serialize_str(self.as_str())
21096    }
21097}
21098#[cfg(feature = "deserialize")]
21099impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
21100    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21101        use std::str::FromStr;
21102        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21103        Ok(Self::from_str(&s).expect("infallible"))
21104    }
21105}
21106/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
21107#[derive(Clone, Debug, serde::Serialize)]
21108pub struct UpdatePaymentIntentPaymentMethodOptionsMbWay {
21109    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21110    ///
21111    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21112    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21113    ///
21114    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21115    ///
21116    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21117    ///
21118    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21119    #[serde(skip_serializing_if = "Option::is_none")]
21120    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
21121}
21122impl UpdatePaymentIntentPaymentMethodOptionsMbWay {
21123    pub fn new() -> Self {
21124        Self { setup_future_usage: None }
21125    }
21126}
21127impl Default for UpdatePaymentIntentPaymentMethodOptionsMbWay {
21128    fn default() -> Self {
21129        Self::new()
21130    }
21131}
21132/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21133///
21134/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21135/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21136///
21137/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21138///
21139/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21140///
21141/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21142#[derive(Clone, Eq, PartialEq)]
21143#[non_exhaustive]
21144pub enum UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21145    None,
21146    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21147    Unknown(String),
21148}
21149impl UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21150    pub fn as_str(&self) -> &str {
21151        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
21152        match self {
21153            None => "none",
21154            Unknown(v) => v,
21155        }
21156    }
21157}
21158
21159impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21160    type Err = std::convert::Infallible;
21161    fn from_str(s: &str) -> Result<Self, Self::Err> {
21162        use UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
21163        match s {
21164            "none" => Ok(None),
21165            v => {
21166                tracing::warn!(
21167                    "Unknown value '{}' for enum '{}'",
21168                    v,
21169                    "UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage"
21170                );
21171                Ok(Unknown(v.to_owned()))
21172            }
21173        }
21174    }
21175}
21176impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21177    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21178        f.write_str(self.as_str())
21179    }
21180}
21181
21182impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21183    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21184        f.write_str(self.as_str())
21185    }
21186}
21187impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21188    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21189    where
21190        S: serde::Serializer,
21191    {
21192        serializer.serialize_str(self.as_str())
21193    }
21194}
21195#[cfg(feature = "deserialize")]
21196impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
21197    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21198        use std::str::FromStr;
21199        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21200        Ok(Self::from_str(&s).expect("infallible"))
21201    }
21202}
21203/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
21204#[derive(Clone, Debug, serde::Serialize)]
21205pub struct UpdatePaymentIntentPaymentMethodOptionsMobilepay {
21206    /// Controls when the funds are captured from the customer's account.
21207    ///
21208    /// 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.
21209    ///
21210    /// 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.
21211    #[serde(skip_serializing_if = "Option::is_none")]
21212    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
21213    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21214    ///
21215    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21216    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21217    ///
21218    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21219    ///
21220    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21221    ///
21222    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21223    #[serde(skip_serializing_if = "Option::is_none")]
21224    pub setup_future_usage:
21225        Option<UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
21226}
21227impl UpdatePaymentIntentPaymentMethodOptionsMobilepay {
21228    pub fn new() -> Self {
21229        Self { capture_method: None, setup_future_usage: None }
21230    }
21231}
21232impl Default for UpdatePaymentIntentPaymentMethodOptionsMobilepay {
21233    fn default() -> Self {
21234        Self::new()
21235    }
21236}
21237/// Controls when the funds are captured from the customer's account.
21238///
21239/// 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.
21240///
21241/// 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.
21242#[derive(Clone, Eq, PartialEq)]
21243#[non_exhaustive]
21244pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
21245    Manual,
21246    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21247    Unknown(String),
21248}
21249impl UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
21250    pub fn as_str(&self) -> &str {
21251        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
21252        match self {
21253            Manual => "manual",
21254            Unknown(v) => v,
21255        }
21256    }
21257}
21258
21259impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
21260    type Err = std::convert::Infallible;
21261    fn from_str(s: &str) -> Result<Self, Self::Err> {
21262        use UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
21263        match s {
21264            "manual" => Ok(Manual),
21265            v => {
21266                tracing::warn!(
21267                    "Unknown value '{}' for enum '{}'",
21268                    v,
21269                    "UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod"
21270                );
21271                Ok(Unknown(v.to_owned()))
21272            }
21273        }
21274    }
21275}
21276impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
21277    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21278        f.write_str(self.as_str())
21279    }
21280}
21281
21282impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
21283    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21284        f.write_str(self.as_str())
21285    }
21286}
21287impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
21288    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21289    where
21290        S: serde::Serializer,
21291    {
21292        serializer.serialize_str(self.as_str())
21293    }
21294}
21295#[cfg(feature = "deserialize")]
21296impl<'de> serde::Deserialize<'de>
21297    for UpdatePaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
21298{
21299    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21300        use std::str::FromStr;
21301        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21302        Ok(Self::from_str(&s).expect("infallible"))
21303    }
21304}
21305/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21306///
21307/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21308/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21309///
21310/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21311///
21312/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21313///
21314/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21315#[derive(Clone, Eq, PartialEq)]
21316#[non_exhaustive]
21317pub enum UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
21318    None,
21319    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21320    Unknown(String),
21321}
21322impl UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
21323    pub fn as_str(&self) -> &str {
21324        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
21325        match self {
21326            None => "none",
21327            Unknown(v) => v,
21328        }
21329    }
21330}
21331
21332impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
21333    type Err = std::convert::Infallible;
21334    fn from_str(s: &str) -> Result<Self, Self::Err> {
21335        use UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
21336        match s {
21337            "none" => Ok(None),
21338            v => {
21339                tracing::warn!(
21340                    "Unknown value '{}' for enum '{}'",
21341                    v,
21342                    "UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"
21343                );
21344                Ok(Unknown(v.to_owned()))
21345            }
21346        }
21347    }
21348}
21349impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
21350    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21351        f.write_str(self.as_str())
21352    }
21353}
21354
21355impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
21356    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21357        f.write_str(self.as_str())
21358    }
21359}
21360impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
21361    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21362    where
21363        S: serde::Serializer,
21364    {
21365        serializer.serialize_str(self.as_str())
21366    }
21367}
21368#[cfg(feature = "deserialize")]
21369impl<'de> serde::Deserialize<'de>
21370    for UpdatePaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
21371{
21372    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21373        use std::str::FromStr;
21374        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21375        Ok(Self::from_str(&s).expect("infallible"))
21376    }
21377}
21378/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
21379#[derive(Clone, Debug, serde::Serialize)]
21380pub struct UpdatePaymentIntentPaymentMethodOptionsMultibanco {
21381    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21382    ///
21383    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21384    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21385    ///
21386    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21387    ///
21388    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21389    ///
21390    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21391    #[serde(skip_serializing_if = "Option::is_none")]
21392    pub setup_future_usage:
21393        Option<UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
21394}
21395impl UpdatePaymentIntentPaymentMethodOptionsMultibanco {
21396    pub fn new() -> Self {
21397        Self { setup_future_usage: None }
21398    }
21399}
21400impl Default for UpdatePaymentIntentPaymentMethodOptionsMultibanco {
21401    fn default() -> Self {
21402        Self::new()
21403    }
21404}
21405/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21406///
21407/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21408/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21409///
21410/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21411///
21412/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21413///
21414/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21415#[derive(Clone, Eq, PartialEq)]
21416#[non_exhaustive]
21417pub enum UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
21418    None,
21419    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21420    Unknown(String),
21421}
21422impl UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
21423    pub fn as_str(&self) -> &str {
21424        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
21425        match self {
21426            None => "none",
21427            Unknown(v) => v,
21428        }
21429    }
21430}
21431
21432impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
21433    type Err = std::convert::Infallible;
21434    fn from_str(s: &str) -> Result<Self, Self::Err> {
21435        use UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
21436        match s {
21437            "none" => Ok(None),
21438            v => {
21439                tracing::warn!(
21440                    "Unknown value '{}' for enum '{}'",
21441                    v,
21442                    "UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"
21443                );
21444                Ok(Unknown(v.to_owned()))
21445            }
21446        }
21447    }
21448}
21449impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
21450    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21451        f.write_str(self.as_str())
21452    }
21453}
21454
21455impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
21456    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21457        f.write_str(self.as_str())
21458    }
21459}
21460impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
21461    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21462    where
21463        S: serde::Serializer,
21464    {
21465        serializer.serialize_str(self.as_str())
21466    }
21467}
21468#[cfg(feature = "deserialize")]
21469impl<'de> serde::Deserialize<'de>
21470    for UpdatePaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
21471{
21472    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21473        use std::str::FromStr;
21474        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21475        Ok(Self::from_str(&s).expect("infallible"))
21476    }
21477}
21478/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
21479#[derive(Clone, Debug, serde::Serialize)]
21480pub struct UpdatePaymentIntentPaymentMethodOptionsNaverPay {
21481    /// Controls when the funds are captured from the customer's account.
21482    ///
21483    /// 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.
21484    ///
21485    /// 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.
21486    #[serde(skip_serializing_if = "Option::is_none")]
21487    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
21488    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21489    ///
21490    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21491    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21492    ///
21493    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21494    ///
21495    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21496    #[serde(skip_serializing_if = "Option::is_none")]
21497    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
21498}
21499impl UpdatePaymentIntentPaymentMethodOptionsNaverPay {
21500    pub fn new() -> Self {
21501        Self { capture_method: None, setup_future_usage: None }
21502    }
21503}
21504impl Default for UpdatePaymentIntentPaymentMethodOptionsNaverPay {
21505    fn default() -> Self {
21506        Self::new()
21507    }
21508}
21509/// Controls when the funds are captured from the customer's account.
21510///
21511/// 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.
21512///
21513/// 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.
21514#[derive(Clone, Eq, PartialEq)]
21515#[non_exhaustive]
21516pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21517    Manual,
21518    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21519    Unknown(String),
21520}
21521impl UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21522    pub fn as_str(&self) -> &str {
21523        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
21524        match self {
21525            Manual => "manual",
21526            Unknown(v) => v,
21527        }
21528    }
21529}
21530
21531impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21532    type Err = std::convert::Infallible;
21533    fn from_str(s: &str) -> Result<Self, Self::Err> {
21534        use UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
21535        match s {
21536            "manual" => Ok(Manual),
21537            v => {
21538                tracing::warn!(
21539                    "Unknown value '{}' for enum '{}'",
21540                    v,
21541                    "UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod"
21542                );
21543                Ok(Unknown(v.to_owned()))
21544            }
21545        }
21546    }
21547}
21548impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21549    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21550        f.write_str(self.as_str())
21551    }
21552}
21553
21554impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21555    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21556        f.write_str(self.as_str())
21557    }
21558}
21559impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21560    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21561    where
21562        S: serde::Serializer,
21563    {
21564        serializer.serialize_str(self.as_str())
21565    }
21566}
21567#[cfg(feature = "deserialize")]
21568impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
21569    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21570        use std::str::FromStr;
21571        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21572        Ok(Self::from_str(&s).expect("infallible"))
21573    }
21574}
21575/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21576///
21577/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21578/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21579///
21580/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21581///
21582/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21583#[derive(Clone, Eq, PartialEq)]
21584#[non_exhaustive]
21585pub enum UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
21586    None,
21587    OffSession,
21588    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21589    Unknown(String),
21590}
21591impl UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
21592    pub fn as_str(&self) -> &str {
21593        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
21594        match self {
21595            None => "none",
21596            OffSession => "off_session",
21597            Unknown(v) => v,
21598        }
21599    }
21600}
21601
21602impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
21603    type Err = std::convert::Infallible;
21604    fn from_str(s: &str) -> Result<Self, Self::Err> {
21605        use UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
21606        match s {
21607            "none" => Ok(None),
21608            "off_session" => Ok(OffSession),
21609            v => {
21610                tracing::warn!(
21611                    "Unknown value '{}' for enum '{}'",
21612                    v,
21613                    "UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage"
21614                );
21615                Ok(Unknown(v.to_owned()))
21616            }
21617        }
21618    }
21619}
21620impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
21621    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21622        f.write_str(self.as_str())
21623    }
21624}
21625
21626impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
21627    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21628        f.write_str(self.as_str())
21629    }
21630}
21631impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
21632    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21633    where
21634        S: serde::Serializer,
21635    {
21636        serializer.serialize_str(self.as_str())
21637    }
21638}
21639#[cfg(feature = "deserialize")]
21640impl<'de> serde::Deserialize<'de>
21641    for UpdatePaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
21642{
21643    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21644        use std::str::FromStr;
21645        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21646        Ok(Self::from_str(&s).expect("infallible"))
21647    }
21648}
21649/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
21650#[derive(Clone, Debug, serde::Serialize)]
21651pub struct UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
21652    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21653    ///
21654    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21655    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21656    ///
21657    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21658    ///
21659    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21660    ///
21661    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21662    #[serde(skip_serializing_if = "Option::is_none")]
21663    pub setup_future_usage:
21664        Option<UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
21665    /// Controls when Stripe will attempt to debit the funds from the customer's account.
21666    /// The date must be a string in YYYY-MM-DD format.
21667    /// The date must be in the future and between 3 and 15 calendar days from now.
21668    #[serde(skip_serializing_if = "Option::is_none")]
21669    pub target_date: Option<String>,
21670}
21671impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
21672    pub fn new() -> Self {
21673        Self { setup_future_usage: None, target_date: None }
21674    }
21675}
21676impl Default for UpdatePaymentIntentPaymentMethodOptionsNzBankAccount {
21677    fn default() -> Self {
21678        Self::new()
21679    }
21680}
21681/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21682///
21683/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21684/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21685///
21686/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21687///
21688/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21689///
21690/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21691#[derive(Clone, Eq, PartialEq)]
21692#[non_exhaustive]
21693pub enum UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
21694    None,
21695    OffSession,
21696    OnSession,
21697    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21698    Unknown(String),
21699}
21700impl UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
21701    pub fn as_str(&self) -> &str {
21702        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
21703        match self {
21704            None => "none",
21705            OffSession => "off_session",
21706            OnSession => "on_session",
21707            Unknown(v) => v,
21708        }
21709    }
21710}
21711
21712impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
21713    type Err = std::convert::Infallible;
21714    fn from_str(s: &str) -> Result<Self, Self::Err> {
21715        use UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
21716        match s {
21717            "none" => Ok(None),
21718            "off_session" => Ok(OffSession),
21719            "on_session" => Ok(OnSession),
21720            v => {
21721                tracing::warn!(
21722                    "Unknown value '{}' for enum '{}'",
21723                    v,
21724                    "UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"
21725                );
21726                Ok(Unknown(v.to_owned()))
21727            }
21728        }
21729    }
21730}
21731impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
21732    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21733        f.write_str(self.as_str())
21734    }
21735}
21736
21737impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
21738    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21739        f.write_str(self.as_str())
21740    }
21741}
21742impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
21743    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21744    where
21745        S: serde::Serializer,
21746    {
21747        serializer.serialize_str(self.as_str())
21748    }
21749}
21750#[cfg(feature = "deserialize")]
21751impl<'de> serde::Deserialize<'de>
21752    for UpdatePaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
21753{
21754    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21755        use std::str::FromStr;
21756        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21757        Ok(Self::from_str(&s).expect("infallible"))
21758    }
21759}
21760/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
21761#[derive(Clone, Debug, serde::Serialize)]
21762pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo {
21763    /// The number of calendar days before an OXXO voucher expires.
21764    /// 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.
21765    #[serde(skip_serializing_if = "Option::is_none")]
21766    pub expires_after_days: Option<u32>,
21767    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21768    ///
21769    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21770    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21771    ///
21772    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21773    ///
21774    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21775    ///
21776    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21777    #[serde(skip_serializing_if = "Option::is_none")]
21778    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
21779}
21780impl UpdatePaymentIntentPaymentMethodOptionsOxxo {
21781    pub fn new() -> Self {
21782        Self { expires_after_days: None, setup_future_usage: None }
21783    }
21784}
21785impl Default for UpdatePaymentIntentPaymentMethodOptionsOxxo {
21786    fn default() -> Self {
21787        Self::new()
21788    }
21789}
21790/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21791///
21792/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21793/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21794///
21795/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21796///
21797/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21798///
21799/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21800#[derive(Clone, Eq, PartialEq)]
21801#[non_exhaustive]
21802pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21803    None,
21804    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21805    Unknown(String),
21806}
21807impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21808    pub fn as_str(&self) -> &str {
21809        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
21810        match self {
21811            None => "none",
21812            Unknown(v) => v,
21813        }
21814    }
21815}
21816
21817impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21818    type Err = std::convert::Infallible;
21819    fn from_str(s: &str) -> Result<Self, Self::Err> {
21820        use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
21821        match s {
21822            "none" => Ok(None),
21823            v => {
21824                tracing::warn!(
21825                    "Unknown value '{}' for enum '{}'",
21826                    v,
21827                    "UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage"
21828                );
21829                Ok(Unknown(v.to_owned()))
21830            }
21831        }
21832    }
21833}
21834impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21835    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21836        f.write_str(self.as_str())
21837    }
21838}
21839
21840impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21841    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21842        f.write_str(self.as_str())
21843    }
21844}
21845impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21846    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21847    where
21848        S: serde::Serializer,
21849    {
21850        serializer.serialize_str(self.as_str())
21851    }
21852}
21853#[cfg(feature = "deserialize")]
21854impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
21855    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21856        use std::str::FromStr;
21857        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21858        Ok(Self::from_str(&s).expect("infallible"))
21859    }
21860}
21861/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
21862#[derive(Clone, Debug, serde::Serialize)]
21863pub struct UpdatePaymentIntentPaymentMethodOptionsP24 {
21864    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21865    ///
21866    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21867    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21868    ///
21869    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21870    ///
21871    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21872    ///
21873    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21874    #[serde(skip_serializing_if = "Option::is_none")]
21875    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
21876    /// Confirm that the payer has accepted the P24 terms and conditions.
21877    #[serde(skip_serializing_if = "Option::is_none")]
21878    pub tos_shown_and_accepted: Option<bool>,
21879}
21880impl UpdatePaymentIntentPaymentMethodOptionsP24 {
21881    pub fn new() -> Self {
21882        Self { setup_future_usage: None, tos_shown_and_accepted: None }
21883    }
21884}
21885impl Default for UpdatePaymentIntentPaymentMethodOptionsP24 {
21886    fn default() -> Self {
21887        Self::new()
21888    }
21889}
21890/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
21891///
21892/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
21893/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
21894///
21895/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
21896///
21897/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
21898///
21899/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
21900#[derive(Clone, Eq, PartialEq)]
21901#[non_exhaustive]
21902pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21903    None,
21904    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21905    Unknown(String),
21906}
21907impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21908    pub fn as_str(&self) -> &str {
21909        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
21910        match self {
21911            None => "none",
21912            Unknown(v) => v,
21913        }
21914    }
21915}
21916
21917impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21918    type Err = std::convert::Infallible;
21919    fn from_str(s: &str) -> Result<Self, Self::Err> {
21920        use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
21921        match s {
21922            "none" => Ok(None),
21923            v => {
21924                tracing::warn!(
21925                    "Unknown value '{}' for enum '{}'",
21926                    v,
21927                    "UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage"
21928                );
21929                Ok(Unknown(v.to_owned()))
21930            }
21931        }
21932    }
21933}
21934impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21935    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21936        f.write_str(self.as_str())
21937    }
21938}
21939
21940impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21941    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21942        f.write_str(self.as_str())
21943    }
21944}
21945impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21946    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
21947    where
21948        S: serde::Serializer,
21949    {
21950        serializer.serialize_str(self.as_str())
21951    }
21952}
21953#[cfg(feature = "deserialize")]
21954impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
21955    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
21956        use std::str::FromStr;
21957        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
21958        Ok(Self::from_str(&s).expect("infallible"))
21959    }
21960}
21961/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
21962#[derive(Clone, Debug, serde::Serialize)]
21963pub struct UpdatePaymentIntentPaymentMethodOptionsPayco {
21964    /// Controls when the funds are captured from the customer's account.
21965    ///
21966    /// 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.
21967    ///
21968    /// 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.
21969    #[serde(skip_serializing_if = "Option::is_none")]
21970    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
21971}
21972impl UpdatePaymentIntentPaymentMethodOptionsPayco {
21973    pub fn new() -> Self {
21974        Self { capture_method: None }
21975    }
21976}
21977impl Default for UpdatePaymentIntentPaymentMethodOptionsPayco {
21978    fn default() -> Self {
21979        Self::new()
21980    }
21981}
21982/// Controls when the funds are captured from the customer's account.
21983///
21984/// 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.
21985///
21986/// 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.
21987#[derive(Clone, Eq, PartialEq)]
21988#[non_exhaustive]
21989pub enum UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
21990    Manual,
21991    /// An unrecognized value from Stripe. Should not be used as a request parameter.
21992    Unknown(String),
21993}
21994impl UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
21995    pub fn as_str(&self) -> &str {
21996        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
21997        match self {
21998            Manual => "manual",
21999            Unknown(v) => v,
22000        }
22001    }
22002}
22003
22004impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
22005    type Err = std::convert::Infallible;
22006    fn from_str(s: &str) -> Result<Self, Self::Err> {
22007        use UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
22008        match s {
22009            "manual" => Ok(Manual),
22010            v => {
22011                tracing::warn!(
22012                    "Unknown value '{}' for enum '{}'",
22013                    v,
22014                    "UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod"
22015                );
22016                Ok(Unknown(v.to_owned()))
22017            }
22018        }
22019    }
22020}
22021impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
22022    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22023        f.write_str(self.as_str())
22024    }
22025}
22026
22027impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
22028    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22029        f.write_str(self.as_str())
22030    }
22031}
22032impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
22033    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22034    where
22035        S: serde::Serializer,
22036    {
22037        serializer.serialize_str(self.as_str())
22038    }
22039}
22040#[cfg(feature = "deserialize")]
22041impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
22042    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22043        use std::str::FromStr;
22044        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22045        Ok(Self::from_str(&s).expect("infallible"))
22046    }
22047}
22048/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
22049#[derive(Clone, Debug, serde::Serialize)]
22050pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow {
22051    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22052    ///
22053    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22054    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22055    ///
22056    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22057    ///
22058    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22059    ///
22060    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22061    #[serde(skip_serializing_if = "Option::is_none")]
22062    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
22063}
22064impl UpdatePaymentIntentPaymentMethodOptionsPaynow {
22065    pub fn new() -> Self {
22066        Self { setup_future_usage: None }
22067    }
22068}
22069impl Default for UpdatePaymentIntentPaymentMethodOptionsPaynow {
22070    fn default() -> Self {
22071        Self::new()
22072    }
22073}
22074/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22075///
22076/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22077/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22078///
22079/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22080///
22081/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22082///
22083/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22084#[derive(Clone, Eq, PartialEq)]
22085#[non_exhaustive]
22086pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
22087    None,
22088    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22089    Unknown(String),
22090}
22091impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
22092    pub fn as_str(&self) -> &str {
22093        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
22094        match self {
22095            None => "none",
22096            Unknown(v) => v,
22097        }
22098    }
22099}
22100
22101impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
22102    type Err = std::convert::Infallible;
22103    fn from_str(s: &str) -> Result<Self, Self::Err> {
22104        use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
22105        match s {
22106            "none" => Ok(None),
22107            v => {
22108                tracing::warn!(
22109                    "Unknown value '{}' for enum '{}'",
22110                    v,
22111                    "UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage"
22112                );
22113                Ok(Unknown(v.to_owned()))
22114            }
22115        }
22116    }
22117}
22118impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
22119    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22120        f.write_str(self.as_str())
22121    }
22122}
22123
22124impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
22125    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22126        f.write_str(self.as_str())
22127    }
22128}
22129impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
22130    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22131    where
22132        S: serde::Serializer,
22133    {
22134        serializer.serialize_str(self.as_str())
22135    }
22136}
22137#[cfg(feature = "deserialize")]
22138impl<'de> serde::Deserialize<'de>
22139    for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
22140{
22141    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22142        use std::str::FromStr;
22143        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22144        Ok(Self::from_str(&s).expect("infallible"))
22145    }
22146}
22147/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
22148#[derive(Clone, Debug, serde::Serialize)]
22149pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal {
22150    /// Controls when the funds will be captured from the customer's account.
22151    #[serde(skip_serializing_if = "Option::is_none")]
22152    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
22153    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
22154    #[serde(skip_serializing_if = "Option::is_none")]
22155    pub preferred_locale: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
22156    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
22157    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
22158    #[serde(skip_serializing_if = "Option::is_none")]
22159    pub reference: Option<String>,
22160    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
22161    #[serde(skip_serializing_if = "Option::is_none")]
22162    pub risk_correlation_id: Option<String>,
22163    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22164    ///
22165    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22166    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22167    ///
22168    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22169    ///
22170    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22171    ///
22172    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22173    #[serde(skip_serializing_if = "Option::is_none")]
22174    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
22175}
22176impl UpdatePaymentIntentPaymentMethodOptionsPaypal {
22177    pub fn new() -> Self {
22178        Self {
22179            capture_method: None,
22180            preferred_locale: None,
22181            reference: None,
22182            risk_correlation_id: None,
22183            setup_future_usage: None,
22184        }
22185    }
22186}
22187impl Default for UpdatePaymentIntentPaymentMethodOptionsPaypal {
22188    fn default() -> Self {
22189        Self::new()
22190    }
22191}
22192/// Controls when the funds will be captured from the customer's account.
22193#[derive(Clone, Eq, PartialEq)]
22194#[non_exhaustive]
22195pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22196    Manual,
22197    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22198    Unknown(String),
22199}
22200impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22201    pub fn as_str(&self) -> &str {
22202        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
22203        match self {
22204            Manual => "manual",
22205            Unknown(v) => v,
22206        }
22207    }
22208}
22209
22210impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22211    type Err = std::convert::Infallible;
22212    fn from_str(s: &str) -> Result<Self, Self::Err> {
22213        use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
22214        match s {
22215            "manual" => Ok(Manual),
22216            v => {
22217                tracing::warn!(
22218                    "Unknown value '{}' for enum '{}'",
22219                    v,
22220                    "UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod"
22221                );
22222                Ok(Unknown(v.to_owned()))
22223            }
22224        }
22225    }
22226}
22227impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22228    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22229        f.write_str(self.as_str())
22230    }
22231}
22232
22233impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22234    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22235        f.write_str(self.as_str())
22236    }
22237}
22238impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22239    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22240    where
22241        S: serde::Serializer,
22242    {
22243        serializer.serialize_str(self.as_str())
22244    }
22245}
22246#[cfg(feature = "deserialize")]
22247impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
22248    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22249        use std::str::FromStr;
22250        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22251        Ok(Self::from_str(&s).expect("infallible"))
22252    }
22253}
22254/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
22255#[derive(Clone, Eq, PartialEq)]
22256#[non_exhaustive]
22257pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22258    CsMinusCz,
22259    DaMinusDk,
22260    DeMinusAt,
22261    DeMinusDe,
22262    DeMinusLu,
22263    ElMinusGr,
22264    EnMinusGb,
22265    EnMinusUs,
22266    EsMinusEs,
22267    FiMinusFi,
22268    FrMinusBe,
22269    FrMinusFr,
22270    FrMinusLu,
22271    HuMinusHu,
22272    ItMinusIt,
22273    NlMinusBe,
22274    NlMinusNl,
22275    PlMinusPl,
22276    PtMinusPt,
22277    SkMinusSk,
22278    SvMinusSe,
22279    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22280    Unknown(String),
22281}
22282impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22283    pub fn as_str(&self) -> &str {
22284        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
22285        match self {
22286            CsMinusCz => "cs-CZ",
22287            DaMinusDk => "da-DK",
22288            DeMinusAt => "de-AT",
22289            DeMinusDe => "de-DE",
22290            DeMinusLu => "de-LU",
22291            ElMinusGr => "el-GR",
22292            EnMinusGb => "en-GB",
22293            EnMinusUs => "en-US",
22294            EsMinusEs => "es-ES",
22295            FiMinusFi => "fi-FI",
22296            FrMinusBe => "fr-BE",
22297            FrMinusFr => "fr-FR",
22298            FrMinusLu => "fr-LU",
22299            HuMinusHu => "hu-HU",
22300            ItMinusIt => "it-IT",
22301            NlMinusBe => "nl-BE",
22302            NlMinusNl => "nl-NL",
22303            PlMinusPl => "pl-PL",
22304            PtMinusPt => "pt-PT",
22305            SkMinusSk => "sk-SK",
22306            SvMinusSe => "sv-SE",
22307            Unknown(v) => v,
22308        }
22309    }
22310}
22311
22312impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22313    type Err = std::convert::Infallible;
22314    fn from_str(s: &str) -> Result<Self, Self::Err> {
22315        use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
22316        match s {
22317            "cs-CZ" => Ok(CsMinusCz),
22318            "da-DK" => Ok(DaMinusDk),
22319            "de-AT" => Ok(DeMinusAt),
22320            "de-DE" => Ok(DeMinusDe),
22321            "de-LU" => Ok(DeMinusLu),
22322            "el-GR" => Ok(ElMinusGr),
22323            "en-GB" => Ok(EnMinusGb),
22324            "en-US" => Ok(EnMinusUs),
22325            "es-ES" => Ok(EsMinusEs),
22326            "fi-FI" => Ok(FiMinusFi),
22327            "fr-BE" => Ok(FrMinusBe),
22328            "fr-FR" => Ok(FrMinusFr),
22329            "fr-LU" => Ok(FrMinusLu),
22330            "hu-HU" => Ok(HuMinusHu),
22331            "it-IT" => Ok(ItMinusIt),
22332            "nl-BE" => Ok(NlMinusBe),
22333            "nl-NL" => Ok(NlMinusNl),
22334            "pl-PL" => Ok(PlMinusPl),
22335            "pt-PT" => Ok(PtMinusPt),
22336            "sk-SK" => Ok(SkMinusSk),
22337            "sv-SE" => Ok(SvMinusSe),
22338            v => {
22339                tracing::warn!(
22340                    "Unknown value '{}' for enum '{}'",
22341                    v,
22342                    "UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale"
22343                );
22344                Ok(Unknown(v.to_owned()))
22345            }
22346        }
22347    }
22348}
22349impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22350    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22351        f.write_str(self.as_str())
22352    }
22353}
22354
22355impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22356    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22357        f.write_str(self.as_str())
22358    }
22359}
22360impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22361    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22362    where
22363        S: serde::Serializer,
22364    {
22365        serializer.serialize_str(self.as_str())
22366    }
22367}
22368#[cfg(feature = "deserialize")]
22369impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
22370    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22371        use std::str::FromStr;
22372        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22373        Ok(Self::from_str(&s).expect("infallible"))
22374    }
22375}
22376/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22377///
22378/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22379/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22380///
22381/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22382///
22383/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22384///
22385/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22386#[derive(Clone, Eq, PartialEq)]
22387#[non_exhaustive]
22388pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
22389    None,
22390    OffSession,
22391    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22392    Unknown(String),
22393}
22394impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
22395    pub fn as_str(&self) -> &str {
22396        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
22397        match self {
22398            None => "none",
22399            OffSession => "off_session",
22400            Unknown(v) => v,
22401        }
22402    }
22403}
22404
22405impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
22406    type Err = std::convert::Infallible;
22407    fn from_str(s: &str) -> Result<Self, Self::Err> {
22408        use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
22409        match s {
22410            "none" => Ok(None),
22411            "off_session" => Ok(OffSession),
22412            v => {
22413                tracing::warn!(
22414                    "Unknown value '{}' for enum '{}'",
22415                    v,
22416                    "UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage"
22417                );
22418                Ok(Unknown(v.to_owned()))
22419            }
22420        }
22421    }
22422}
22423impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
22424    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22425        f.write_str(self.as_str())
22426    }
22427}
22428
22429impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
22430    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22431        f.write_str(self.as_str())
22432    }
22433}
22434impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
22435    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22436    where
22437        S: serde::Serializer,
22438    {
22439        serializer.serialize_str(self.as_str())
22440    }
22441}
22442#[cfg(feature = "deserialize")]
22443impl<'de> serde::Deserialize<'de>
22444    for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
22445{
22446    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22447        use std::str::FromStr;
22448        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22449        Ok(Self::from_str(&s).expect("infallible"))
22450    }
22451}
22452/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
22453#[derive(Clone, Debug, serde::Serialize)]
22454pub struct UpdatePaymentIntentPaymentMethodOptionsPix {
22455    /// Determines if the amount includes the IOF tax. Defaults to `never`.
22456    #[serde(skip_serializing_if = "Option::is_none")]
22457    pub amount_includes_iof: Option<UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
22458    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
22459    /// Defaults to 86400 seconds.
22460    #[serde(skip_serializing_if = "Option::is_none")]
22461    pub expires_after_seconds: Option<i64>,
22462    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
22463    /// Defaults to 1 day in the future.
22464    #[serde(skip_serializing_if = "Option::is_none")]
22465    pub expires_at: Option<stripe_types::Timestamp>,
22466    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22467    ///
22468    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22469    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22470    ///
22471    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22472    ///
22473    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22474    ///
22475    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22476    #[serde(skip_serializing_if = "Option::is_none")]
22477    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
22478}
22479impl UpdatePaymentIntentPaymentMethodOptionsPix {
22480    pub fn new() -> Self {
22481        Self {
22482            amount_includes_iof: None,
22483            expires_after_seconds: None,
22484            expires_at: None,
22485            setup_future_usage: None,
22486        }
22487    }
22488}
22489impl Default for UpdatePaymentIntentPaymentMethodOptionsPix {
22490    fn default() -> Self {
22491        Self::new()
22492    }
22493}
22494/// Determines if the amount includes the IOF tax. Defaults to `never`.
22495#[derive(Clone, Eq, PartialEq)]
22496#[non_exhaustive]
22497pub enum UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22498    Always,
22499    Never,
22500    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22501    Unknown(String),
22502}
22503impl UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22504    pub fn as_str(&self) -> &str {
22505        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
22506        match self {
22507            Always => "always",
22508            Never => "never",
22509            Unknown(v) => v,
22510        }
22511    }
22512}
22513
22514impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22515    type Err = std::convert::Infallible;
22516    fn from_str(s: &str) -> Result<Self, Self::Err> {
22517        use UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
22518        match s {
22519            "always" => Ok(Always),
22520            "never" => Ok(Never),
22521            v => {
22522                tracing::warn!(
22523                    "Unknown value '{}' for enum '{}'",
22524                    v,
22525                    "UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof"
22526                );
22527                Ok(Unknown(v.to_owned()))
22528            }
22529        }
22530    }
22531}
22532impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22533    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22534        f.write_str(self.as_str())
22535    }
22536}
22537
22538impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22539    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22540        f.write_str(self.as_str())
22541    }
22542}
22543impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22544    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22545    where
22546        S: serde::Serializer,
22547    {
22548        serializer.serialize_str(self.as_str())
22549    }
22550}
22551#[cfg(feature = "deserialize")]
22552impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
22553    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22554        use std::str::FromStr;
22555        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22556        Ok(Self::from_str(&s).expect("infallible"))
22557    }
22558}
22559/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22560///
22561/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22562/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22563///
22564/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22565///
22566/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22567///
22568/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22569#[derive(Clone, Eq, PartialEq)]
22570#[non_exhaustive]
22571pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22572    None,
22573    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22574    Unknown(String),
22575}
22576impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22577    pub fn as_str(&self) -> &str {
22578        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
22579        match self {
22580            None => "none",
22581            Unknown(v) => v,
22582        }
22583    }
22584}
22585
22586impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22587    type Err = std::convert::Infallible;
22588    fn from_str(s: &str) -> Result<Self, Self::Err> {
22589        use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
22590        match s {
22591            "none" => Ok(None),
22592            v => {
22593                tracing::warn!(
22594                    "Unknown value '{}' for enum '{}'",
22595                    v,
22596                    "UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage"
22597                );
22598                Ok(Unknown(v.to_owned()))
22599            }
22600        }
22601    }
22602}
22603impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22604    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22605        f.write_str(self.as_str())
22606    }
22607}
22608
22609impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22610    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22611        f.write_str(self.as_str())
22612    }
22613}
22614impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22615    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22616    where
22617        S: serde::Serializer,
22618    {
22619        serializer.serialize_str(self.as_str())
22620    }
22621}
22622#[cfg(feature = "deserialize")]
22623impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
22624    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22625        use std::str::FromStr;
22626        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22627        Ok(Self::from_str(&s).expect("infallible"))
22628    }
22629}
22630/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
22631#[derive(Clone, Debug, serde::Serialize)]
22632pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay {
22633    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22634    ///
22635    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22636    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22637    ///
22638    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22639    ///
22640    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22641    ///
22642    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22643    #[serde(skip_serializing_if = "Option::is_none")]
22644    pub setup_future_usage:
22645        Option<UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
22646}
22647impl UpdatePaymentIntentPaymentMethodOptionsPromptpay {
22648    pub fn new() -> Self {
22649        Self { setup_future_usage: None }
22650    }
22651}
22652impl Default for UpdatePaymentIntentPaymentMethodOptionsPromptpay {
22653    fn default() -> Self {
22654        Self::new()
22655    }
22656}
22657/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22658///
22659/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22660/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22661///
22662/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22663///
22664/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22665///
22666/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
22667#[derive(Clone, Eq, PartialEq)]
22668#[non_exhaustive]
22669pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
22670    None,
22671    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22672    Unknown(String),
22673}
22674impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
22675    pub fn as_str(&self) -> &str {
22676        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
22677        match self {
22678            None => "none",
22679            Unknown(v) => v,
22680        }
22681    }
22682}
22683
22684impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
22685    type Err = std::convert::Infallible;
22686    fn from_str(s: &str) -> Result<Self, Self::Err> {
22687        use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
22688        match s {
22689            "none" => Ok(None),
22690            v => {
22691                tracing::warn!(
22692                    "Unknown value '{}' for enum '{}'",
22693                    v,
22694                    "UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"
22695                );
22696                Ok(Unknown(v.to_owned()))
22697            }
22698        }
22699    }
22700}
22701impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
22702    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22703        f.write_str(self.as_str())
22704    }
22705}
22706
22707impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
22708    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22709        f.write_str(self.as_str())
22710    }
22711}
22712impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
22713    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22714    where
22715        S: serde::Serializer,
22716    {
22717        serializer.serialize_str(self.as_str())
22718    }
22719}
22720#[cfg(feature = "deserialize")]
22721impl<'de> serde::Deserialize<'de>
22722    for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
22723{
22724    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22725        use std::str::FromStr;
22726        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22727        Ok(Self::from_str(&s).expect("infallible"))
22728    }
22729}
22730/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
22731#[derive(Clone, Debug, serde::Serialize)]
22732pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
22733    /// Controls when the funds are captured from the customer's account.
22734    ///
22735    /// 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.
22736    ///
22737    /// 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.
22738    #[serde(skip_serializing_if = "Option::is_none")]
22739    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
22740    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22741    ///
22742    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22743    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22744    ///
22745    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22746    ///
22747    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22748    #[serde(skip_serializing_if = "Option::is_none")]
22749    pub setup_future_usage:
22750        Option<UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
22751}
22752impl UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
22753    pub fn new() -> Self {
22754        Self { capture_method: None, setup_future_usage: None }
22755    }
22756}
22757impl Default for UpdatePaymentIntentPaymentMethodOptionsRevolutPay {
22758    fn default() -> Self {
22759        Self::new()
22760    }
22761}
22762/// Controls when the funds are captured from the customer's account.
22763///
22764/// 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.
22765///
22766/// 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.
22767#[derive(Clone, Eq, PartialEq)]
22768#[non_exhaustive]
22769pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
22770    Manual,
22771    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22772    Unknown(String),
22773}
22774impl UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
22775    pub fn as_str(&self) -> &str {
22776        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
22777        match self {
22778            Manual => "manual",
22779            Unknown(v) => v,
22780        }
22781    }
22782}
22783
22784impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
22785    type Err = std::convert::Infallible;
22786    fn from_str(s: &str) -> Result<Self, Self::Err> {
22787        use UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
22788        match s {
22789            "manual" => Ok(Manual),
22790            v => {
22791                tracing::warn!(
22792                    "Unknown value '{}' for enum '{}'",
22793                    v,
22794                    "UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod"
22795                );
22796                Ok(Unknown(v.to_owned()))
22797            }
22798        }
22799    }
22800}
22801impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
22802    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22803        f.write_str(self.as_str())
22804    }
22805}
22806
22807impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
22808    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22809        f.write_str(self.as_str())
22810    }
22811}
22812impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
22813    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22814    where
22815        S: serde::Serializer,
22816    {
22817        serializer.serialize_str(self.as_str())
22818    }
22819}
22820#[cfg(feature = "deserialize")]
22821impl<'de> serde::Deserialize<'de>
22822    for UpdatePaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
22823{
22824    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22825        use std::str::FromStr;
22826        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22827        Ok(Self::from_str(&s).expect("infallible"))
22828    }
22829}
22830/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
22831///
22832/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
22833/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
22834///
22835/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
22836///
22837/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
22838#[derive(Clone, Eq, PartialEq)]
22839#[non_exhaustive]
22840pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
22841    None,
22842    OffSession,
22843    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22844    Unknown(String),
22845}
22846impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
22847    pub fn as_str(&self) -> &str {
22848        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
22849        match self {
22850            None => "none",
22851            OffSession => "off_session",
22852            Unknown(v) => v,
22853        }
22854    }
22855}
22856
22857impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
22858    type Err = std::convert::Infallible;
22859    fn from_str(s: &str) -> Result<Self, Self::Err> {
22860        use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
22861        match s {
22862            "none" => Ok(None),
22863            "off_session" => Ok(OffSession),
22864            v => {
22865                tracing::warn!(
22866                    "Unknown value '{}' for enum '{}'",
22867                    v,
22868                    "UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"
22869                );
22870                Ok(Unknown(v.to_owned()))
22871            }
22872        }
22873    }
22874}
22875impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
22876    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22877        f.write_str(self.as_str())
22878    }
22879}
22880
22881impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
22882    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22883        f.write_str(self.as_str())
22884    }
22885}
22886impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
22887    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22888    where
22889        S: serde::Serializer,
22890    {
22891        serializer.serialize_str(self.as_str())
22892    }
22893}
22894#[cfg(feature = "deserialize")]
22895impl<'de> serde::Deserialize<'de>
22896    for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
22897{
22898    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22899        use std::str::FromStr;
22900        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22901        Ok(Self::from_str(&s).expect("infallible"))
22902    }
22903}
22904/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
22905#[derive(Clone, Debug, serde::Serialize)]
22906pub struct UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
22907    /// Controls when the funds are captured from the customer's account.
22908    ///
22909    /// 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.
22910    ///
22911    /// 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.
22912    #[serde(skip_serializing_if = "Option::is_none")]
22913    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
22914}
22915impl UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
22916    pub fn new() -> Self {
22917        Self { capture_method: None }
22918    }
22919}
22920impl Default for UpdatePaymentIntentPaymentMethodOptionsSamsungPay {
22921    fn default() -> Self {
22922        Self::new()
22923    }
22924}
22925/// Controls when the funds are captured from the customer's account.
22926///
22927/// 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.
22928///
22929/// 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.
22930#[derive(Clone, Eq, PartialEq)]
22931#[non_exhaustive]
22932pub enum UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
22933    Manual,
22934    /// An unrecognized value from Stripe. Should not be used as a request parameter.
22935    Unknown(String),
22936}
22937impl UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
22938    pub fn as_str(&self) -> &str {
22939        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
22940        match self {
22941            Manual => "manual",
22942            Unknown(v) => v,
22943        }
22944    }
22945}
22946
22947impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
22948    type Err = std::convert::Infallible;
22949    fn from_str(s: &str) -> Result<Self, Self::Err> {
22950        use UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
22951        match s {
22952            "manual" => Ok(Manual),
22953            v => {
22954                tracing::warn!(
22955                    "Unknown value '{}' for enum '{}'",
22956                    v,
22957                    "UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod"
22958                );
22959                Ok(Unknown(v.to_owned()))
22960            }
22961        }
22962    }
22963}
22964impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
22965    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22966        f.write_str(self.as_str())
22967    }
22968}
22969
22970impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
22971    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
22972        f.write_str(self.as_str())
22973    }
22974}
22975impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
22976    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
22977    where
22978        S: serde::Serializer,
22979    {
22980        serializer.serialize_str(self.as_str())
22981    }
22982}
22983#[cfg(feature = "deserialize")]
22984impl<'de> serde::Deserialize<'de>
22985    for UpdatePaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
22986{
22987    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
22988        use std::str::FromStr;
22989        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
22990        Ok(Self::from_str(&s).expect("infallible"))
22991    }
22992}
22993/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
22994#[derive(Clone, Debug, serde::Serialize)]
22995pub struct UpdatePaymentIntentPaymentMethodOptionsSatispay {
22996    /// Controls when the funds are captured from the customer's account.
22997    ///
22998    /// 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.
22999    ///
23000    /// 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.
23001    #[serde(skip_serializing_if = "Option::is_none")]
23002    pub capture_method: Option<UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
23003}
23004impl UpdatePaymentIntentPaymentMethodOptionsSatispay {
23005    pub fn new() -> Self {
23006        Self { capture_method: None }
23007    }
23008}
23009impl Default for UpdatePaymentIntentPaymentMethodOptionsSatispay {
23010    fn default() -> Self {
23011        Self::new()
23012    }
23013}
23014/// Controls when the funds are captured from the customer's account.
23015///
23016/// 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.
23017///
23018/// 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.
23019#[derive(Clone, Eq, PartialEq)]
23020#[non_exhaustive]
23021pub enum UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23022    Manual,
23023    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23024    Unknown(String),
23025}
23026impl UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23027    pub fn as_str(&self) -> &str {
23028        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
23029        match self {
23030            Manual => "manual",
23031            Unknown(v) => v,
23032        }
23033    }
23034}
23035
23036impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23037    type Err = std::convert::Infallible;
23038    fn from_str(s: &str) -> Result<Self, Self::Err> {
23039        use UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
23040        match s {
23041            "manual" => Ok(Manual),
23042            v => {
23043                tracing::warn!(
23044                    "Unknown value '{}' for enum '{}'",
23045                    v,
23046                    "UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod"
23047                );
23048                Ok(Unknown(v.to_owned()))
23049            }
23050        }
23051    }
23052}
23053impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23054    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23055        f.write_str(self.as_str())
23056    }
23057}
23058
23059impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23060    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23061        f.write_str(self.as_str())
23062    }
23063}
23064impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23065    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23066    where
23067        S: serde::Serializer,
23068    {
23069        serializer.serialize_str(self.as_str())
23070    }
23071}
23072#[cfg(feature = "deserialize")]
23073impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
23074    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23075        use std::str::FromStr;
23076        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23077        Ok(Self::from_str(&s).expect("infallible"))
23078    }
23079}
23080/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
23081#[derive(Clone, Debug, serde::Serialize)]
23082pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
23083    /// Additional fields for Mandate creation
23084    #[serde(skip_serializing_if = "Option::is_none")]
23085    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
23086    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23087    ///
23088    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23089    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23090    ///
23091    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23092    ///
23093    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23094    ///
23095    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23096    #[serde(skip_serializing_if = "Option::is_none")]
23097    pub setup_future_usage:
23098        Option<UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
23099    /// Controls when Stripe will attempt to debit the funds from the customer's account.
23100    /// The date must be a string in YYYY-MM-DD format.
23101    /// The date must be in the future and between 3 and 15 calendar days from now.
23102    #[serde(skip_serializing_if = "Option::is_none")]
23103    pub target_date: Option<String>,
23104}
23105impl UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
23106    pub fn new() -> Self {
23107        Self { mandate_options: None, setup_future_usage: None, target_date: None }
23108    }
23109}
23110impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebit {
23111    fn default() -> Self {
23112        Self::new()
23113    }
23114}
23115/// Additional fields for Mandate creation
23116#[derive(Clone, Debug, serde::Serialize)]
23117pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
23118    /// Prefix used to generate the Mandate reference.
23119    /// Must be at most 12 characters long.
23120    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
23121    /// Cannot begin with 'STRIPE'.
23122    #[serde(skip_serializing_if = "Option::is_none")]
23123    pub reference_prefix: Option<String>,
23124}
23125impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
23126    pub fn new() -> Self {
23127        Self { reference_prefix: None }
23128    }
23129}
23130impl Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
23131    fn default() -> Self {
23132        Self::new()
23133    }
23134}
23135/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23136///
23137/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23138/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23139///
23140/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23141///
23142/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23143///
23144/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23145#[derive(Clone, Eq, PartialEq)]
23146#[non_exhaustive]
23147pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
23148    None,
23149    OffSession,
23150    OnSession,
23151    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23152    Unknown(String),
23153}
23154impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
23155    pub fn as_str(&self) -> &str {
23156        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
23157        match self {
23158            None => "none",
23159            OffSession => "off_session",
23160            OnSession => "on_session",
23161            Unknown(v) => v,
23162        }
23163    }
23164}
23165
23166impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
23167    type Err = std::convert::Infallible;
23168    fn from_str(s: &str) -> Result<Self, Self::Err> {
23169        use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
23170        match s {
23171            "none" => Ok(None),
23172            "off_session" => Ok(OffSession),
23173            "on_session" => Ok(OnSession),
23174            v => {
23175                tracing::warn!(
23176                    "Unknown value '{}' for enum '{}'",
23177                    v,
23178                    "UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"
23179                );
23180                Ok(Unknown(v.to_owned()))
23181            }
23182        }
23183    }
23184}
23185impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
23186    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23187        f.write_str(self.as_str())
23188    }
23189}
23190
23191impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
23192    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23193        f.write_str(self.as_str())
23194    }
23195}
23196impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
23197    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23198    where
23199        S: serde::Serializer,
23200    {
23201        serializer.serialize_str(self.as_str())
23202    }
23203}
23204#[cfg(feature = "deserialize")]
23205impl<'de> serde::Deserialize<'de>
23206    for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
23207{
23208    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23209        use std::str::FromStr;
23210        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23211        Ok(Self::from_str(&s).expect("infallible"))
23212    }
23213}
23214/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
23215#[derive(Clone, Debug, serde::Serialize)]
23216pub struct UpdatePaymentIntentPaymentMethodOptionsSofort {
23217    /// Language shown to the payer on redirect.
23218    #[serde(skip_serializing_if = "Option::is_none")]
23219    pub preferred_language: Option<UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
23220    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23221    ///
23222    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23223    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23224    ///
23225    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23226    ///
23227    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23228    ///
23229    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23230    #[serde(skip_serializing_if = "Option::is_none")]
23231    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
23232}
23233impl UpdatePaymentIntentPaymentMethodOptionsSofort {
23234    pub fn new() -> Self {
23235        Self { preferred_language: None, setup_future_usage: None }
23236    }
23237}
23238impl Default for UpdatePaymentIntentPaymentMethodOptionsSofort {
23239    fn default() -> Self {
23240        Self::new()
23241    }
23242}
23243/// Language shown to the payer on redirect.
23244#[derive(Clone, Eq, PartialEq)]
23245#[non_exhaustive]
23246pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
23247    De,
23248    En,
23249    Es,
23250    Fr,
23251    It,
23252    Nl,
23253    Pl,
23254    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23255    Unknown(String),
23256}
23257impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
23258    pub fn as_str(&self) -> &str {
23259        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
23260        match self {
23261            De => "de",
23262            En => "en",
23263            Es => "es",
23264            Fr => "fr",
23265            It => "it",
23266            Nl => "nl",
23267            Pl => "pl",
23268            Unknown(v) => v,
23269        }
23270    }
23271}
23272
23273impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
23274    type Err = std::convert::Infallible;
23275    fn from_str(s: &str) -> Result<Self, Self::Err> {
23276        use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
23277        match s {
23278            "de" => Ok(De),
23279            "en" => Ok(En),
23280            "es" => Ok(Es),
23281            "fr" => Ok(Fr),
23282            "it" => Ok(It),
23283            "nl" => Ok(Nl),
23284            "pl" => Ok(Pl),
23285            v => {
23286                tracing::warn!(
23287                    "Unknown value '{}' for enum '{}'",
23288                    v,
23289                    "UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage"
23290                );
23291                Ok(Unknown(v.to_owned()))
23292            }
23293        }
23294    }
23295}
23296impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
23297    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23298        f.write_str(self.as_str())
23299    }
23300}
23301
23302impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
23303    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23304        f.write_str(self.as_str())
23305    }
23306}
23307impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
23308    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23309    where
23310        S: serde::Serializer,
23311    {
23312        serializer.serialize_str(self.as_str())
23313    }
23314}
23315#[cfg(feature = "deserialize")]
23316impl<'de> serde::Deserialize<'de>
23317    for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage
23318{
23319    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23320        use std::str::FromStr;
23321        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23322        Ok(Self::from_str(&s).expect("infallible"))
23323    }
23324}
23325/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23326///
23327/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23328/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23329///
23330/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23331///
23332/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23333///
23334/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23335#[derive(Clone, Eq, PartialEq)]
23336#[non_exhaustive]
23337pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
23338    None,
23339    OffSession,
23340    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23341    Unknown(String),
23342}
23343impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
23344    pub fn as_str(&self) -> &str {
23345        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
23346        match self {
23347            None => "none",
23348            OffSession => "off_session",
23349            Unknown(v) => v,
23350        }
23351    }
23352}
23353
23354impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
23355    type Err = std::convert::Infallible;
23356    fn from_str(s: &str) -> Result<Self, Self::Err> {
23357        use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
23358        match s {
23359            "none" => Ok(None),
23360            "off_session" => Ok(OffSession),
23361            v => {
23362                tracing::warn!(
23363                    "Unknown value '{}' for enum '{}'",
23364                    v,
23365                    "UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage"
23366                );
23367                Ok(Unknown(v.to_owned()))
23368            }
23369        }
23370    }
23371}
23372impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
23373    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23374        f.write_str(self.as_str())
23375    }
23376}
23377
23378impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
23379    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23380        f.write_str(self.as_str())
23381    }
23382}
23383impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
23384    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23385    where
23386        S: serde::Serializer,
23387    {
23388        serializer.serialize_str(self.as_str())
23389    }
23390}
23391#[cfg(feature = "deserialize")]
23392impl<'de> serde::Deserialize<'de>
23393    for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
23394{
23395    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23396        use std::str::FromStr;
23397        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23398        Ok(Self::from_str(&s).expect("infallible"))
23399    }
23400}
23401/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
23402#[derive(Clone, Debug, serde::Serialize)]
23403pub struct UpdatePaymentIntentPaymentMethodOptionsSwish {
23404    /// A reference for this payment to be displayed in the Swish app.
23405    #[serde(skip_serializing_if = "Option::is_none")]
23406    pub reference: Option<String>,
23407    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23408    ///
23409    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23410    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23411    ///
23412    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23413    ///
23414    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23415    ///
23416    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23417    #[serde(skip_serializing_if = "Option::is_none")]
23418    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
23419}
23420impl UpdatePaymentIntentPaymentMethodOptionsSwish {
23421    pub fn new() -> Self {
23422        Self { reference: None, setup_future_usage: None }
23423    }
23424}
23425impl Default for UpdatePaymentIntentPaymentMethodOptionsSwish {
23426    fn default() -> Self {
23427        Self::new()
23428    }
23429}
23430/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23431///
23432/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23433/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23434///
23435/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23436///
23437/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23438///
23439/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23440#[derive(Clone, Eq, PartialEq)]
23441#[non_exhaustive]
23442pub enum UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23443    None,
23444    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23445    Unknown(String),
23446}
23447impl UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23448    pub fn as_str(&self) -> &str {
23449        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
23450        match self {
23451            None => "none",
23452            Unknown(v) => v,
23453        }
23454    }
23455}
23456
23457impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23458    type Err = std::convert::Infallible;
23459    fn from_str(s: &str) -> Result<Self, Self::Err> {
23460        use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
23461        match s {
23462            "none" => Ok(None),
23463            v => {
23464                tracing::warn!(
23465                    "Unknown value '{}' for enum '{}'",
23466                    v,
23467                    "UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage"
23468                );
23469                Ok(Unknown(v.to_owned()))
23470            }
23471        }
23472    }
23473}
23474impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23475    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23476        f.write_str(self.as_str())
23477    }
23478}
23479
23480impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23481    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23482        f.write_str(self.as_str())
23483    }
23484}
23485impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23486    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23487    where
23488        S: serde::Serializer,
23489    {
23490        serializer.serialize_str(self.as_str())
23491    }
23492}
23493#[cfg(feature = "deserialize")]
23494impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
23495    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23496        use std::str::FromStr;
23497        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23498        Ok(Self::from_str(&s).expect("infallible"))
23499    }
23500}
23501/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
23502#[derive(Clone, Debug, serde::Serialize)]
23503pub struct UpdatePaymentIntentPaymentMethodOptionsTwint {
23504    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23505    ///
23506    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23507    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23508    ///
23509    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23510    ///
23511    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23512    ///
23513    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23514    #[serde(skip_serializing_if = "Option::is_none")]
23515    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
23516}
23517impl UpdatePaymentIntentPaymentMethodOptionsTwint {
23518    pub fn new() -> Self {
23519        Self { setup_future_usage: None }
23520    }
23521}
23522impl Default for UpdatePaymentIntentPaymentMethodOptionsTwint {
23523    fn default() -> Self {
23524        Self::new()
23525    }
23526}
23527/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23528///
23529/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23530/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23531///
23532/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23533///
23534/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23535///
23536/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23537#[derive(Clone, Eq, PartialEq)]
23538#[non_exhaustive]
23539pub enum UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23540    None,
23541    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23542    Unknown(String),
23543}
23544impl UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23545    pub fn as_str(&self) -> &str {
23546        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
23547        match self {
23548            None => "none",
23549            Unknown(v) => v,
23550        }
23551    }
23552}
23553
23554impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23555    type Err = std::convert::Infallible;
23556    fn from_str(s: &str) -> Result<Self, Self::Err> {
23557        use UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
23558        match s {
23559            "none" => Ok(None),
23560            v => {
23561                tracing::warn!(
23562                    "Unknown value '{}' for enum '{}'",
23563                    v,
23564                    "UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage"
23565                );
23566                Ok(Unknown(v.to_owned()))
23567            }
23568        }
23569    }
23570}
23571impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23572    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23573        f.write_str(self.as_str())
23574    }
23575}
23576
23577impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23578    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23579        f.write_str(self.as_str())
23580    }
23581}
23582impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23583    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23584    where
23585        S: serde::Serializer,
23586    {
23587        serializer.serialize_str(self.as_str())
23588    }
23589}
23590#[cfg(feature = "deserialize")]
23591impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
23592    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23593        use std::str::FromStr;
23594        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23595        Ok(Self::from_str(&s).expect("infallible"))
23596    }
23597}
23598/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
23599#[derive(Clone, Debug, serde::Serialize)]
23600pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
23601    /// Additional fields for Financial Connections Session creation
23602    #[serde(skip_serializing_if = "Option::is_none")]
23603    pub financial_connections:
23604        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
23605    /// Additional fields for Mandate creation
23606    #[serde(skip_serializing_if = "Option::is_none")]
23607    pub mandate_options: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
23608    /// Additional fields for network related functions
23609    #[serde(skip_serializing_if = "Option::is_none")]
23610    pub networks: Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
23611    /// Preferred transaction settlement speed
23612    #[serde(skip_serializing_if = "Option::is_none")]
23613    pub preferred_settlement_speed:
23614        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
23615    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
23616    ///
23617    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
23618    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
23619    ///
23620    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
23621    ///
23622    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
23623    ///
23624    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
23625    #[serde(skip_serializing_if = "Option::is_none")]
23626    pub setup_future_usage:
23627        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
23628    /// Controls when Stripe will attempt to debit the funds from the customer's account.
23629    /// The date must be a string in YYYY-MM-DD format.
23630    /// The date must be in the future and between 3 and 15 calendar days from now.
23631    #[serde(skip_serializing_if = "Option::is_none")]
23632    pub target_date: Option<String>,
23633    /// Bank account verification method.
23634    #[serde(skip_serializing_if = "Option::is_none")]
23635    pub verification_method:
23636        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
23637}
23638impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
23639    pub fn new() -> Self {
23640        Self {
23641            financial_connections: None,
23642            mandate_options: None,
23643            networks: None,
23644            preferred_settlement_speed: None,
23645            setup_future_usage: None,
23646            target_date: None,
23647            verification_method: None,
23648        }
23649    }
23650}
23651impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccount {
23652    fn default() -> Self {
23653        Self::new()
23654    }
23655}
23656/// Additional fields for Financial Connections Session creation
23657#[derive(Clone, Debug, serde::Serialize)]
23658pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
23659    /// Provide filters for the linked accounts that the customer can select for the payment method.
23660    #[serde(skip_serializing_if = "Option::is_none")]
23661    pub filters:
23662        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
23663    /// The list of permissions to request.
23664    /// If this parameter is passed, the `payment_method` permission must be included.
23665    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
23666    #[serde(skip_serializing_if = "Option::is_none")]
23667    pub permissions: Option<
23668        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
23669    >,
23670    /// List of data features that you would like to retrieve upon account creation.
23671    #[serde(skip_serializing_if = "Option::is_none")]
23672    pub prefetch: Option<
23673        Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
23674    >,
23675    /// For webview integrations only.
23676    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
23677    #[serde(skip_serializing_if = "Option::is_none")]
23678    pub return_url: Option<String>,
23679}
23680impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
23681    pub fn new() -> Self {
23682        Self { filters: None, permissions: None, prefetch: None, return_url: None }
23683    }
23684}
23685impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
23686    fn default() -> Self {
23687        Self::new()
23688    }
23689}
23690/// Provide filters for the linked accounts that the customer can select for the payment method.
23691#[derive(Clone, Debug, serde::Serialize)]
23692pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
23693        /// The account subcategories to use to filter for selectable accounts.
23694    /// Valid subcategories are `checking` and `savings`.
23695#[serde(skip_serializing_if = "Option::is_none")]
23696pub account_subcategories: Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
23697
23698}
23699impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
23700    pub fn new() -> Self {
23701        Self { account_subcategories: None }
23702    }
23703}
23704impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
23705    fn default() -> Self {
23706        Self::new()
23707    }
23708}
23709/// The account subcategories to use to filter for selectable accounts.
23710/// Valid subcategories are `checking` and `savings`.
23711#[derive(Clone, Eq, PartialEq)]
23712#[non_exhaustive]
23713pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
23714{
23715    Checking,
23716    Savings,
23717    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23718    Unknown(String),
23719}
23720impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
23721    pub fn as_str(&self) -> &str {
23722        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
23723        match self {
23724Checking => "checking",
23725Savings => "savings",
23726Unknown(v) => v,
23727
23728        }
23729    }
23730}
23731
23732impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
23733    type Err = std::convert::Infallible;
23734    fn from_str(s: &str) -> Result<Self, Self::Err> {
23735        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
23736        match s {
23737    "checking" => Ok(Checking),
23738"savings" => Ok(Savings),
23739v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
23740
23741        }
23742    }
23743}
23744impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
23745    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23746        f.write_str(self.as_str())
23747    }
23748}
23749
23750impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
23751    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23752        f.write_str(self.as_str())
23753    }
23754}
23755impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
23756    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
23757        serializer.serialize_str(self.as_str())
23758    }
23759}
23760#[cfg(feature = "deserialize")]
23761impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
23762    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23763        use std::str::FromStr;
23764        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23765        Ok(Self::from_str(&s).expect("infallible"))
23766    }
23767}
23768/// The list of permissions to request.
23769/// If this parameter is passed, the `payment_method` permission must be included.
23770/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
23771#[derive(Clone, Eq, PartialEq)]
23772#[non_exhaustive]
23773pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
23774    Balances,
23775    Ownership,
23776    PaymentMethod,
23777    Transactions,
23778    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23779    Unknown(String),
23780}
23781impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
23782    pub fn as_str(&self) -> &str {
23783        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
23784        match self {
23785            Balances => "balances",
23786            Ownership => "ownership",
23787            PaymentMethod => "payment_method",
23788            Transactions => "transactions",
23789            Unknown(v) => v,
23790        }
23791    }
23792}
23793
23794impl std::str::FromStr
23795    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
23796{
23797    type Err = std::convert::Infallible;
23798    fn from_str(s: &str) -> Result<Self, Self::Err> {
23799        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
23800        match s {
23801            "balances" => Ok(Balances),
23802            "ownership" => Ok(Ownership),
23803            "payment_method" => Ok(PaymentMethod),
23804            "transactions" => Ok(Transactions),
23805            v => {
23806                tracing::warn!(
23807                    "Unknown value '{}' for enum '{}'",
23808                    v,
23809                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
23810                );
23811                Ok(Unknown(v.to_owned()))
23812            }
23813        }
23814    }
23815}
23816impl std::fmt::Display
23817    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
23818{
23819    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23820        f.write_str(self.as_str())
23821    }
23822}
23823
23824impl std::fmt::Debug
23825    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
23826{
23827    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23828        f.write_str(self.as_str())
23829    }
23830}
23831impl serde::Serialize
23832    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
23833{
23834    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23835    where
23836        S: serde::Serializer,
23837    {
23838        serializer.serialize_str(self.as_str())
23839    }
23840}
23841#[cfg(feature = "deserialize")]
23842impl<'de> serde::Deserialize<'de>
23843    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
23844{
23845    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23846        use std::str::FromStr;
23847        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23848        Ok(Self::from_str(&s).expect("infallible"))
23849    }
23850}
23851/// List of data features that you would like to retrieve upon account creation.
23852#[derive(Clone, Eq, PartialEq)]
23853#[non_exhaustive]
23854pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
23855    Balances,
23856    Ownership,
23857    Transactions,
23858    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23859    Unknown(String),
23860}
23861impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
23862    pub fn as_str(&self) -> &str {
23863        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
23864        match self {
23865            Balances => "balances",
23866            Ownership => "ownership",
23867            Transactions => "transactions",
23868            Unknown(v) => v,
23869        }
23870    }
23871}
23872
23873impl std::str::FromStr
23874    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
23875{
23876    type Err = std::convert::Infallible;
23877    fn from_str(s: &str) -> Result<Self, Self::Err> {
23878        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
23879        match s {
23880            "balances" => Ok(Balances),
23881            "ownership" => Ok(Ownership),
23882            "transactions" => Ok(Transactions),
23883            v => {
23884                tracing::warn!(
23885                    "Unknown value '{}' for enum '{}'",
23886                    v,
23887                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
23888                );
23889                Ok(Unknown(v.to_owned()))
23890            }
23891        }
23892    }
23893}
23894impl std::fmt::Display
23895    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
23896{
23897    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23898        f.write_str(self.as_str())
23899    }
23900}
23901
23902impl std::fmt::Debug
23903    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
23904{
23905    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23906        f.write_str(self.as_str())
23907    }
23908}
23909impl serde::Serialize
23910    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
23911{
23912    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
23913    where
23914        S: serde::Serializer,
23915    {
23916        serializer.serialize_str(self.as_str())
23917    }
23918}
23919#[cfg(feature = "deserialize")]
23920impl<'de> serde::Deserialize<'de>
23921    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
23922{
23923    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
23924        use std::str::FromStr;
23925        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
23926        Ok(Self::from_str(&s).expect("infallible"))
23927    }
23928}
23929/// Additional fields for Mandate creation
23930#[derive(Clone, Debug, serde::Serialize)]
23931pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
23932    /// The method used to collect offline mandate customer acceptance.
23933    #[serde(skip_serializing_if = "Option::is_none")]
23934    pub collection_method:
23935        Option<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
23936}
23937impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
23938    pub fn new() -> Self {
23939        Self { collection_method: None }
23940    }
23941}
23942impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
23943    fn default() -> Self {
23944        Self::new()
23945    }
23946}
23947/// The method used to collect offline mandate customer acceptance.
23948#[derive(Clone, Eq, PartialEq)]
23949#[non_exhaustive]
23950pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
23951    Paper,
23952    /// An unrecognized value from Stripe. Should not be used as a request parameter.
23953    Unknown(String),
23954}
23955impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
23956    pub fn as_str(&self) -> &str {
23957        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
23958        match self {
23959            Paper => "paper",
23960            Unknown(v) => v,
23961        }
23962    }
23963}
23964
23965impl std::str::FromStr
23966    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
23967{
23968    type Err = std::convert::Infallible;
23969    fn from_str(s: &str) -> Result<Self, Self::Err> {
23970        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
23971        match s {
23972            "paper" => Ok(Paper),
23973            v => {
23974                tracing::warn!(
23975                    "Unknown value '{}' for enum '{}'",
23976                    v,
23977                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
23978                );
23979                Ok(Unknown(v.to_owned()))
23980            }
23981        }
23982    }
23983}
23984impl std::fmt::Display
23985    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
23986{
23987    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23988        f.write_str(self.as_str())
23989    }
23990}
23991
23992impl std::fmt::Debug
23993    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
23994{
23995    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23996        f.write_str(self.as_str())
23997    }
23998}
23999impl serde::Serialize
24000    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
24001{
24002    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24003    where
24004        S: serde::Serializer,
24005    {
24006        serializer.serialize_str(self.as_str())
24007    }
24008}
24009#[cfg(feature = "deserialize")]
24010impl<'de> serde::Deserialize<'de>
24011    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
24012{
24013    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24014        use std::str::FromStr;
24015        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24016        Ok(Self::from_str(&s).expect("infallible"))
24017    }
24018}
24019/// Additional fields for network related functions
24020#[derive(Clone, Debug, serde::Serialize)]
24021pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
24022    /// Triggers validations to run across the selected networks
24023    #[serde(skip_serializing_if = "Option::is_none")]
24024    pub requested:
24025        Option<Vec<UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
24026}
24027impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
24028    pub fn new() -> Self {
24029        Self { requested: None }
24030    }
24031}
24032impl Default for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
24033    fn default() -> Self {
24034        Self::new()
24035    }
24036}
24037/// Triggers validations to run across the selected networks
24038#[derive(Clone, Eq, PartialEq)]
24039#[non_exhaustive]
24040pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
24041    Ach,
24042    UsDomesticWire,
24043    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24044    Unknown(String),
24045}
24046impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
24047    pub fn as_str(&self) -> &str {
24048        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
24049        match self {
24050            Ach => "ach",
24051            UsDomesticWire => "us_domestic_wire",
24052            Unknown(v) => v,
24053        }
24054    }
24055}
24056
24057impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
24058    type Err = std::convert::Infallible;
24059    fn from_str(s: &str) -> Result<Self, Self::Err> {
24060        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
24061        match s {
24062            "ach" => Ok(Ach),
24063            "us_domestic_wire" => Ok(UsDomesticWire),
24064            v => {
24065                tracing::warn!(
24066                    "Unknown value '{}' for enum '{}'",
24067                    v,
24068                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
24069                );
24070                Ok(Unknown(v.to_owned()))
24071            }
24072        }
24073    }
24074}
24075impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
24076    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24077        f.write_str(self.as_str())
24078    }
24079}
24080
24081impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
24082    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24083        f.write_str(self.as_str())
24084    }
24085}
24086impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
24087    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24088    where
24089        S: serde::Serializer,
24090    {
24091        serializer.serialize_str(self.as_str())
24092    }
24093}
24094#[cfg(feature = "deserialize")]
24095impl<'de> serde::Deserialize<'de>
24096    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
24097{
24098    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24099        use std::str::FromStr;
24100        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24101        Ok(Self::from_str(&s).expect("infallible"))
24102    }
24103}
24104/// Preferred transaction settlement speed
24105#[derive(Clone, Eq, PartialEq)]
24106#[non_exhaustive]
24107pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
24108    Fastest,
24109    Standard,
24110    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24111    Unknown(String),
24112}
24113impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
24114    pub fn as_str(&self) -> &str {
24115        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
24116        match self {
24117            Fastest => "fastest",
24118            Standard => "standard",
24119            Unknown(v) => v,
24120        }
24121    }
24122}
24123
24124impl std::str::FromStr
24125    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
24126{
24127    type Err = std::convert::Infallible;
24128    fn from_str(s: &str) -> Result<Self, Self::Err> {
24129        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
24130        match s {
24131            "fastest" => Ok(Fastest),
24132            "standard" => Ok(Standard),
24133            v => {
24134                tracing::warn!(
24135                    "Unknown value '{}' for enum '{}'",
24136                    v,
24137                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"
24138                );
24139                Ok(Unknown(v.to_owned()))
24140            }
24141        }
24142    }
24143}
24144impl std::fmt::Display
24145    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
24146{
24147    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24148        f.write_str(self.as_str())
24149    }
24150}
24151
24152impl std::fmt::Debug
24153    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
24154{
24155    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24156        f.write_str(self.as_str())
24157    }
24158}
24159impl serde::Serialize
24160    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
24161{
24162    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24163    where
24164        S: serde::Serializer,
24165    {
24166        serializer.serialize_str(self.as_str())
24167    }
24168}
24169#[cfg(feature = "deserialize")]
24170impl<'de> serde::Deserialize<'de>
24171    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
24172{
24173    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24174        use std::str::FromStr;
24175        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24176        Ok(Self::from_str(&s).expect("infallible"))
24177    }
24178}
24179/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24180///
24181/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
24182/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
24183///
24184/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
24185///
24186/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
24187///
24188/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
24189#[derive(Clone, Eq, PartialEq)]
24190#[non_exhaustive]
24191pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
24192    None,
24193    OffSession,
24194    OnSession,
24195    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24196    Unknown(String),
24197}
24198impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
24199    pub fn as_str(&self) -> &str {
24200        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
24201        match self {
24202            None => "none",
24203            OffSession => "off_session",
24204            OnSession => "on_session",
24205            Unknown(v) => v,
24206        }
24207    }
24208}
24209
24210impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
24211    type Err = std::convert::Infallible;
24212    fn from_str(s: &str) -> Result<Self, Self::Err> {
24213        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
24214        match s {
24215            "none" => Ok(None),
24216            "off_session" => Ok(OffSession),
24217            "on_session" => Ok(OnSession),
24218            v => {
24219                tracing::warn!(
24220                    "Unknown value '{}' for enum '{}'",
24221                    v,
24222                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"
24223                );
24224                Ok(Unknown(v.to_owned()))
24225            }
24226        }
24227    }
24228}
24229impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
24230    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24231        f.write_str(self.as_str())
24232    }
24233}
24234
24235impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
24236    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24237        f.write_str(self.as_str())
24238    }
24239}
24240impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
24241    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24242    where
24243        S: serde::Serializer,
24244    {
24245        serializer.serialize_str(self.as_str())
24246    }
24247}
24248#[cfg(feature = "deserialize")]
24249impl<'de> serde::Deserialize<'de>
24250    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
24251{
24252    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24253        use std::str::FromStr;
24254        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24255        Ok(Self::from_str(&s).expect("infallible"))
24256    }
24257}
24258/// Bank account verification method.
24259#[derive(Clone, Eq, PartialEq)]
24260#[non_exhaustive]
24261pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
24262    Automatic,
24263    Instant,
24264    Microdeposits,
24265    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24266    Unknown(String),
24267}
24268impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
24269    pub fn as_str(&self) -> &str {
24270        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
24271        match self {
24272            Automatic => "automatic",
24273            Instant => "instant",
24274            Microdeposits => "microdeposits",
24275            Unknown(v) => v,
24276        }
24277    }
24278}
24279
24280impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
24281    type Err = std::convert::Infallible;
24282    fn from_str(s: &str) -> Result<Self, Self::Err> {
24283        use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
24284        match s {
24285            "automatic" => Ok(Automatic),
24286            "instant" => Ok(Instant),
24287            "microdeposits" => Ok(Microdeposits),
24288            v => {
24289                tracing::warn!(
24290                    "Unknown value '{}' for enum '{}'",
24291                    v,
24292                    "UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
24293                );
24294                Ok(Unknown(v.to_owned()))
24295            }
24296        }
24297    }
24298}
24299impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
24300    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24301        f.write_str(self.as_str())
24302    }
24303}
24304
24305impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
24306    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24307        f.write_str(self.as_str())
24308    }
24309}
24310impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
24311    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24312    where
24313        S: serde::Serializer,
24314    {
24315        serializer.serialize_str(self.as_str())
24316    }
24317}
24318#[cfg(feature = "deserialize")]
24319impl<'de> serde::Deserialize<'de>
24320    for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
24321{
24322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24323        use std::str::FromStr;
24324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24325        Ok(Self::from_str(&s).expect("infallible"))
24326    }
24327}
24328/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
24329#[derive(Clone, Debug, serde::Serialize)]
24330pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay {
24331    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
24332    #[serde(skip_serializing_if = "Option::is_none")]
24333    pub app_id: Option<String>,
24334    /// The client type that the end customer will pay from
24335    #[serde(skip_serializing_if = "Option::is_none")]
24336    pub client: Option<UpdatePaymentIntentPaymentMethodOptionsWechatPayClient>,
24337    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24338    ///
24339    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
24340    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
24341    ///
24342    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
24343    ///
24344    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
24345    ///
24346    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
24347    #[serde(skip_serializing_if = "Option::is_none")]
24348    pub setup_future_usage:
24349        Option<UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
24350}
24351impl UpdatePaymentIntentPaymentMethodOptionsWechatPay {
24352    pub fn new() -> Self {
24353        Self { app_id: None, client: None, setup_future_usage: None }
24354    }
24355}
24356impl Default for UpdatePaymentIntentPaymentMethodOptionsWechatPay {
24357    fn default() -> Self {
24358        Self::new()
24359    }
24360}
24361/// The client type that the end customer will pay from
24362#[derive(Clone, Eq, PartialEq)]
24363#[non_exhaustive]
24364pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24365    Android,
24366    Ios,
24367    Web,
24368    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24369    Unknown(String),
24370}
24371impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24372    pub fn as_str(&self) -> &str {
24373        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
24374        match self {
24375            Android => "android",
24376            Ios => "ios",
24377            Web => "web",
24378            Unknown(v) => v,
24379        }
24380    }
24381}
24382
24383impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24384    type Err = std::convert::Infallible;
24385    fn from_str(s: &str) -> Result<Self, Self::Err> {
24386        use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*;
24387        match s {
24388            "android" => Ok(Android),
24389            "ios" => Ok(Ios),
24390            "web" => Ok(Web),
24391            v => {
24392                tracing::warn!(
24393                    "Unknown value '{}' for enum '{}'",
24394                    v,
24395                    "UpdatePaymentIntentPaymentMethodOptionsWechatPayClient"
24396                );
24397                Ok(Unknown(v.to_owned()))
24398            }
24399        }
24400    }
24401}
24402impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24403    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24404        f.write_str(self.as_str())
24405    }
24406}
24407
24408impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24409    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24410        f.write_str(self.as_str())
24411    }
24412}
24413impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24414    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24415    where
24416        S: serde::Serializer,
24417    {
24418        serializer.serialize_str(self.as_str())
24419    }
24420}
24421#[cfg(feature = "deserialize")]
24422impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient {
24423    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24424        use std::str::FromStr;
24425        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24426        Ok(Self::from_str(&s).expect("infallible"))
24427    }
24428}
24429/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24430///
24431/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
24432/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
24433///
24434/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
24435///
24436/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
24437///
24438/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
24439#[derive(Clone, Eq, PartialEq)]
24440#[non_exhaustive]
24441pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
24442    None,
24443    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24444    Unknown(String),
24445}
24446impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
24447    pub fn as_str(&self) -> &str {
24448        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
24449        match self {
24450            None => "none",
24451            Unknown(v) => v,
24452        }
24453    }
24454}
24455
24456impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
24457    type Err = std::convert::Infallible;
24458    fn from_str(s: &str) -> Result<Self, Self::Err> {
24459        use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
24460        match s {
24461            "none" => Ok(None),
24462            v => {
24463                tracing::warn!(
24464                    "Unknown value '{}' for enum '{}'",
24465                    v,
24466                    "UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"
24467                );
24468                Ok(Unknown(v.to_owned()))
24469            }
24470        }
24471    }
24472}
24473impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
24474    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24475        f.write_str(self.as_str())
24476    }
24477}
24478
24479impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
24480    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24481        f.write_str(self.as_str())
24482    }
24483}
24484impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
24485    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24486    where
24487        S: serde::Serializer,
24488    {
24489        serializer.serialize_str(self.as_str())
24490    }
24491}
24492#[cfg(feature = "deserialize")]
24493impl<'de> serde::Deserialize<'de>
24494    for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
24495{
24496    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24497        use std::str::FromStr;
24498        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24499        Ok(Self::from_str(&s).expect("infallible"))
24500    }
24501}
24502/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
24503#[derive(Clone, Debug, serde::Serialize)]
24504pub struct UpdatePaymentIntentPaymentMethodOptionsZip {
24505    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24506    ///
24507    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
24508    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
24509    ///
24510    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
24511    ///
24512    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
24513    ///
24514    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
24515    #[serde(skip_serializing_if = "Option::is_none")]
24516    pub setup_future_usage: Option<UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
24517}
24518impl UpdatePaymentIntentPaymentMethodOptionsZip {
24519    pub fn new() -> Self {
24520        Self { setup_future_usage: None }
24521    }
24522}
24523impl Default for UpdatePaymentIntentPaymentMethodOptionsZip {
24524    fn default() -> Self {
24525        Self::new()
24526    }
24527}
24528/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24529///
24530/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
24531/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
24532///
24533/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
24534///
24535/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
24536///
24537/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
24538#[derive(Clone, Eq, PartialEq)]
24539#[non_exhaustive]
24540pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24541    None,
24542    /// An unrecognized value from Stripe. Should not be used as a request parameter.
24543    Unknown(String),
24544}
24545impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24546    pub fn as_str(&self) -> &str {
24547        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
24548        match self {
24549            None => "none",
24550            Unknown(v) => v,
24551        }
24552    }
24553}
24554
24555impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24556    type Err = std::convert::Infallible;
24557    fn from_str(s: &str) -> Result<Self, Self::Err> {
24558        use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
24559        match s {
24560            "none" => Ok(None),
24561            v => {
24562                tracing::warn!(
24563                    "Unknown value '{}' for enum '{}'",
24564                    v,
24565                    "UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage"
24566                );
24567                Ok(Unknown(v.to_owned()))
24568            }
24569        }
24570    }
24571}
24572impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24573    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24574        f.write_str(self.as_str())
24575    }
24576}
24577
24578impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24579    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
24580        f.write_str(self.as_str())
24581    }
24582}
24583impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24584    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
24585    where
24586        S: serde::Serializer,
24587    {
24588        serializer.serialize_str(self.as_str())
24589    }
24590}
24591#[cfg(feature = "deserialize")]
24592impl<'de> serde::Deserialize<'de> for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
24593    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
24594        use std::str::FromStr;
24595        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
24596        Ok(Self::from_str(&s).expect("infallible"))
24597    }
24598}
24599/// Shipping information for this PaymentIntent.
24600#[derive(Clone, Debug, serde::Serialize)]
24601pub struct UpdatePaymentIntentShipping {
24602    /// Shipping address.
24603    pub address: UpdatePaymentIntentShippingAddress,
24604    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
24605    #[serde(skip_serializing_if = "Option::is_none")]
24606    pub carrier: Option<String>,
24607    /// Recipient name.
24608    pub name: String,
24609    /// Recipient phone (including extension).
24610    #[serde(skip_serializing_if = "Option::is_none")]
24611    pub phone: Option<String>,
24612    /// The tracking number for a physical product, obtained from the delivery service.
24613    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
24614    #[serde(skip_serializing_if = "Option::is_none")]
24615    pub tracking_number: Option<String>,
24616}
24617impl UpdatePaymentIntentShipping {
24618    pub fn new(
24619        address: impl Into<UpdatePaymentIntentShippingAddress>,
24620        name: impl Into<String>,
24621    ) -> Self {
24622        Self {
24623            address: address.into(),
24624            carrier: None,
24625            name: name.into(),
24626            phone: None,
24627            tracking_number: None,
24628        }
24629    }
24630}
24631/// Shipping address.
24632#[derive(Clone, Debug, serde::Serialize)]
24633pub struct UpdatePaymentIntentShippingAddress {
24634    /// City, district, suburb, town, or village.
24635    #[serde(skip_serializing_if = "Option::is_none")]
24636    pub city: Option<String>,
24637    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
24638    #[serde(skip_serializing_if = "Option::is_none")]
24639    pub country: Option<String>,
24640    /// Address line 1, such as the street, PO Box, or company name.
24641    #[serde(skip_serializing_if = "Option::is_none")]
24642    pub line1: Option<String>,
24643    /// Address line 2, such as the apartment, suite, unit, or building.
24644    #[serde(skip_serializing_if = "Option::is_none")]
24645    pub line2: Option<String>,
24646    /// ZIP or postal code.
24647    #[serde(skip_serializing_if = "Option::is_none")]
24648    pub postal_code: Option<String>,
24649    /// State, county, province, or region.
24650    #[serde(skip_serializing_if = "Option::is_none")]
24651    pub state: Option<String>,
24652}
24653impl UpdatePaymentIntentShippingAddress {
24654    pub fn new() -> Self {
24655        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
24656    }
24657}
24658impl Default for UpdatePaymentIntentShippingAddress {
24659    fn default() -> Self {
24660        Self::new()
24661    }
24662}
24663/// Use this parameter to automatically create a Transfer when the payment succeeds.
24664/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
24665#[derive(Copy, Clone, Debug, serde::Serialize)]
24666pub struct UpdatePaymentIntentTransferData {
24667    /// The amount that will be transferred automatically when a charge succeeds.
24668    #[serde(skip_serializing_if = "Option::is_none")]
24669    pub amount: Option<i64>,
24670}
24671impl UpdatePaymentIntentTransferData {
24672    pub fn new() -> Self {
24673        Self { amount: None }
24674    }
24675}
24676impl Default for UpdatePaymentIntentTransferData {
24677    fn default() -> Self {
24678        Self::new()
24679    }
24680}
24681/// Updates properties on a PaymentIntent object without confirming.
24682///
24683/// Depending on which properties you update, you might need to confirm the
24684/// PaymentIntent again. For example, updating the `payment_method`
24685/// always requires you to confirm the PaymentIntent again. If you prefer to
24686/// update and confirm at the same time, we recommend updating properties through
24687/// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
24688#[derive(Clone, Debug, serde::Serialize)]
24689pub struct UpdatePaymentIntent {
24690    inner: UpdatePaymentIntentBuilder,
24691    intent: stripe_shared::PaymentIntentId,
24692}
24693impl UpdatePaymentIntent {
24694    /// Construct a new `UpdatePaymentIntent`.
24695    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
24696        Self { intent: intent.into(), inner: UpdatePaymentIntentBuilder::new() }
24697    }
24698    /// Amount intended to be collected by this PaymentIntent.
24699    /// 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).
24700    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
24701    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
24702    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
24703        self.inner.amount = Some(amount.into());
24704        self
24705    }
24706    /// Provides industry-specific information about the amount.
24707    pub fn amount_details(
24708        mut self,
24709        amount_details: impl Into<UpdatePaymentIntentAmountDetails>,
24710    ) -> Self {
24711        self.inner.amount_details = Some(amount_details.into());
24712        self
24713    }
24714    /// 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.
24715    /// The amount of the application fee collected will be capped at the total amount captured.
24716    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
24717    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
24718        self.inner.application_fee_amount = Some(application_fee_amount.into());
24719        self
24720    }
24721    /// Controls when the funds will be captured from the customer's account.
24722    pub fn capture_method(
24723        mut self,
24724        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
24725    ) -> Self {
24726        self.inner.capture_method = Some(capture_method.into());
24727        self
24728    }
24729    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
24730    /// Must be a [supported currency](https://stripe.com/docs/currencies).
24731    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
24732        self.inner.currency = Some(currency.into());
24733        self
24734    }
24735    /// ID of the Customer this PaymentIntent belongs to, if one exists.
24736    ///
24737    /// Payment methods attached to other Customers cannot be used with this PaymentIntent.
24738    ///
24739    /// 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.
24740    /// 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.
24741    pub fn customer(mut self, customer: impl Into<String>) -> Self {
24742        self.inner.customer = Some(customer.into());
24743        self
24744    }
24745    /// An arbitrary string attached to the object. Often useful for displaying to users.
24746    pub fn description(mut self, description: impl Into<String>) -> Self {
24747        self.inner.description = Some(description.into());
24748        self
24749    }
24750    /// The list of payment method types to exclude from use with this payment.
24751    pub fn excluded_payment_method_types(
24752        mut self,
24753        excluded_payment_method_types: impl Into<
24754            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
24755        >,
24756    ) -> Self {
24757        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
24758        self
24759    }
24760    /// Specifies which fields in the response should be expanded.
24761    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
24762        self.inner.expand = Some(expand.into());
24763        self
24764    }
24765    /// Automations to be run during the PaymentIntent lifecycle
24766    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
24767        self.inner.hooks = Some(hooks.into());
24768        self
24769    }
24770    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
24771    /// This can be useful for storing additional information about the object in a structured format.
24772    /// Individual keys can be unset by posting an empty value to them.
24773    /// All keys can be unset by posting an empty value to `metadata`.
24774    pub fn metadata(
24775        mut self,
24776        metadata: impl Into<std::collections::HashMap<String, String>>,
24777    ) -> Self {
24778        self.inner.metadata = Some(metadata.into());
24779        self
24780    }
24781    /// Provides industry-specific information about the charge.
24782    pub fn payment_details(
24783        mut self,
24784        payment_details: impl Into<UpdatePaymentIntentPaymentDetails>,
24785    ) -> Self {
24786        self.inner.payment_details = Some(payment_details.into());
24787        self
24788    }
24789    /// 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.
24790    /// To unset this field to null, pass in an empty string.
24791    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
24792        self.inner.payment_method = Some(payment_method.into());
24793        self
24794    }
24795    /// The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent.
24796    pub fn payment_method_configuration(
24797        mut self,
24798        payment_method_configuration: impl Into<String>,
24799    ) -> Self {
24800        self.inner.payment_method_configuration = Some(payment_method_configuration.into());
24801        self
24802    }
24803    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
24804    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
24805    /// property on the PaymentIntent.
24806    pub fn payment_method_data(
24807        mut self,
24808        payment_method_data: impl Into<UpdatePaymentIntentPaymentMethodData>,
24809    ) -> Self {
24810        self.inner.payment_method_data = Some(payment_method_data.into());
24811        self
24812    }
24813    /// Payment-method-specific configuration for this PaymentIntent.
24814    pub fn payment_method_options(
24815        mut self,
24816        payment_method_options: impl Into<UpdatePaymentIntentPaymentMethodOptions>,
24817    ) -> Self {
24818        self.inner.payment_method_options = Some(payment_method_options.into());
24819        self
24820    }
24821    /// The list of payment method types (for example, card) that this PaymentIntent can use.
24822    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
24823    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
24824    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
24825        self.inner.payment_method_types = Some(payment_method_types.into());
24826        self
24827    }
24828    /// Email address that the receipt for the resulting payment will be sent to.
24829    /// 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).
24830    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
24831        self.inner.receipt_email = Some(receipt_email.into());
24832        self
24833    }
24834    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
24835    ///
24836    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
24837    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
24838    ///
24839    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
24840    ///
24841    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
24842    ///
24843    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
24844    pub fn setup_future_usage(
24845        mut self,
24846        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
24847    ) -> Self {
24848        self.inner.setup_future_usage = Some(setup_future_usage.into());
24849        self
24850    }
24851    /// Shipping information for this PaymentIntent.
24852    pub fn shipping(mut self, shipping: impl Into<UpdatePaymentIntentShipping>) -> Self {
24853        self.inner.shipping = Some(shipping.into());
24854        self
24855    }
24856    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
24857    /// This value overrides the account's default statement descriptor.
24858    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
24859    ///
24860    /// Setting this value for a card charge returns an error.
24861    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
24862    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
24863        self.inner.statement_descriptor = Some(statement_descriptor.into());
24864        self
24865    }
24866    /// Provides information about a card charge.
24867    /// 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.
24868    pub fn statement_descriptor_suffix(
24869        mut self,
24870        statement_descriptor_suffix: impl Into<String>,
24871    ) -> Self {
24872        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
24873        self
24874    }
24875    /// Use this parameter to automatically create a Transfer when the payment succeeds.
24876    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
24877    pub fn transfer_data(
24878        mut self,
24879        transfer_data: impl Into<UpdatePaymentIntentTransferData>,
24880    ) -> Self {
24881        self.inner.transfer_data = Some(transfer_data.into());
24882        self
24883    }
24884    /// A string that identifies the resulting payment as part of a group.
24885    /// You can only provide `transfer_group` if it hasn't been set.
24886    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
24887    pub fn transfer_group(mut self, transfer_group: impl Into<String>) -> Self {
24888        self.inner.transfer_group = Some(transfer_group.into());
24889        self
24890    }
24891}
24892impl UpdatePaymentIntent {
24893    /// Send the request and return the deserialized response.
24894    pub async fn send<C: StripeClient>(
24895        &self,
24896        client: &C,
24897    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
24898        self.customize().send(client).await
24899    }
24900
24901    /// Send the request and return the deserialized response, blocking until completion.
24902    pub fn send_blocking<C: StripeBlockingClient>(
24903        &self,
24904        client: &C,
24905    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
24906        self.customize().send_blocking(client)
24907    }
24908}
24909
24910impl StripeRequest for UpdatePaymentIntent {
24911    type Output = stripe_shared::PaymentIntent;
24912
24913    fn build(&self) -> RequestBuilder {
24914        let intent = &self.intent;
24915        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}"))
24916            .form(&self.inner)
24917    }
24918}
24919#[derive(Clone, Debug, serde::Serialize)]
24920struct ApplyCustomerBalancePaymentIntentBuilder {
24921    #[serde(skip_serializing_if = "Option::is_none")]
24922    amount: Option<i64>,
24923    #[serde(skip_serializing_if = "Option::is_none")]
24924    currency: Option<stripe_types::Currency>,
24925    #[serde(skip_serializing_if = "Option::is_none")]
24926    expand: Option<Vec<String>>,
24927}
24928impl ApplyCustomerBalancePaymentIntentBuilder {
24929    fn new() -> Self {
24930        Self { amount: None, currency: None, expand: None }
24931    }
24932}
24933/// Manually reconcile the remaining amount for a `customer_balance` PaymentIntent.
24934#[derive(Clone, Debug, serde::Serialize)]
24935pub struct ApplyCustomerBalancePaymentIntent {
24936    inner: ApplyCustomerBalancePaymentIntentBuilder,
24937    intent: stripe_shared::PaymentIntentId,
24938}
24939impl ApplyCustomerBalancePaymentIntent {
24940    /// Construct a new `ApplyCustomerBalancePaymentIntent`.
24941    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
24942        Self { intent: intent.into(), inner: ApplyCustomerBalancePaymentIntentBuilder::new() }
24943    }
24944    /// Amount that you intend to apply to this PaymentIntent from the customer’s cash balance.
24945    /// If the PaymentIntent was created by an Invoice, the full amount of the PaymentIntent is applied regardless of this parameter.
24946    ///
24947    /// 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).
24948    /// The maximum amount is the amount of the PaymentIntent.
24949    ///
24950    /// When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent.
24951    pub fn amount(mut self, amount: impl Into<i64>) -> Self {
24952        self.inner.amount = Some(amount.into());
24953        self
24954    }
24955    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
24956    /// Must be a [supported currency](https://stripe.com/docs/currencies).
24957    pub fn currency(mut self, currency: impl Into<stripe_types::Currency>) -> Self {
24958        self.inner.currency = Some(currency.into());
24959        self
24960    }
24961    /// Specifies which fields in the response should be expanded.
24962    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
24963        self.inner.expand = Some(expand.into());
24964        self
24965    }
24966}
24967impl ApplyCustomerBalancePaymentIntent {
24968    /// Send the request and return the deserialized response.
24969    pub async fn send<C: StripeClient>(
24970        &self,
24971        client: &C,
24972    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
24973        self.customize().send(client).await
24974    }
24975
24976    /// Send the request and return the deserialized response, blocking until completion.
24977    pub fn send_blocking<C: StripeBlockingClient>(
24978        &self,
24979        client: &C,
24980    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
24981        self.customize().send_blocking(client)
24982    }
24983}
24984
24985impl StripeRequest for ApplyCustomerBalancePaymentIntent {
24986    type Output = stripe_shared::PaymentIntent;
24987
24988    fn build(&self) -> RequestBuilder {
24989        let intent = &self.intent;
24990        RequestBuilder::new(
24991            StripeMethod::Post,
24992            format!("/payment_intents/{intent}/apply_customer_balance"),
24993        )
24994        .form(&self.inner)
24995    }
24996}
24997#[derive(Clone, Debug, serde::Serialize)]
24998struct CancelPaymentIntentBuilder {
24999    #[serde(skip_serializing_if = "Option::is_none")]
25000    cancellation_reason: Option<CancelPaymentIntentCancellationReason>,
25001    #[serde(skip_serializing_if = "Option::is_none")]
25002    expand: Option<Vec<String>>,
25003}
25004impl CancelPaymentIntentBuilder {
25005    fn new() -> Self {
25006        Self { cancellation_reason: None, expand: None }
25007    }
25008}
25009/// Reason for canceling this PaymentIntent.
25010/// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
25011#[derive(Clone, Eq, PartialEq)]
25012#[non_exhaustive]
25013pub enum CancelPaymentIntentCancellationReason {
25014    Abandoned,
25015    Duplicate,
25016    Fraudulent,
25017    RequestedByCustomer,
25018    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25019    Unknown(String),
25020}
25021impl CancelPaymentIntentCancellationReason {
25022    pub fn as_str(&self) -> &str {
25023        use CancelPaymentIntentCancellationReason::*;
25024        match self {
25025            Abandoned => "abandoned",
25026            Duplicate => "duplicate",
25027            Fraudulent => "fraudulent",
25028            RequestedByCustomer => "requested_by_customer",
25029            Unknown(v) => v,
25030        }
25031    }
25032}
25033
25034impl std::str::FromStr for CancelPaymentIntentCancellationReason {
25035    type Err = std::convert::Infallible;
25036    fn from_str(s: &str) -> Result<Self, Self::Err> {
25037        use CancelPaymentIntentCancellationReason::*;
25038        match s {
25039            "abandoned" => Ok(Abandoned),
25040            "duplicate" => Ok(Duplicate),
25041            "fraudulent" => Ok(Fraudulent),
25042            "requested_by_customer" => Ok(RequestedByCustomer),
25043            v => {
25044                tracing::warn!(
25045                    "Unknown value '{}' for enum '{}'",
25046                    v,
25047                    "CancelPaymentIntentCancellationReason"
25048                );
25049                Ok(Unknown(v.to_owned()))
25050            }
25051        }
25052    }
25053}
25054impl std::fmt::Display for CancelPaymentIntentCancellationReason {
25055    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25056        f.write_str(self.as_str())
25057    }
25058}
25059
25060impl std::fmt::Debug for CancelPaymentIntentCancellationReason {
25061    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25062        f.write_str(self.as_str())
25063    }
25064}
25065impl serde::Serialize for CancelPaymentIntentCancellationReason {
25066    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25067    where
25068        S: serde::Serializer,
25069    {
25070        serializer.serialize_str(self.as_str())
25071    }
25072}
25073#[cfg(feature = "deserialize")]
25074impl<'de> serde::Deserialize<'de> for CancelPaymentIntentCancellationReason {
25075    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25076        use std::str::FromStr;
25077        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25078        Ok(Self::from_str(&s).expect("infallible"))
25079    }
25080}
25081/// 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`.
25082///
25083///
25084/// After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error.
25085/// For PaymentIntents with a `status` of `requires_capture`, the remaining `amount_capturable` is automatically refunded.
25086///
25087///
25088/// You can’t cancel the PaymentIntent for a Checkout Session.
25089/// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
25090#[derive(Clone, Debug, serde::Serialize)]
25091pub struct CancelPaymentIntent {
25092    inner: CancelPaymentIntentBuilder,
25093    intent: stripe_shared::PaymentIntentId,
25094}
25095impl CancelPaymentIntent {
25096    /// Construct a new `CancelPaymentIntent`.
25097    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
25098        Self { intent: intent.into(), inner: CancelPaymentIntentBuilder::new() }
25099    }
25100    /// Reason for canceling this PaymentIntent.
25101    /// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.
25102    pub fn cancellation_reason(
25103        mut self,
25104        cancellation_reason: impl Into<CancelPaymentIntentCancellationReason>,
25105    ) -> Self {
25106        self.inner.cancellation_reason = Some(cancellation_reason.into());
25107        self
25108    }
25109    /// Specifies which fields in the response should be expanded.
25110    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
25111        self.inner.expand = Some(expand.into());
25112        self
25113    }
25114}
25115impl CancelPaymentIntent {
25116    /// Send the request and return the deserialized response.
25117    pub async fn send<C: StripeClient>(
25118        &self,
25119        client: &C,
25120    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
25121        self.customize().send(client).await
25122    }
25123
25124    /// Send the request and return the deserialized response, blocking until completion.
25125    pub fn send_blocking<C: StripeBlockingClient>(
25126        &self,
25127        client: &C,
25128    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
25129        self.customize().send_blocking(client)
25130    }
25131}
25132
25133impl StripeRequest for CancelPaymentIntent {
25134    type Output = stripe_shared::PaymentIntent;
25135
25136    fn build(&self) -> RequestBuilder {
25137        let intent = &self.intent;
25138        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/cancel"))
25139            .form(&self.inner)
25140    }
25141}
25142#[derive(Clone, Debug, serde::Serialize)]
25143struct CapturePaymentIntentBuilder {
25144    #[serde(skip_serializing_if = "Option::is_none")]
25145    amount_details: Option<CapturePaymentIntentAmountDetails>,
25146    #[serde(skip_serializing_if = "Option::is_none")]
25147    amount_to_capture: Option<i64>,
25148    #[serde(skip_serializing_if = "Option::is_none")]
25149    application_fee_amount: Option<i64>,
25150    #[serde(skip_serializing_if = "Option::is_none")]
25151    expand: Option<Vec<String>>,
25152    #[serde(skip_serializing_if = "Option::is_none")]
25153    final_capture: Option<bool>,
25154    #[serde(skip_serializing_if = "Option::is_none")]
25155    hooks: Option<AsyncWorkflowsParam>,
25156    #[serde(skip_serializing_if = "Option::is_none")]
25157    metadata: Option<std::collections::HashMap<String, String>>,
25158    #[serde(skip_serializing_if = "Option::is_none")]
25159    payment_details: Option<CapturePaymentIntentPaymentDetails>,
25160    #[serde(skip_serializing_if = "Option::is_none")]
25161    statement_descriptor: Option<String>,
25162    #[serde(skip_serializing_if = "Option::is_none")]
25163    statement_descriptor_suffix: Option<String>,
25164    #[serde(skip_serializing_if = "Option::is_none")]
25165    transfer_data: Option<CapturePaymentIntentTransferData>,
25166}
25167impl CapturePaymentIntentBuilder {
25168    fn new() -> Self {
25169        Self {
25170            amount_details: None,
25171            amount_to_capture: None,
25172            application_fee_amount: None,
25173            expand: None,
25174            final_capture: None,
25175            hooks: None,
25176            metadata: None,
25177            payment_details: None,
25178            statement_descriptor: None,
25179            statement_descriptor_suffix: None,
25180            transfer_data: None,
25181        }
25182    }
25183}
25184/// Provides industry-specific information about the amount.
25185#[derive(Clone, Debug, serde::Serialize)]
25186pub struct CapturePaymentIntentAmountDetails {
25187    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25188    /// An integer greater than 0.
25189    ///
25190    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
25191    #[serde(skip_serializing_if = "Option::is_none")]
25192    pub discount_amount: Option<i64>,
25193    /// A list of line items, each containing information about a product in the PaymentIntent.
25194    /// There is a maximum of 100 line items.
25195    #[serde(skip_serializing_if = "Option::is_none")]
25196    pub line_items: Option<Vec<CapturePaymentIntentAmountDetailsLineItems>>,
25197    /// Contains information about the shipping portion of the amount.
25198    #[serde(skip_serializing_if = "Option::is_none")]
25199    pub shipping: Option<AmountDetailsShippingParam>,
25200    /// Contains information about the tax portion of the amount.
25201    #[serde(skip_serializing_if = "Option::is_none")]
25202    pub tax: Option<AmountDetailsTaxParam>,
25203}
25204impl CapturePaymentIntentAmountDetails {
25205    pub fn new() -> Self {
25206        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
25207    }
25208}
25209impl Default for CapturePaymentIntentAmountDetails {
25210    fn default() -> Self {
25211        Self::new()
25212    }
25213}
25214/// A list of line items, each containing information about a product in the PaymentIntent.
25215/// There is a maximum of 100 line items.
25216#[derive(Clone, Debug, serde::Serialize)]
25217pub struct CapturePaymentIntentAmountDetailsLineItems {
25218    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25219    /// An integer greater than 0.
25220    ///
25221    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
25222    #[serde(skip_serializing_if = "Option::is_none")]
25223    pub discount_amount: Option<i64>,
25224    /// Payment method-specific information for line items.
25225    #[serde(skip_serializing_if = "Option::is_none")]
25226    pub payment_method_options:
25227        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
25228    /// The product code of the line item, such as an SKU.
25229    /// Required for L3 rates.
25230    /// At most 12 characters long.
25231    #[serde(skip_serializing_if = "Option::is_none")]
25232    pub product_code: Option<String>,
25233    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
25234    ///
25235    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
25236    /// For Paypal, this field is truncated to 127 characters.
25237    pub product_name: String,
25238    /// The quantity of items. Required for L3 rates. An integer greater than 0.
25239    pub quantity: u64,
25240    /// Contains information about the tax on the item.
25241    #[serde(skip_serializing_if = "Option::is_none")]
25242    pub tax: Option<AmountDetailsLineItemTaxParam>,
25243    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25244    /// Required for L3 rates.
25245    /// An integer greater than or equal to 0.
25246    pub unit_cost: i64,
25247    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
25248    #[serde(skip_serializing_if = "Option::is_none")]
25249    pub unit_of_measure: Option<String>,
25250}
25251impl CapturePaymentIntentAmountDetailsLineItems {
25252    pub fn new(
25253        product_name: impl Into<String>,
25254        quantity: impl Into<u64>,
25255        unit_cost: impl Into<i64>,
25256    ) -> Self {
25257        Self {
25258            discount_amount: None,
25259            payment_method_options: None,
25260            product_code: None,
25261            product_name: product_name.into(),
25262            quantity: quantity.into(),
25263            tax: None,
25264            unit_cost: unit_cost.into(),
25265            unit_of_measure: None,
25266        }
25267    }
25268}
25269/// Payment method-specific information for line items.
25270#[derive(Clone, Debug, serde::Serialize)]
25271pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
25272    /// This sub-hash contains line item details that are specific to `card` payment method."
25273    #[serde(skip_serializing_if = "Option::is_none")]
25274    pub card: Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
25275    /// This sub-hash contains line item details that are specific to `card_present` payment method."
25276    #[serde(skip_serializing_if = "Option::is_none")]
25277    pub card_present:
25278        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
25279    /// This sub-hash contains line item details that are specific to `klarna` payment method."
25280    #[serde(skip_serializing_if = "Option::is_none")]
25281    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
25282    /// This sub-hash contains line item details that are specific to `paypal` payment method."
25283    #[serde(skip_serializing_if = "Option::is_none")]
25284    pub paypal: Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
25285}
25286impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
25287    pub fn new() -> Self {
25288        Self { card: None, card_present: None, klarna: None, paypal: None }
25289    }
25290}
25291impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
25292    fn default() -> Self {
25293        Self::new()
25294    }
25295}
25296/// This sub-hash contains line item details that are specific to `card` payment method."
25297#[derive(Clone, Debug, serde::Serialize)]
25298pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
25299    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
25300    #[serde(skip_serializing_if = "Option::is_none")]
25301    pub commodity_code: Option<String>,
25302}
25303impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
25304    pub fn new() -> Self {
25305        Self { commodity_code: None }
25306    }
25307}
25308impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
25309    fn default() -> Self {
25310        Self::new()
25311    }
25312}
25313/// This sub-hash contains line item details that are specific to `card_present` payment method."
25314#[derive(Clone, Debug, serde::Serialize)]
25315pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
25316    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
25317    #[serde(skip_serializing_if = "Option::is_none")]
25318    pub commodity_code: Option<String>,
25319}
25320impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
25321    pub fn new() -> Self {
25322        Self { commodity_code: None }
25323    }
25324}
25325impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
25326    fn default() -> Self {
25327        Self::new()
25328    }
25329}
25330/// This sub-hash contains line item details that are specific to `paypal` payment method."
25331#[derive(Clone, Debug, serde::Serialize)]
25332pub struct CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
25333    /// Type of the line item.
25334    #[serde(skip_serializing_if = "Option::is_none")]
25335    pub category:
25336        Option<CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
25337    /// Description of the line item.
25338    #[serde(skip_serializing_if = "Option::is_none")]
25339    pub description: Option<String>,
25340    /// The Stripe account ID of the connected account that sells the item.
25341    #[serde(skip_serializing_if = "Option::is_none")]
25342    pub sold_by: Option<String>,
25343}
25344impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
25345    pub fn new() -> Self {
25346        Self { category: None, description: None, sold_by: None }
25347    }
25348}
25349impl Default for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
25350    fn default() -> Self {
25351        Self::new()
25352    }
25353}
25354/// Type of the line item.
25355#[derive(Clone, Eq, PartialEq)]
25356#[non_exhaustive]
25357pub enum CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
25358    DigitalGoods,
25359    Donation,
25360    PhysicalGoods,
25361    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25362    Unknown(String),
25363}
25364impl CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
25365    pub fn as_str(&self) -> &str {
25366        use CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
25367        match self {
25368            DigitalGoods => "digital_goods",
25369            Donation => "donation",
25370            PhysicalGoods => "physical_goods",
25371            Unknown(v) => v,
25372        }
25373    }
25374}
25375
25376impl std::str::FromStr
25377    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25378{
25379    type Err = std::convert::Infallible;
25380    fn from_str(s: &str) -> Result<Self, Self::Err> {
25381        use CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
25382        match s {
25383            "digital_goods" => Ok(DigitalGoods),
25384            "donation" => Ok(Donation),
25385            "physical_goods" => Ok(PhysicalGoods),
25386            v => {
25387                tracing::warn!(
25388                    "Unknown value '{}' for enum '{}'",
25389                    v,
25390                    "CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"
25391                );
25392                Ok(Unknown(v.to_owned()))
25393            }
25394        }
25395    }
25396}
25397impl std::fmt::Display
25398    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25399{
25400    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25401        f.write_str(self.as_str())
25402    }
25403}
25404
25405impl std::fmt::Debug
25406    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25407{
25408    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25409        f.write_str(self.as_str())
25410    }
25411}
25412impl serde::Serialize
25413    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25414{
25415    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25416    where
25417        S: serde::Serializer,
25418    {
25419        serializer.serialize_str(self.as_str())
25420    }
25421}
25422#[cfg(feature = "deserialize")]
25423impl<'de> serde::Deserialize<'de>
25424    for CapturePaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25425{
25426    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25427        use std::str::FromStr;
25428        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25429        Ok(Self::from_str(&s).expect("infallible"))
25430    }
25431}
25432/// Provides industry-specific information about the charge.
25433#[derive(Clone, Debug, serde::Serialize)]
25434pub struct CapturePaymentIntentPaymentDetails {
25435    /// A unique value to identify the customer. This field is available only for card payments.
25436    ///
25437    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
25438    #[serde(skip_serializing_if = "Option::is_none")]
25439    pub customer_reference: Option<String>,
25440    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
25441    ///
25442    /// 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`.
25443    ///
25444    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
25445    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
25446    #[serde(skip_serializing_if = "Option::is_none")]
25447    pub order_reference: Option<String>,
25448}
25449impl CapturePaymentIntentPaymentDetails {
25450    pub fn new() -> Self {
25451        Self { customer_reference: None, order_reference: None }
25452    }
25453}
25454impl Default for CapturePaymentIntentPaymentDetails {
25455    fn default() -> Self {
25456        Self::new()
25457    }
25458}
25459/// The parameters that you can use to automatically create a transfer after the payment
25460/// is captured.
25461/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
25462#[derive(Copy, Clone, Debug, serde::Serialize)]
25463pub struct CapturePaymentIntentTransferData {
25464    /// The amount that will be transferred automatically when a charge succeeds.
25465    #[serde(skip_serializing_if = "Option::is_none")]
25466    pub amount: Option<i64>,
25467}
25468impl CapturePaymentIntentTransferData {
25469    pub fn new() -> Self {
25470        Self { amount: None }
25471    }
25472}
25473impl Default for CapturePaymentIntentTransferData {
25474    fn default() -> Self {
25475        Self::new()
25476    }
25477}
25478/// Capture the funds of an existing uncaptured PaymentIntent when its status is `requires_capture`.
25479///
25480/// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
25481///
25482/// Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
25483#[derive(Clone, Debug, serde::Serialize)]
25484pub struct CapturePaymentIntent {
25485    inner: CapturePaymentIntentBuilder,
25486    intent: stripe_shared::PaymentIntentId,
25487}
25488impl CapturePaymentIntent {
25489    /// Construct a new `CapturePaymentIntent`.
25490    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
25491        Self { intent: intent.into(), inner: CapturePaymentIntentBuilder::new() }
25492    }
25493    /// Provides industry-specific information about the amount.
25494    pub fn amount_details(
25495        mut self,
25496        amount_details: impl Into<CapturePaymentIntentAmountDetails>,
25497    ) -> Self {
25498        self.inner.amount_details = Some(amount_details.into());
25499        self
25500    }
25501    /// The amount to capture from the PaymentIntent, which must be less than or equal to the original amount.
25502    /// Defaults to the full `amount_capturable` if it's not provided.
25503    pub fn amount_to_capture(mut self, amount_to_capture: impl Into<i64>) -> Self {
25504        self.inner.amount_to_capture = Some(amount_to_capture.into());
25505        self
25506    }
25507    /// 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.
25508    /// The amount of the application fee collected will be capped at the total amount captured.
25509    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
25510    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
25511        self.inner.application_fee_amount = Some(application_fee_amount.into());
25512        self
25513    }
25514    /// Specifies which fields in the response should be expanded.
25515    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
25516        self.inner.expand = Some(expand.into());
25517        self
25518    }
25519    /// Defaults to `true`.
25520    /// 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.
25521    /// You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents.
25522    pub fn final_capture(mut self, final_capture: impl Into<bool>) -> Self {
25523        self.inner.final_capture = Some(final_capture.into());
25524        self
25525    }
25526    /// Automations to be run during the PaymentIntent lifecycle
25527    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
25528        self.inner.hooks = Some(hooks.into());
25529        self
25530    }
25531    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
25532    /// This can be useful for storing additional information about the object in a structured format.
25533    /// Individual keys can be unset by posting an empty value to them.
25534    /// All keys can be unset by posting an empty value to `metadata`.
25535    pub fn metadata(
25536        mut self,
25537        metadata: impl Into<std::collections::HashMap<String, String>>,
25538    ) -> Self {
25539        self.inner.metadata = Some(metadata.into());
25540        self
25541    }
25542    /// Provides industry-specific information about the charge.
25543    pub fn payment_details(
25544        mut self,
25545        payment_details: impl Into<CapturePaymentIntentPaymentDetails>,
25546    ) -> Self {
25547        self.inner.payment_details = Some(payment_details.into());
25548        self
25549    }
25550    /// Text that appears on the customer's statement as the statement descriptor for a non-card charge.
25551    /// This value overrides the account's default statement descriptor.
25552    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
25553    ///
25554    /// Setting this value for a card charge returns an error.
25555    /// For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
25556    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
25557        self.inner.statement_descriptor = Some(statement_descriptor.into());
25558        self
25559    }
25560    /// Provides information about a card charge.
25561    /// 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.
25562    pub fn statement_descriptor_suffix(
25563        mut self,
25564        statement_descriptor_suffix: impl Into<String>,
25565    ) -> Self {
25566        self.inner.statement_descriptor_suffix = Some(statement_descriptor_suffix.into());
25567        self
25568    }
25569    /// The parameters that you can use to automatically create a transfer after the payment
25570    /// is captured.
25571    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
25572    pub fn transfer_data(
25573        mut self,
25574        transfer_data: impl Into<CapturePaymentIntentTransferData>,
25575    ) -> Self {
25576        self.inner.transfer_data = Some(transfer_data.into());
25577        self
25578    }
25579}
25580impl CapturePaymentIntent {
25581    /// Send the request and return the deserialized response.
25582    pub async fn send<C: StripeClient>(
25583        &self,
25584        client: &C,
25585    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
25586        self.customize().send(client).await
25587    }
25588
25589    /// Send the request and return the deserialized response, blocking until completion.
25590    pub fn send_blocking<C: StripeBlockingClient>(
25591        &self,
25592        client: &C,
25593    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
25594        self.customize().send_blocking(client)
25595    }
25596}
25597
25598impl StripeRequest for CapturePaymentIntent {
25599    type Output = stripe_shared::PaymentIntent;
25600
25601    fn build(&self) -> RequestBuilder {
25602        let intent = &self.intent;
25603        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/capture"))
25604            .form(&self.inner)
25605    }
25606}
25607#[derive(Clone, Debug, serde::Serialize)]
25608struct ConfirmPaymentIntentBuilder {
25609    #[serde(skip_serializing_if = "Option::is_none")]
25610    amount_details: Option<ConfirmPaymentIntentAmountDetails>,
25611    #[serde(skip_serializing_if = "Option::is_none")]
25612    capture_method: Option<stripe_shared::PaymentIntentCaptureMethod>,
25613    #[serde(skip_serializing_if = "Option::is_none")]
25614    confirmation_token: Option<String>,
25615    #[serde(skip_serializing_if = "Option::is_none")]
25616    error_on_requires_action: Option<bool>,
25617    #[serde(skip_serializing_if = "Option::is_none")]
25618    excluded_payment_method_types:
25619        Option<Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>>,
25620    #[serde(skip_serializing_if = "Option::is_none")]
25621    expand: Option<Vec<String>>,
25622    #[serde(skip_serializing_if = "Option::is_none")]
25623    hooks: Option<AsyncWorkflowsParam>,
25624    #[serde(skip_serializing_if = "Option::is_none")]
25625    mandate: Option<String>,
25626    #[serde(skip_serializing_if = "Option::is_none")]
25627    mandate_data: Option<ConfirmPaymentIntentMandateData>,
25628    #[serde(skip_serializing_if = "Option::is_none")]
25629    off_session: Option<ConfirmPaymentIntentOffSession>,
25630    #[serde(skip_serializing_if = "Option::is_none")]
25631    payment_details: Option<ConfirmPaymentIntentPaymentDetails>,
25632    #[serde(skip_serializing_if = "Option::is_none")]
25633    payment_method: Option<String>,
25634    #[serde(skip_serializing_if = "Option::is_none")]
25635    payment_method_data: Option<ConfirmPaymentIntentPaymentMethodData>,
25636    #[serde(skip_serializing_if = "Option::is_none")]
25637    payment_method_options: Option<ConfirmPaymentIntentPaymentMethodOptions>,
25638    #[serde(skip_serializing_if = "Option::is_none")]
25639    payment_method_types: Option<Vec<String>>,
25640    #[serde(skip_serializing_if = "Option::is_none")]
25641    radar_options: Option<ConfirmPaymentIntentRadarOptions>,
25642    #[serde(skip_serializing_if = "Option::is_none")]
25643    receipt_email: Option<String>,
25644    #[serde(skip_serializing_if = "Option::is_none")]
25645    return_url: Option<String>,
25646    #[serde(skip_serializing_if = "Option::is_none")]
25647    setup_future_usage: Option<stripe_shared::PaymentIntentSetupFutureUsage>,
25648    #[serde(skip_serializing_if = "Option::is_none")]
25649    shipping: Option<ConfirmPaymentIntentShipping>,
25650    #[serde(skip_serializing_if = "Option::is_none")]
25651    use_stripe_sdk: Option<bool>,
25652}
25653impl ConfirmPaymentIntentBuilder {
25654    fn new() -> Self {
25655        Self {
25656            amount_details: None,
25657            capture_method: None,
25658            confirmation_token: None,
25659            error_on_requires_action: None,
25660            excluded_payment_method_types: None,
25661            expand: None,
25662            hooks: None,
25663            mandate: None,
25664            mandate_data: None,
25665            off_session: None,
25666            payment_details: None,
25667            payment_method: None,
25668            payment_method_data: None,
25669            payment_method_options: None,
25670            payment_method_types: None,
25671            radar_options: None,
25672            receipt_email: None,
25673            return_url: None,
25674            setup_future_usage: None,
25675            shipping: None,
25676            use_stripe_sdk: None,
25677        }
25678    }
25679}
25680/// Provides industry-specific information about the amount.
25681#[derive(Clone, Debug, serde::Serialize)]
25682pub struct ConfirmPaymentIntentAmountDetails {
25683    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25684    /// An integer greater than 0.
25685    ///
25686    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
25687    #[serde(skip_serializing_if = "Option::is_none")]
25688    pub discount_amount: Option<i64>,
25689    /// A list of line items, each containing information about a product in the PaymentIntent.
25690    /// There is a maximum of 100 line items.
25691    #[serde(skip_serializing_if = "Option::is_none")]
25692    pub line_items: Option<Vec<ConfirmPaymentIntentAmountDetailsLineItems>>,
25693    /// Contains information about the shipping portion of the amount.
25694    #[serde(skip_serializing_if = "Option::is_none")]
25695    pub shipping: Option<AmountDetailsShippingParam>,
25696    /// Contains information about the tax portion of the amount.
25697    #[serde(skip_serializing_if = "Option::is_none")]
25698    pub tax: Option<AmountDetailsTaxParam>,
25699}
25700impl ConfirmPaymentIntentAmountDetails {
25701    pub fn new() -> Self {
25702        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
25703    }
25704}
25705impl Default for ConfirmPaymentIntentAmountDetails {
25706    fn default() -> Self {
25707        Self::new()
25708    }
25709}
25710/// A list of line items, each containing information about a product in the PaymentIntent.
25711/// There is a maximum of 100 line items.
25712#[derive(Clone, Debug, serde::Serialize)]
25713pub struct ConfirmPaymentIntentAmountDetailsLineItems {
25714    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25715    /// An integer greater than 0.
25716    ///
25717    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
25718    #[serde(skip_serializing_if = "Option::is_none")]
25719    pub discount_amount: Option<i64>,
25720    /// Payment method-specific information for line items.
25721    #[serde(skip_serializing_if = "Option::is_none")]
25722    pub payment_method_options:
25723        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
25724    /// The product code of the line item, such as an SKU.
25725    /// Required for L3 rates.
25726    /// At most 12 characters long.
25727    #[serde(skip_serializing_if = "Option::is_none")]
25728    pub product_code: Option<String>,
25729    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
25730    ///
25731    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
25732    /// For Paypal, this field is truncated to 127 characters.
25733    pub product_name: String,
25734    /// The quantity of items. Required for L3 rates. An integer greater than 0.
25735    pub quantity: u64,
25736    /// Contains information about the tax on the item.
25737    #[serde(skip_serializing_if = "Option::is_none")]
25738    pub tax: Option<AmountDetailsLineItemTaxParam>,
25739    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25740    /// Required for L3 rates.
25741    /// An integer greater than or equal to 0.
25742    pub unit_cost: i64,
25743    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
25744    #[serde(skip_serializing_if = "Option::is_none")]
25745    pub unit_of_measure: Option<String>,
25746}
25747impl ConfirmPaymentIntentAmountDetailsLineItems {
25748    pub fn new(
25749        product_name: impl Into<String>,
25750        quantity: impl Into<u64>,
25751        unit_cost: impl Into<i64>,
25752    ) -> Self {
25753        Self {
25754            discount_amount: None,
25755            payment_method_options: None,
25756            product_code: None,
25757            product_name: product_name.into(),
25758            quantity: quantity.into(),
25759            tax: None,
25760            unit_cost: unit_cost.into(),
25761            unit_of_measure: None,
25762        }
25763    }
25764}
25765/// Payment method-specific information for line items.
25766#[derive(Clone, Debug, serde::Serialize)]
25767pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
25768    /// This sub-hash contains line item details that are specific to `card` payment method."
25769    #[serde(skip_serializing_if = "Option::is_none")]
25770    pub card: Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
25771    /// This sub-hash contains line item details that are specific to `card_present` payment method."
25772    #[serde(skip_serializing_if = "Option::is_none")]
25773    pub card_present:
25774        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent>,
25775    /// This sub-hash contains line item details that are specific to `klarna` payment method."
25776    #[serde(skip_serializing_if = "Option::is_none")]
25777    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
25778    /// This sub-hash contains line item details that are specific to `paypal` payment method."
25779    #[serde(skip_serializing_if = "Option::is_none")]
25780    pub paypal: Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
25781}
25782impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
25783    pub fn new() -> Self {
25784        Self { card: None, card_present: None, klarna: None, paypal: None }
25785    }
25786}
25787impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
25788    fn default() -> Self {
25789        Self::new()
25790    }
25791}
25792/// This sub-hash contains line item details that are specific to `card` payment method."
25793#[derive(Clone, Debug, serde::Serialize)]
25794pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
25795    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
25796    #[serde(skip_serializing_if = "Option::is_none")]
25797    pub commodity_code: Option<String>,
25798}
25799impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
25800    pub fn new() -> Self {
25801        Self { commodity_code: None }
25802    }
25803}
25804impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
25805    fn default() -> Self {
25806        Self::new()
25807    }
25808}
25809/// This sub-hash contains line item details that are specific to `card_present` payment method."
25810#[derive(Clone, Debug, serde::Serialize)]
25811pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
25812    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
25813    #[serde(skip_serializing_if = "Option::is_none")]
25814    pub commodity_code: Option<String>,
25815}
25816impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
25817    pub fn new() -> Self {
25818        Self { commodity_code: None }
25819    }
25820}
25821impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
25822    fn default() -> Self {
25823        Self::new()
25824    }
25825}
25826/// This sub-hash contains line item details that are specific to `paypal` payment method."
25827#[derive(Clone, Debug, serde::Serialize)]
25828pub struct ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
25829    /// Type of the line item.
25830    #[serde(skip_serializing_if = "Option::is_none")]
25831    pub category:
25832        Option<ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory>,
25833    /// Description of the line item.
25834    #[serde(skip_serializing_if = "Option::is_none")]
25835    pub description: Option<String>,
25836    /// The Stripe account ID of the connected account that sells the item.
25837    #[serde(skip_serializing_if = "Option::is_none")]
25838    pub sold_by: Option<String>,
25839}
25840impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
25841    pub fn new() -> Self {
25842        Self { category: None, description: None, sold_by: None }
25843    }
25844}
25845impl Default for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
25846    fn default() -> Self {
25847        Self::new()
25848    }
25849}
25850/// Type of the line item.
25851#[derive(Clone, Eq, PartialEq)]
25852#[non_exhaustive]
25853pub enum ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
25854    DigitalGoods,
25855    Donation,
25856    PhysicalGoods,
25857    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25858    Unknown(String),
25859}
25860impl ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
25861    pub fn as_str(&self) -> &str {
25862        use ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
25863        match self {
25864            DigitalGoods => "digital_goods",
25865            Donation => "donation",
25866            PhysicalGoods => "physical_goods",
25867            Unknown(v) => v,
25868        }
25869    }
25870}
25871
25872impl std::str::FromStr
25873    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25874{
25875    type Err = std::convert::Infallible;
25876    fn from_str(s: &str) -> Result<Self, Self::Err> {
25877        use ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
25878        match s {
25879            "digital_goods" => Ok(DigitalGoods),
25880            "donation" => Ok(Donation),
25881            "physical_goods" => Ok(PhysicalGoods),
25882            v => {
25883                tracing::warn!(
25884                    "Unknown value '{}' for enum '{}'",
25885                    v,
25886                    "ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"
25887                );
25888                Ok(Unknown(v.to_owned()))
25889            }
25890        }
25891    }
25892}
25893impl std::fmt::Display
25894    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25895{
25896    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25897        f.write_str(self.as_str())
25898    }
25899}
25900
25901impl std::fmt::Debug
25902    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25903{
25904    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25905        f.write_str(self.as_str())
25906    }
25907}
25908impl serde::Serialize
25909    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25910{
25911    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25912    where
25913        S: serde::Serializer,
25914    {
25915        serializer.serialize_str(self.as_str())
25916    }
25917}
25918#[cfg(feature = "deserialize")]
25919impl<'de> serde::Deserialize<'de>
25920    for ConfirmPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
25921{
25922    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
25923        use std::str::FromStr;
25924        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
25925        Ok(Self::from_str(&s).expect("infallible"))
25926    }
25927}
25928#[derive(Clone, Debug, serde::Serialize)]
25929#[serde(rename_all = "snake_case")]
25930pub enum ConfirmPaymentIntentMandateData {
25931    #[serde(untagged)]
25932    SecretKeyParam(ConfirmPaymentIntentSecretKeyParam),
25933    #[serde(untagged)]
25934    ClientKeyParam(ConfirmPaymentIntentClientKeyParam),
25935}
25936#[derive(Clone, Debug, serde::Serialize)]
25937pub struct ConfirmPaymentIntentSecretKeyParam {
25938    /// This hash contains details about the customer acceptance of the Mandate.
25939    pub customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance,
25940}
25941impl ConfirmPaymentIntentSecretKeyParam {
25942    pub fn new(
25943        customer_acceptance: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptance>,
25944    ) -> Self {
25945        Self { customer_acceptance: customer_acceptance.into() }
25946    }
25947}
25948/// This hash contains details about the customer acceptance of the Mandate.
25949#[derive(Clone, Debug, serde::Serialize)]
25950pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
25951    /// The time at which the customer accepted the Mandate.
25952    #[serde(skip_serializing_if = "Option::is_none")]
25953    pub accepted_at: Option<stripe_types::Timestamp>,
25954    /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
25955    #[serde(skip_serializing_if = "Option::is_none")]
25956    #[serde(with = "stripe_types::with_serde_json_opt")]
25957    pub offline: Option<miniserde::json::Value>,
25958    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
25959    #[serde(skip_serializing_if = "Option::is_none")]
25960    pub online: Option<OnlineParam>,
25961    /// The type of customer acceptance information included with the Mandate.
25962    /// One of `online` or `offline`.
25963    #[serde(rename = "type")]
25964    pub type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType,
25965}
25966impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptance {
25967    pub fn new(type_: impl Into<ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
25968        Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
25969    }
25970}
25971/// The type of customer acceptance information included with the Mandate.
25972/// One of `online` or `offline`.
25973#[derive(Clone, Eq, PartialEq)]
25974#[non_exhaustive]
25975pub enum ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
25976    Offline,
25977    Online,
25978    /// An unrecognized value from Stripe. Should not be used as a request parameter.
25979    Unknown(String),
25980}
25981impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
25982    pub fn as_str(&self) -> &str {
25983        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
25984        match self {
25985            Offline => "offline",
25986            Online => "online",
25987            Unknown(v) => v,
25988        }
25989    }
25990}
25991
25992impl std::str::FromStr for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
25993    type Err = std::convert::Infallible;
25994    fn from_str(s: &str) -> Result<Self, Self::Err> {
25995        use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*;
25996        match s {
25997            "offline" => Ok(Offline),
25998            "online" => Ok(Online),
25999            v => {
26000                tracing::warn!(
26001                    "Unknown value '{}' for enum '{}'",
26002                    v,
26003                    "ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType"
26004                );
26005                Ok(Unknown(v.to_owned()))
26006            }
26007        }
26008    }
26009}
26010impl std::fmt::Display for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
26011    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26012        f.write_str(self.as_str())
26013    }
26014}
26015
26016impl std::fmt::Debug for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
26017    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26018        f.write_str(self.as_str())
26019    }
26020}
26021impl serde::Serialize for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
26022    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26023    where
26024        S: serde::Serializer,
26025    {
26026        serializer.serialize_str(self.as_str())
26027    }
26028}
26029#[cfg(feature = "deserialize")]
26030impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType {
26031    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26032        use std::str::FromStr;
26033        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26034        Ok(Self::from_str(&s).expect("infallible"))
26035    }
26036}
26037#[derive(Clone, Debug, serde::Serialize)]
26038pub struct ConfirmPaymentIntentClientKeyParam {
26039    /// This hash contains details about the customer acceptance of the Mandate.
26040    pub customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance,
26041}
26042impl ConfirmPaymentIntentClientKeyParam {
26043    pub fn new(
26044        customer_acceptance: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptance>,
26045    ) -> Self {
26046        Self { customer_acceptance: customer_acceptance.into() }
26047    }
26048}
26049/// This hash contains details about the customer acceptance of the Mandate.
26050#[derive(Clone, Debug, serde::Serialize)]
26051pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
26052    /// If this is a Mandate accepted online, this hash contains details about the online acceptance.
26053    pub online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline,
26054    /// The type of customer acceptance information included with the Mandate.
26055    #[serde(rename = "type")]
26056    pub type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType,
26057}
26058impl ConfirmPaymentIntentClientKeyParamCustomerAcceptance {
26059    pub fn new(
26060        online: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline>,
26061        type_: impl Into<ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType>,
26062    ) -> Self {
26063        Self { online: online.into(), type_: type_.into() }
26064    }
26065}
26066/// If this is a Mandate accepted online, this hash contains details about the online acceptance.
26067#[derive(Clone, Debug, serde::Serialize)]
26068pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
26069    /// The IP address from which the Mandate was accepted by the customer.
26070    #[serde(skip_serializing_if = "Option::is_none")]
26071    pub ip_address: Option<String>,
26072    /// The user agent of the browser from which the Mandate was accepted by the customer.
26073    #[serde(skip_serializing_if = "Option::is_none")]
26074    pub user_agent: Option<String>,
26075}
26076impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
26077    pub fn new() -> Self {
26078        Self { ip_address: None, user_agent: None }
26079    }
26080}
26081impl Default for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline {
26082    fn default() -> Self {
26083        Self::new()
26084    }
26085}
26086/// The type of customer acceptance information included with the Mandate.
26087#[derive(Clone, Eq, PartialEq)]
26088#[non_exhaustive]
26089pub enum ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26090    Online,
26091    /// An unrecognized value from Stripe. Should not be used as a request parameter.
26092    Unknown(String),
26093}
26094impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26095    pub fn as_str(&self) -> &str {
26096        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
26097        match self {
26098            Online => "online",
26099            Unknown(v) => v,
26100        }
26101    }
26102}
26103
26104impl std::str::FromStr for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26105    type Err = std::convert::Infallible;
26106    fn from_str(s: &str) -> Result<Self, Self::Err> {
26107        use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*;
26108        match s {
26109            "online" => Ok(Online),
26110            v => {
26111                tracing::warn!(
26112                    "Unknown value '{}' for enum '{}'",
26113                    v,
26114                    "ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType"
26115                );
26116                Ok(Unknown(v.to_owned()))
26117            }
26118        }
26119    }
26120}
26121impl std::fmt::Display for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26122    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26123        f.write_str(self.as_str())
26124    }
26125}
26126
26127impl std::fmt::Debug for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26129        f.write_str(self.as_str())
26130    }
26131}
26132impl serde::Serialize for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26133    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26134    where
26135        S: serde::Serializer,
26136    {
26137        serializer.serialize_str(self.as_str())
26138    }
26139}
26140#[cfg(feature = "deserialize")]
26141impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType {
26142    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26143        use std::str::FromStr;
26144        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26145        Ok(Self::from_str(&s).expect("infallible"))
26146    }
26147}
26148/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
26149/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
26150#[derive(Copy, Clone, Debug, serde::Serialize)]
26151#[serde(rename_all = "snake_case")]
26152pub enum ConfirmPaymentIntentOffSession {
26153    OneOff,
26154    Recurring,
26155    #[serde(untagged)]
26156    Bool(bool),
26157}
26158/// Provides industry-specific information about the charge.
26159#[derive(Clone, Debug, serde::Serialize)]
26160pub struct ConfirmPaymentIntentPaymentDetails {
26161    /// A unique value to identify the customer. This field is available only for card payments.
26162    ///
26163    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
26164    #[serde(skip_serializing_if = "Option::is_none")]
26165    pub customer_reference: Option<String>,
26166    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
26167    ///
26168    /// 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`.
26169    ///
26170    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
26171    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
26172    #[serde(skip_serializing_if = "Option::is_none")]
26173    pub order_reference: Option<String>,
26174}
26175impl ConfirmPaymentIntentPaymentDetails {
26176    pub fn new() -> Self {
26177        Self { customer_reference: None, order_reference: None }
26178    }
26179}
26180impl Default for ConfirmPaymentIntentPaymentDetails {
26181    fn default() -> Self {
26182        Self::new()
26183    }
26184}
26185/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
26186/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
26187/// property on the PaymentIntent.
26188#[derive(Clone, Debug, serde::Serialize)]
26189pub struct ConfirmPaymentIntentPaymentMethodData {
26190    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
26191    #[serde(skip_serializing_if = "Option::is_none")]
26192    pub acss_debit: Option<PaymentMethodParam>,
26193    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
26194    #[serde(skip_serializing_if = "Option::is_none")]
26195    #[serde(with = "stripe_types::with_serde_json_opt")]
26196    pub affirm: Option<miniserde::json::Value>,
26197    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
26198    #[serde(skip_serializing_if = "Option::is_none")]
26199    #[serde(with = "stripe_types::with_serde_json_opt")]
26200    pub afterpay_clearpay: Option<miniserde::json::Value>,
26201    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
26202    #[serde(skip_serializing_if = "Option::is_none")]
26203    #[serde(with = "stripe_types::with_serde_json_opt")]
26204    pub alipay: Option<miniserde::json::Value>,
26205    /// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
26206    /// 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.
26207    /// The field defaults to `unspecified`.
26208    #[serde(skip_serializing_if = "Option::is_none")]
26209    pub allow_redisplay: Option<ConfirmPaymentIntentPaymentMethodDataAllowRedisplay>,
26210    /// If this is a Alma PaymentMethod, this hash contains details about the Alma payment method.
26211    #[serde(skip_serializing_if = "Option::is_none")]
26212    #[serde(with = "stripe_types::with_serde_json_opt")]
26213    pub alma: Option<miniserde::json::Value>,
26214    /// If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method.
26215    #[serde(skip_serializing_if = "Option::is_none")]
26216    #[serde(with = "stripe_types::with_serde_json_opt")]
26217    pub amazon_pay: Option<miniserde::json::Value>,
26218    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
26219    #[serde(skip_serializing_if = "Option::is_none")]
26220    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodDataAuBecsDebit>,
26221    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
26222    #[serde(skip_serializing_if = "Option::is_none")]
26223    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodDataBacsDebit>,
26224    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
26225    #[serde(skip_serializing_if = "Option::is_none")]
26226    #[serde(with = "stripe_types::with_serde_json_opt")]
26227    pub bancontact: Option<miniserde::json::Value>,
26228    /// If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
26229    #[serde(skip_serializing_if = "Option::is_none")]
26230    #[serde(with = "stripe_types::with_serde_json_opt")]
26231    pub billie: Option<miniserde::json::Value>,
26232    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
26233    #[serde(skip_serializing_if = "Option::is_none")]
26234    pub billing_details: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetails>,
26235    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
26236    #[serde(skip_serializing_if = "Option::is_none")]
26237    #[serde(with = "stripe_types::with_serde_json_opt")]
26238    pub blik: Option<miniserde::json::Value>,
26239    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
26240    #[serde(skip_serializing_if = "Option::is_none")]
26241    pub boleto: Option<ConfirmPaymentIntentPaymentMethodDataBoleto>,
26242    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
26243    #[serde(skip_serializing_if = "Option::is_none")]
26244    #[serde(with = "stripe_types::with_serde_json_opt")]
26245    pub cashapp: Option<miniserde::json::Value>,
26246    /// If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
26247    #[serde(skip_serializing_if = "Option::is_none")]
26248    #[serde(with = "stripe_types::with_serde_json_opt")]
26249    pub crypto: Option<miniserde::json::Value>,
26250    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
26251    #[serde(skip_serializing_if = "Option::is_none")]
26252    #[serde(with = "stripe_types::with_serde_json_opt")]
26253    pub customer_balance: Option<miniserde::json::Value>,
26254    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
26255    #[serde(skip_serializing_if = "Option::is_none")]
26256    pub eps: Option<ConfirmPaymentIntentPaymentMethodDataEps>,
26257    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
26258    #[serde(skip_serializing_if = "Option::is_none")]
26259    pub fpx: Option<ConfirmPaymentIntentPaymentMethodDataFpx>,
26260    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
26261    #[serde(skip_serializing_if = "Option::is_none")]
26262    #[serde(with = "stripe_types::with_serde_json_opt")]
26263    pub giropay: Option<miniserde::json::Value>,
26264    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
26265    #[serde(skip_serializing_if = "Option::is_none")]
26266    #[serde(with = "stripe_types::with_serde_json_opt")]
26267    pub grabpay: Option<miniserde::json::Value>,
26268    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
26269    #[serde(skip_serializing_if = "Option::is_none")]
26270    pub ideal: Option<ConfirmPaymentIntentPaymentMethodDataIdeal>,
26271    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
26272    #[serde(skip_serializing_if = "Option::is_none")]
26273    #[serde(with = "stripe_types::with_serde_json_opt")]
26274    pub interac_present: Option<miniserde::json::Value>,
26275    /// If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method.
26276    #[serde(skip_serializing_if = "Option::is_none")]
26277    #[serde(with = "stripe_types::with_serde_json_opt")]
26278    pub kakao_pay: Option<miniserde::json::Value>,
26279    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
26280    #[serde(skip_serializing_if = "Option::is_none")]
26281    pub klarna: Option<ConfirmPaymentIntentPaymentMethodDataKlarna>,
26282    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
26283    #[serde(skip_serializing_if = "Option::is_none")]
26284    #[serde(with = "stripe_types::with_serde_json_opt")]
26285    pub konbini: Option<miniserde::json::Value>,
26286    /// If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method.
26287    #[serde(skip_serializing_if = "Option::is_none")]
26288    #[serde(with = "stripe_types::with_serde_json_opt")]
26289    pub kr_card: Option<miniserde::json::Value>,
26290    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
26291    #[serde(skip_serializing_if = "Option::is_none")]
26292    #[serde(with = "stripe_types::with_serde_json_opt")]
26293    pub link: Option<miniserde::json::Value>,
26294    /// If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
26295    #[serde(skip_serializing_if = "Option::is_none")]
26296    #[serde(with = "stripe_types::with_serde_json_opt")]
26297    pub mb_way: Option<miniserde::json::Value>,
26298    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
26299    /// This can be useful for storing additional information about the object in a structured format.
26300    /// Individual keys can be unset by posting an empty value to them.
26301    /// All keys can be unset by posting an empty value to `metadata`.
26302    #[serde(skip_serializing_if = "Option::is_none")]
26303    pub metadata: Option<std::collections::HashMap<String, String>>,
26304    /// If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
26305    #[serde(skip_serializing_if = "Option::is_none")]
26306    #[serde(with = "stripe_types::with_serde_json_opt")]
26307    pub mobilepay: Option<miniserde::json::Value>,
26308    /// If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method.
26309    #[serde(skip_serializing_if = "Option::is_none")]
26310    #[serde(with = "stripe_types::with_serde_json_opt")]
26311    pub multibanco: Option<miniserde::json::Value>,
26312    /// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
26313    #[serde(skip_serializing_if = "Option::is_none")]
26314    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodDataNaverPay>,
26315    /// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
26316    #[serde(skip_serializing_if = "Option::is_none")]
26317    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataNzBankAccount>,
26318    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
26319    #[serde(skip_serializing_if = "Option::is_none")]
26320    #[serde(with = "stripe_types::with_serde_json_opt")]
26321    pub oxxo: Option<miniserde::json::Value>,
26322    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
26323    #[serde(skip_serializing_if = "Option::is_none")]
26324    pub p24: Option<ConfirmPaymentIntentPaymentMethodDataP24>,
26325    /// If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method.
26326    #[serde(skip_serializing_if = "Option::is_none")]
26327    #[serde(with = "stripe_types::with_serde_json_opt")]
26328    pub pay_by_bank: Option<miniserde::json::Value>,
26329    /// If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method.
26330    #[serde(skip_serializing_if = "Option::is_none")]
26331    #[serde(with = "stripe_types::with_serde_json_opt")]
26332    pub payco: Option<miniserde::json::Value>,
26333    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
26334    #[serde(skip_serializing_if = "Option::is_none")]
26335    #[serde(with = "stripe_types::with_serde_json_opt")]
26336    pub paynow: Option<miniserde::json::Value>,
26337    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
26338    #[serde(skip_serializing_if = "Option::is_none")]
26339    #[serde(with = "stripe_types::with_serde_json_opt")]
26340    pub paypal: Option<miniserde::json::Value>,
26341    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
26342    #[serde(skip_serializing_if = "Option::is_none")]
26343    #[serde(with = "stripe_types::with_serde_json_opt")]
26344    pub pix: Option<miniserde::json::Value>,
26345    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
26346    #[serde(skip_serializing_if = "Option::is_none")]
26347    #[serde(with = "stripe_types::with_serde_json_opt")]
26348    pub promptpay: Option<miniserde::json::Value>,
26349    /// Options to configure Radar.
26350    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
26351    #[serde(skip_serializing_if = "Option::is_none")]
26352    pub radar_options: Option<ConfirmPaymentIntentPaymentMethodDataRadarOptions>,
26353    /// If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
26354    #[serde(skip_serializing_if = "Option::is_none")]
26355    #[serde(with = "stripe_types::with_serde_json_opt")]
26356    pub revolut_pay: Option<miniserde::json::Value>,
26357    /// If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
26358    #[serde(skip_serializing_if = "Option::is_none")]
26359    #[serde(with = "stripe_types::with_serde_json_opt")]
26360    pub samsung_pay: Option<miniserde::json::Value>,
26361    /// If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
26362    #[serde(skip_serializing_if = "Option::is_none")]
26363    #[serde(with = "stripe_types::with_serde_json_opt")]
26364    pub satispay: Option<miniserde::json::Value>,
26365    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
26366    #[serde(skip_serializing_if = "Option::is_none")]
26367    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodDataSepaDebit>,
26368    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
26369    #[serde(skip_serializing_if = "Option::is_none")]
26370    pub sofort: Option<ConfirmPaymentIntentPaymentMethodDataSofort>,
26371    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
26372    #[serde(skip_serializing_if = "Option::is_none")]
26373    #[serde(with = "stripe_types::with_serde_json_opt")]
26374    pub swish: Option<miniserde::json::Value>,
26375    /// If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method.
26376    #[serde(skip_serializing_if = "Option::is_none")]
26377    #[serde(with = "stripe_types::with_serde_json_opt")]
26378    pub twint: Option<miniserde::json::Value>,
26379    /// The type of the PaymentMethod.
26380    /// An additional hash is included on the PaymentMethod with a name matching this value.
26381    /// It contains additional information specific to the PaymentMethod type.
26382    #[serde(rename = "type")]
26383    pub type_: ConfirmPaymentIntentPaymentMethodDataType,
26384    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
26385    #[serde(skip_serializing_if = "Option::is_none")]
26386    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccount>,
26387    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
26388    #[serde(skip_serializing_if = "Option::is_none")]
26389    #[serde(with = "stripe_types::with_serde_json_opt")]
26390    pub wechat_pay: Option<miniserde::json::Value>,
26391    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
26392    #[serde(skip_serializing_if = "Option::is_none")]
26393    #[serde(with = "stripe_types::with_serde_json_opt")]
26394    pub zip: Option<miniserde::json::Value>,
26395}
26396impl ConfirmPaymentIntentPaymentMethodData {
26397    pub fn new(type_: impl Into<ConfirmPaymentIntentPaymentMethodDataType>) -> Self {
26398        Self {
26399            acss_debit: None,
26400            affirm: None,
26401            afterpay_clearpay: None,
26402            alipay: None,
26403            allow_redisplay: None,
26404            alma: None,
26405            amazon_pay: None,
26406            au_becs_debit: None,
26407            bacs_debit: None,
26408            bancontact: None,
26409            billie: None,
26410            billing_details: None,
26411            blik: None,
26412            boleto: None,
26413            cashapp: None,
26414            crypto: None,
26415            customer_balance: None,
26416            eps: None,
26417            fpx: None,
26418            giropay: None,
26419            grabpay: None,
26420            ideal: None,
26421            interac_present: None,
26422            kakao_pay: None,
26423            klarna: None,
26424            konbini: None,
26425            kr_card: None,
26426            link: None,
26427            mb_way: None,
26428            metadata: None,
26429            mobilepay: None,
26430            multibanco: None,
26431            naver_pay: None,
26432            nz_bank_account: None,
26433            oxxo: None,
26434            p24: None,
26435            pay_by_bank: None,
26436            payco: None,
26437            paynow: None,
26438            paypal: None,
26439            pix: None,
26440            promptpay: None,
26441            radar_options: None,
26442            revolut_pay: None,
26443            samsung_pay: None,
26444            satispay: None,
26445            sepa_debit: None,
26446            sofort: None,
26447            swish: None,
26448            twint: None,
26449            type_: type_.into(),
26450            us_bank_account: None,
26451            wechat_pay: None,
26452            zip: None,
26453        }
26454    }
26455}
26456/// This field indicates whether this payment method can be shown again to its customer in a checkout flow.
26457/// 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.
26458/// The field defaults to `unspecified`.
26459#[derive(Clone, Eq, PartialEq)]
26460#[non_exhaustive]
26461pub enum ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26462    Always,
26463    Limited,
26464    Unspecified,
26465    /// An unrecognized value from Stripe. Should not be used as a request parameter.
26466    Unknown(String),
26467}
26468impl ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26469    pub fn as_str(&self) -> &str {
26470        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
26471        match self {
26472            Always => "always",
26473            Limited => "limited",
26474            Unspecified => "unspecified",
26475            Unknown(v) => v,
26476        }
26477    }
26478}
26479
26480impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26481    type Err = std::convert::Infallible;
26482    fn from_str(s: &str) -> Result<Self, Self::Err> {
26483        use ConfirmPaymentIntentPaymentMethodDataAllowRedisplay::*;
26484        match s {
26485            "always" => Ok(Always),
26486            "limited" => Ok(Limited),
26487            "unspecified" => Ok(Unspecified),
26488            v => {
26489                tracing::warn!(
26490                    "Unknown value '{}' for enum '{}'",
26491                    v,
26492                    "ConfirmPaymentIntentPaymentMethodDataAllowRedisplay"
26493                );
26494                Ok(Unknown(v.to_owned()))
26495            }
26496        }
26497    }
26498}
26499impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26500    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26501        f.write_str(self.as_str())
26502    }
26503}
26504
26505impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26506    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26507        f.write_str(self.as_str())
26508    }
26509}
26510impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26511    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26512    where
26513        S: serde::Serializer,
26514    {
26515        serializer.serialize_str(self.as_str())
26516    }
26517}
26518#[cfg(feature = "deserialize")]
26519impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataAllowRedisplay {
26520    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26521        use std::str::FromStr;
26522        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26523        Ok(Self::from_str(&s).expect("infallible"))
26524    }
26525}
26526/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
26527#[derive(Clone, Debug, serde::Serialize)]
26528pub struct ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
26529    /// The account number for the bank account.
26530    pub account_number: String,
26531    /// Bank-State-Branch number of the bank account.
26532    pub bsb_number: String,
26533}
26534impl ConfirmPaymentIntentPaymentMethodDataAuBecsDebit {
26535    pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
26536        Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
26537    }
26538}
26539/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
26540#[derive(Clone, Debug, serde::Serialize)]
26541pub struct ConfirmPaymentIntentPaymentMethodDataBacsDebit {
26542    /// Account number of the bank account that the funds will be debited from.
26543    #[serde(skip_serializing_if = "Option::is_none")]
26544    pub account_number: Option<String>,
26545    /// Sort code of the bank account. (e.g., `10-20-30`)
26546    #[serde(skip_serializing_if = "Option::is_none")]
26547    pub sort_code: Option<String>,
26548}
26549impl ConfirmPaymentIntentPaymentMethodDataBacsDebit {
26550    pub fn new() -> Self {
26551        Self { account_number: None, sort_code: None }
26552    }
26553}
26554impl Default for ConfirmPaymentIntentPaymentMethodDataBacsDebit {
26555    fn default() -> Self {
26556        Self::new()
26557    }
26558}
26559/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
26560#[derive(Clone, Debug, serde::Serialize)]
26561pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetails {
26562    /// Billing address.
26563    #[serde(skip_serializing_if = "Option::is_none")]
26564    pub address: Option<ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress>,
26565    /// Email address.
26566    #[serde(skip_serializing_if = "Option::is_none")]
26567    pub email: Option<String>,
26568    /// Full name.
26569    #[serde(skip_serializing_if = "Option::is_none")]
26570    pub name: Option<String>,
26571    /// Billing phone number (including extension).
26572    #[serde(skip_serializing_if = "Option::is_none")]
26573    pub phone: Option<String>,
26574    /// Taxpayer identification number.
26575    /// Used only for transactions between LATAM buyers and non-LATAM sellers.
26576    #[serde(skip_serializing_if = "Option::is_none")]
26577    pub tax_id: Option<String>,
26578}
26579impl ConfirmPaymentIntentPaymentMethodDataBillingDetails {
26580    pub fn new() -> Self {
26581        Self { address: None, email: None, name: None, phone: None, tax_id: None }
26582    }
26583}
26584impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetails {
26585    fn default() -> Self {
26586        Self::new()
26587    }
26588}
26589/// Billing address.
26590#[derive(Clone, Debug, serde::Serialize)]
26591pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
26592    /// City, district, suburb, town, or village.
26593    #[serde(skip_serializing_if = "Option::is_none")]
26594    pub city: Option<String>,
26595    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
26596    #[serde(skip_serializing_if = "Option::is_none")]
26597    pub country: Option<String>,
26598    /// Address line 1, such as the street, PO Box, or company name.
26599    #[serde(skip_serializing_if = "Option::is_none")]
26600    pub line1: Option<String>,
26601    /// Address line 2, such as the apartment, suite, unit, or building.
26602    #[serde(skip_serializing_if = "Option::is_none")]
26603    pub line2: Option<String>,
26604    /// ZIP or postal code.
26605    #[serde(skip_serializing_if = "Option::is_none")]
26606    pub postal_code: Option<String>,
26607    /// State, county, province, or region.
26608    #[serde(skip_serializing_if = "Option::is_none")]
26609    pub state: Option<String>,
26610}
26611impl ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
26612    pub fn new() -> Self {
26613        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
26614    }
26615}
26616impl Default for ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress {
26617    fn default() -> Self {
26618        Self::new()
26619    }
26620}
26621/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
26622#[derive(Clone, Debug, serde::Serialize)]
26623pub struct ConfirmPaymentIntentPaymentMethodDataBoleto {
26624    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
26625    pub tax_id: String,
26626}
26627impl ConfirmPaymentIntentPaymentMethodDataBoleto {
26628    pub fn new(tax_id: impl Into<String>) -> Self {
26629        Self { tax_id: tax_id.into() }
26630    }
26631}
26632/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
26633#[derive(Clone, Debug, serde::Serialize)]
26634pub struct ConfirmPaymentIntentPaymentMethodDataEps {
26635    /// The customer's bank.
26636    #[serde(skip_serializing_if = "Option::is_none")]
26637    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataEpsBank>,
26638}
26639impl ConfirmPaymentIntentPaymentMethodDataEps {
26640    pub fn new() -> Self {
26641        Self { bank: None }
26642    }
26643}
26644impl Default for ConfirmPaymentIntentPaymentMethodDataEps {
26645    fn default() -> Self {
26646        Self::new()
26647    }
26648}
26649/// The customer's bank.
26650#[derive(Clone, Eq, PartialEq)]
26651#[non_exhaustive]
26652pub enum ConfirmPaymentIntentPaymentMethodDataEpsBank {
26653    ArzteUndApothekerBank,
26654    AustrianAnadiBankAg,
26655    BankAustria,
26656    BankhausCarlSpangler,
26657    BankhausSchelhammerUndSchatteraAg,
26658    BawagPskAg,
26659    BksBankAg,
26660    BrullKallmusBankAg,
26661    BtvVierLanderBank,
26662    CapitalBankGraweGruppeAg,
26663    DeutscheBankAg,
26664    Dolomitenbank,
26665    EasybankAg,
26666    ErsteBankUndSparkassen,
26667    HypoAlpeadriabankInternationalAg,
26668    HypoBankBurgenlandAktiengesellschaft,
26669    HypoNoeLbFurNiederosterreichUWien,
26670    HypoOberosterreichSalzburgSteiermark,
26671    HypoTirolBankAg,
26672    HypoVorarlbergBankAg,
26673    MarchfelderBank,
26674    OberbankAg,
26675    RaiffeisenBankengruppeOsterreich,
26676    SchoellerbankAg,
26677    SpardaBankWien,
26678    VolksbankGruppe,
26679    VolkskreditbankAg,
26680    VrBankBraunau,
26681    /// An unrecognized value from Stripe. Should not be used as a request parameter.
26682    Unknown(String),
26683}
26684impl ConfirmPaymentIntentPaymentMethodDataEpsBank {
26685    pub fn as_str(&self) -> &str {
26686        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
26687        match self {
26688            ArzteUndApothekerBank => "arzte_und_apotheker_bank",
26689            AustrianAnadiBankAg => "austrian_anadi_bank_ag",
26690            BankAustria => "bank_austria",
26691            BankhausCarlSpangler => "bankhaus_carl_spangler",
26692            BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag",
26693            BawagPskAg => "bawag_psk_ag",
26694            BksBankAg => "bks_bank_ag",
26695            BrullKallmusBankAg => "brull_kallmus_bank_ag",
26696            BtvVierLanderBank => "btv_vier_lander_bank",
26697            CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
26698            DeutscheBankAg => "deutsche_bank_ag",
26699            Dolomitenbank => "dolomitenbank",
26700            EasybankAg => "easybank_ag",
26701            ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
26702            HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag",
26703            HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft",
26704            HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien",
26705            HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark",
26706            HypoTirolBankAg => "hypo_tirol_bank_ag",
26707            HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
26708            MarchfelderBank => "marchfelder_bank",
26709            OberbankAg => "oberbank_ag",
26710            RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich",
26711            SchoellerbankAg => "schoellerbank_ag",
26712            SpardaBankWien => "sparda_bank_wien",
26713            VolksbankGruppe => "volksbank_gruppe",
26714            VolkskreditbankAg => "volkskreditbank_ag",
26715            VrBankBraunau => "vr_bank_braunau",
26716            Unknown(v) => v,
26717        }
26718    }
26719}
26720
26721impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataEpsBank {
26722    type Err = std::convert::Infallible;
26723    fn from_str(s: &str) -> Result<Self, Self::Err> {
26724        use ConfirmPaymentIntentPaymentMethodDataEpsBank::*;
26725        match s {
26726            "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank),
26727            "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg),
26728            "bank_austria" => Ok(BankAustria),
26729            "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler),
26730            "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg),
26731            "bawag_psk_ag" => Ok(BawagPskAg),
26732            "bks_bank_ag" => Ok(BksBankAg),
26733            "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg),
26734            "btv_vier_lander_bank" => Ok(BtvVierLanderBank),
26735            "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg),
26736            "deutsche_bank_ag" => Ok(DeutscheBankAg),
26737            "dolomitenbank" => Ok(Dolomitenbank),
26738            "easybank_ag" => Ok(EasybankAg),
26739            "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen),
26740            "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg),
26741            "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft),
26742            "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien),
26743            "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark),
26744            "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg),
26745            "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg),
26746            "marchfelder_bank" => Ok(MarchfelderBank),
26747            "oberbank_ag" => Ok(OberbankAg),
26748            "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich),
26749            "schoellerbank_ag" => Ok(SchoellerbankAg),
26750            "sparda_bank_wien" => Ok(SpardaBankWien),
26751            "volksbank_gruppe" => Ok(VolksbankGruppe),
26752            "volkskreditbank_ag" => Ok(VolkskreditbankAg),
26753            "vr_bank_braunau" => Ok(VrBankBraunau),
26754            v => {
26755                tracing::warn!(
26756                    "Unknown value '{}' for enum '{}'",
26757                    v,
26758                    "ConfirmPaymentIntentPaymentMethodDataEpsBank"
26759                );
26760                Ok(Unknown(v.to_owned()))
26761            }
26762        }
26763    }
26764}
26765impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataEpsBank {
26766    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26767        f.write_str(self.as_str())
26768    }
26769}
26770
26771impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataEpsBank {
26772    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26773        f.write_str(self.as_str())
26774    }
26775}
26776impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataEpsBank {
26777    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26778    where
26779        S: serde::Serializer,
26780    {
26781        serializer.serialize_str(self.as_str())
26782    }
26783}
26784#[cfg(feature = "deserialize")]
26785impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataEpsBank {
26786    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26787        use std::str::FromStr;
26788        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26789        Ok(Self::from_str(&s).expect("infallible"))
26790    }
26791}
26792/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
26793#[derive(Clone, Debug, serde::Serialize)]
26794pub struct ConfirmPaymentIntentPaymentMethodDataFpx {
26795    /// Account holder type for FPX transaction
26796    #[serde(skip_serializing_if = "Option::is_none")]
26797    pub account_holder_type: Option<ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType>,
26798    /// The customer's bank.
26799    pub bank: ConfirmPaymentIntentPaymentMethodDataFpxBank,
26800}
26801impl ConfirmPaymentIntentPaymentMethodDataFpx {
26802    pub fn new(bank: impl Into<ConfirmPaymentIntentPaymentMethodDataFpxBank>) -> Self {
26803        Self { account_holder_type: None, bank: bank.into() }
26804    }
26805}
26806/// Account holder type for FPX transaction
26807#[derive(Clone, Eq, PartialEq)]
26808#[non_exhaustive]
26809pub enum ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26810    Company,
26811    Individual,
26812    /// An unrecognized value from Stripe. Should not be used as a request parameter.
26813    Unknown(String),
26814}
26815impl ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26816    pub fn as_str(&self) -> &str {
26817        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
26818        match self {
26819            Company => "company",
26820            Individual => "individual",
26821            Unknown(v) => v,
26822        }
26823    }
26824}
26825
26826impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26827    type Err = std::convert::Infallible;
26828    fn from_str(s: &str) -> Result<Self, Self::Err> {
26829        use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*;
26830        match s {
26831            "company" => Ok(Company),
26832            "individual" => Ok(Individual),
26833            v => {
26834                tracing::warn!(
26835                    "Unknown value '{}' for enum '{}'",
26836                    v,
26837                    "ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType"
26838                );
26839                Ok(Unknown(v.to_owned()))
26840            }
26841        }
26842    }
26843}
26844impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26845    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26846        f.write_str(self.as_str())
26847    }
26848}
26849
26850impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26851    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26852        f.write_str(self.as_str())
26853    }
26854}
26855impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26856    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26857    where
26858        S: serde::Serializer,
26859    {
26860        serializer.serialize_str(self.as_str())
26861    }
26862}
26863#[cfg(feature = "deserialize")]
26864impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType {
26865    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26866        use std::str::FromStr;
26867        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26868        Ok(Self::from_str(&s).expect("infallible"))
26869    }
26870}
26871/// The customer's bank.
26872#[derive(Clone, Eq, PartialEq)]
26873#[non_exhaustive]
26874pub enum ConfirmPaymentIntentPaymentMethodDataFpxBank {
26875    AffinBank,
26876    Agrobank,
26877    AllianceBank,
26878    Ambank,
26879    BankIslam,
26880    BankMuamalat,
26881    BankOfChina,
26882    BankRakyat,
26883    Bsn,
26884    Cimb,
26885    DeutscheBank,
26886    HongLeongBank,
26887    Hsbc,
26888    Kfh,
26889    Maybank2e,
26890    Maybank2u,
26891    Ocbc,
26892    PbEnterprise,
26893    PublicBank,
26894    Rhb,
26895    StandardChartered,
26896    Uob,
26897    /// An unrecognized value from Stripe. Should not be used as a request parameter.
26898    Unknown(String),
26899}
26900impl ConfirmPaymentIntentPaymentMethodDataFpxBank {
26901    pub fn as_str(&self) -> &str {
26902        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
26903        match self {
26904            AffinBank => "affin_bank",
26905            Agrobank => "agrobank",
26906            AllianceBank => "alliance_bank",
26907            Ambank => "ambank",
26908            BankIslam => "bank_islam",
26909            BankMuamalat => "bank_muamalat",
26910            BankOfChina => "bank_of_china",
26911            BankRakyat => "bank_rakyat",
26912            Bsn => "bsn",
26913            Cimb => "cimb",
26914            DeutscheBank => "deutsche_bank",
26915            HongLeongBank => "hong_leong_bank",
26916            Hsbc => "hsbc",
26917            Kfh => "kfh",
26918            Maybank2e => "maybank2e",
26919            Maybank2u => "maybank2u",
26920            Ocbc => "ocbc",
26921            PbEnterprise => "pb_enterprise",
26922            PublicBank => "public_bank",
26923            Rhb => "rhb",
26924            StandardChartered => "standard_chartered",
26925            Uob => "uob",
26926            Unknown(v) => v,
26927        }
26928    }
26929}
26930
26931impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxBank {
26932    type Err = std::convert::Infallible;
26933    fn from_str(s: &str) -> Result<Self, Self::Err> {
26934        use ConfirmPaymentIntentPaymentMethodDataFpxBank::*;
26935        match s {
26936            "affin_bank" => Ok(AffinBank),
26937            "agrobank" => Ok(Agrobank),
26938            "alliance_bank" => Ok(AllianceBank),
26939            "ambank" => Ok(Ambank),
26940            "bank_islam" => Ok(BankIslam),
26941            "bank_muamalat" => Ok(BankMuamalat),
26942            "bank_of_china" => Ok(BankOfChina),
26943            "bank_rakyat" => Ok(BankRakyat),
26944            "bsn" => Ok(Bsn),
26945            "cimb" => Ok(Cimb),
26946            "deutsche_bank" => Ok(DeutscheBank),
26947            "hong_leong_bank" => Ok(HongLeongBank),
26948            "hsbc" => Ok(Hsbc),
26949            "kfh" => Ok(Kfh),
26950            "maybank2e" => Ok(Maybank2e),
26951            "maybank2u" => Ok(Maybank2u),
26952            "ocbc" => Ok(Ocbc),
26953            "pb_enterprise" => Ok(PbEnterprise),
26954            "public_bank" => Ok(PublicBank),
26955            "rhb" => Ok(Rhb),
26956            "standard_chartered" => Ok(StandardChartered),
26957            "uob" => Ok(Uob),
26958            v => {
26959                tracing::warn!(
26960                    "Unknown value '{}' for enum '{}'",
26961                    v,
26962                    "ConfirmPaymentIntentPaymentMethodDataFpxBank"
26963                );
26964                Ok(Unknown(v.to_owned()))
26965            }
26966        }
26967    }
26968}
26969impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxBank {
26970    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26971        f.write_str(self.as_str())
26972    }
26973}
26974
26975impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxBank {
26976    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
26977        f.write_str(self.as_str())
26978    }
26979}
26980impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxBank {
26981    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
26982    where
26983        S: serde::Serializer,
26984    {
26985        serializer.serialize_str(self.as_str())
26986    }
26987}
26988#[cfg(feature = "deserialize")]
26989impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataFpxBank {
26990    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
26991        use std::str::FromStr;
26992        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
26993        Ok(Self::from_str(&s).expect("infallible"))
26994    }
26995}
26996/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
26997#[derive(Clone, Debug, serde::Serialize)]
26998pub struct ConfirmPaymentIntentPaymentMethodDataIdeal {
26999    /// The customer's bank.
27000    /// Only use this parameter for existing customers.
27001    /// Don't use it for new customers.
27002    #[serde(skip_serializing_if = "Option::is_none")]
27003    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataIdealBank>,
27004}
27005impl ConfirmPaymentIntentPaymentMethodDataIdeal {
27006    pub fn new() -> Self {
27007        Self { bank: None }
27008    }
27009}
27010impl Default for ConfirmPaymentIntentPaymentMethodDataIdeal {
27011    fn default() -> Self {
27012        Self::new()
27013    }
27014}
27015/// The customer's bank.
27016/// Only use this parameter for existing customers.
27017/// Don't use it for new customers.
27018#[derive(Clone, Eq, PartialEq)]
27019#[non_exhaustive]
27020pub enum ConfirmPaymentIntentPaymentMethodDataIdealBank {
27021    AbnAmro,
27022    AsnBank,
27023    Bunq,
27024    Buut,
27025    Finom,
27026    Handelsbanken,
27027    Ing,
27028    Knab,
27029    Moneyou,
27030    N26,
27031    Nn,
27032    Rabobank,
27033    Regiobank,
27034    Revolut,
27035    SnsBank,
27036    TriodosBank,
27037    VanLanschot,
27038    Yoursafe,
27039    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27040    Unknown(String),
27041}
27042impl ConfirmPaymentIntentPaymentMethodDataIdealBank {
27043    pub fn as_str(&self) -> &str {
27044        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
27045        match self {
27046            AbnAmro => "abn_amro",
27047            AsnBank => "asn_bank",
27048            Bunq => "bunq",
27049            Buut => "buut",
27050            Finom => "finom",
27051            Handelsbanken => "handelsbanken",
27052            Ing => "ing",
27053            Knab => "knab",
27054            Moneyou => "moneyou",
27055            N26 => "n26",
27056            Nn => "nn",
27057            Rabobank => "rabobank",
27058            Regiobank => "regiobank",
27059            Revolut => "revolut",
27060            SnsBank => "sns_bank",
27061            TriodosBank => "triodos_bank",
27062            VanLanschot => "van_lanschot",
27063            Yoursafe => "yoursafe",
27064            Unknown(v) => v,
27065        }
27066    }
27067}
27068
27069impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataIdealBank {
27070    type Err = std::convert::Infallible;
27071    fn from_str(s: &str) -> Result<Self, Self::Err> {
27072        use ConfirmPaymentIntentPaymentMethodDataIdealBank::*;
27073        match s {
27074            "abn_amro" => Ok(AbnAmro),
27075            "asn_bank" => Ok(AsnBank),
27076            "bunq" => Ok(Bunq),
27077            "buut" => Ok(Buut),
27078            "finom" => Ok(Finom),
27079            "handelsbanken" => Ok(Handelsbanken),
27080            "ing" => Ok(Ing),
27081            "knab" => Ok(Knab),
27082            "moneyou" => Ok(Moneyou),
27083            "n26" => Ok(N26),
27084            "nn" => Ok(Nn),
27085            "rabobank" => Ok(Rabobank),
27086            "regiobank" => Ok(Regiobank),
27087            "revolut" => Ok(Revolut),
27088            "sns_bank" => Ok(SnsBank),
27089            "triodos_bank" => Ok(TriodosBank),
27090            "van_lanschot" => Ok(VanLanschot),
27091            "yoursafe" => Ok(Yoursafe),
27092            v => {
27093                tracing::warn!(
27094                    "Unknown value '{}' for enum '{}'",
27095                    v,
27096                    "ConfirmPaymentIntentPaymentMethodDataIdealBank"
27097                );
27098                Ok(Unknown(v.to_owned()))
27099            }
27100        }
27101    }
27102}
27103impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataIdealBank {
27104    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27105        f.write_str(self.as_str())
27106    }
27107}
27108
27109impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataIdealBank {
27110    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27111        f.write_str(self.as_str())
27112    }
27113}
27114impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataIdealBank {
27115    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27116    where
27117        S: serde::Serializer,
27118    {
27119        serializer.serialize_str(self.as_str())
27120    }
27121}
27122#[cfg(feature = "deserialize")]
27123impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataIdealBank {
27124    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27125        use std::str::FromStr;
27126        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27127        Ok(Self::from_str(&s).expect("infallible"))
27128    }
27129}
27130/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
27131#[derive(Copy, Clone, Debug, serde::Serialize)]
27132pub struct ConfirmPaymentIntentPaymentMethodDataKlarna {
27133    /// Customer's date of birth
27134    #[serde(skip_serializing_if = "Option::is_none")]
27135    pub dob: Option<DateOfBirth>,
27136}
27137impl ConfirmPaymentIntentPaymentMethodDataKlarna {
27138    pub fn new() -> Self {
27139        Self { dob: None }
27140    }
27141}
27142impl Default for ConfirmPaymentIntentPaymentMethodDataKlarna {
27143    fn default() -> Self {
27144        Self::new()
27145    }
27146}
27147/// If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
27148#[derive(Clone, Debug, serde::Serialize)]
27149pub struct ConfirmPaymentIntentPaymentMethodDataNaverPay {
27150    /// Whether to use Naver Pay points or a card to fund this transaction.
27151    /// If not provided, this defaults to `card`.
27152    #[serde(skip_serializing_if = "Option::is_none")]
27153    pub funding: Option<ConfirmPaymentIntentPaymentMethodDataNaverPayFunding>,
27154}
27155impl ConfirmPaymentIntentPaymentMethodDataNaverPay {
27156    pub fn new() -> Self {
27157        Self { funding: None }
27158    }
27159}
27160impl Default for ConfirmPaymentIntentPaymentMethodDataNaverPay {
27161    fn default() -> Self {
27162        Self::new()
27163    }
27164}
27165/// Whether to use Naver Pay points or a card to fund this transaction.
27166/// If not provided, this defaults to `card`.
27167#[derive(Clone, Eq, PartialEq)]
27168#[non_exhaustive]
27169pub enum ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27170    Card,
27171    Points,
27172    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27173    Unknown(String),
27174}
27175impl ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27176    pub fn as_str(&self) -> &str {
27177        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
27178        match self {
27179            Card => "card",
27180            Points => "points",
27181            Unknown(v) => v,
27182        }
27183    }
27184}
27185
27186impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27187    type Err = std::convert::Infallible;
27188    fn from_str(s: &str) -> Result<Self, Self::Err> {
27189        use ConfirmPaymentIntentPaymentMethodDataNaverPayFunding::*;
27190        match s {
27191            "card" => Ok(Card),
27192            "points" => Ok(Points),
27193            v => {
27194                tracing::warn!(
27195                    "Unknown value '{}' for enum '{}'",
27196                    v,
27197                    "ConfirmPaymentIntentPaymentMethodDataNaverPayFunding"
27198                );
27199                Ok(Unknown(v.to_owned()))
27200            }
27201        }
27202    }
27203}
27204impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27205    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27206        f.write_str(self.as_str())
27207    }
27208}
27209
27210impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27211    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27212        f.write_str(self.as_str())
27213    }
27214}
27215impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27216    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27217    where
27218        S: serde::Serializer,
27219    {
27220        serializer.serialize_str(self.as_str())
27221    }
27222}
27223#[cfg(feature = "deserialize")]
27224impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataNaverPayFunding {
27225    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27226        use std::str::FromStr;
27227        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27228        Ok(Self::from_str(&s).expect("infallible"))
27229    }
27230}
27231/// If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
27232#[derive(Clone, Debug, serde::Serialize)]
27233pub struct ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
27234    /// The name on the bank account.
27235    /// Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
27236    #[serde(skip_serializing_if = "Option::is_none")]
27237    pub account_holder_name: Option<String>,
27238    /// The account number for the bank account.
27239    pub account_number: String,
27240    /// The numeric code for the bank account's bank.
27241    pub bank_code: String,
27242    /// The numeric code for the bank account's bank branch.
27243    pub branch_code: String,
27244    #[serde(skip_serializing_if = "Option::is_none")]
27245    pub reference: Option<String>,
27246    /// The suffix of the bank account number.
27247    pub suffix: String,
27248}
27249impl ConfirmPaymentIntentPaymentMethodDataNzBankAccount {
27250    pub fn new(
27251        account_number: impl Into<String>,
27252        bank_code: impl Into<String>,
27253        branch_code: impl Into<String>,
27254        suffix: impl Into<String>,
27255    ) -> Self {
27256        Self {
27257            account_holder_name: None,
27258            account_number: account_number.into(),
27259            bank_code: bank_code.into(),
27260            branch_code: branch_code.into(),
27261            reference: None,
27262            suffix: suffix.into(),
27263        }
27264    }
27265}
27266/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
27267#[derive(Clone, Debug, serde::Serialize)]
27268pub struct ConfirmPaymentIntentPaymentMethodDataP24 {
27269    /// The customer's bank.
27270    #[serde(skip_serializing_if = "Option::is_none")]
27271    pub bank: Option<ConfirmPaymentIntentPaymentMethodDataP24Bank>,
27272}
27273impl ConfirmPaymentIntentPaymentMethodDataP24 {
27274    pub fn new() -> Self {
27275        Self { bank: None }
27276    }
27277}
27278impl Default for ConfirmPaymentIntentPaymentMethodDataP24 {
27279    fn default() -> Self {
27280        Self::new()
27281    }
27282}
27283/// The customer's bank.
27284#[derive(Clone, Eq, PartialEq)]
27285#[non_exhaustive]
27286pub enum ConfirmPaymentIntentPaymentMethodDataP24Bank {
27287    AliorBank,
27288    BankMillennium,
27289    BankNowyBfgSa,
27290    BankPekaoSa,
27291    BankiSpbdzielcze,
27292    Blik,
27293    BnpParibas,
27294    Boz,
27295    CitiHandlowy,
27296    CreditAgricole,
27297    Envelobank,
27298    EtransferPocztowy24,
27299    GetinBank,
27300    Ideabank,
27301    Ing,
27302    Inteligo,
27303    MbankMtransfer,
27304    NestPrzelew,
27305    NoblePay,
27306    PbacZIpko,
27307    PlusBank,
27308    SantanderPrzelew24,
27309    TmobileUsbugiBankowe,
27310    ToyotaBank,
27311    Velobank,
27312    VolkswagenBank,
27313    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27314    Unknown(String),
27315}
27316impl ConfirmPaymentIntentPaymentMethodDataP24Bank {
27317    pub fn as_str(&self) -> &str {
27318        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
27319        match self {
27320            AliorBank => "alior_bank",
27321            BankMillennium => "bank_millennium",
27322            BankNowyBfgSa => "bank_nowy_bfg_sa",
27323            BankPekaoSa => "bank_pekao_sa",
27324            BankiSpbdzielcze => "banki_spbdzielcze",
27325            Blik => "blik",
27326            BnpParibas => "bnp_paribas",
27327            Boz => "boz",
27328            CitiHandlowy => "citi_handlowy",
27329            CreditAgricole => "credit_agricole",
27330            Envelobank => "envelobank",
27331            EtransferPocztowy24 => "etransfer_pocztowy24",
27332            GetinBank => "getin_bank",
27333            Ideabank => "ideabank",
27334            Ing => "ing",
27335            Inteligo => "inteligo",
27336            MbankMtransfer => "mbank_mtransfer",
27337            NestPrzelew => "nest_przelew",
27338            NoblePay => "noble_pay",
27339            PbacZIpko => "pbac_z_ipko",
27340            PlusBank => "plus_bank",
27341            SantanderPrzelew24 => "santander_przelew24",
27342            TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
27343            ToyotaBank => "toyota_bank",
27344            Velobank => "velobank",
27345            VolkswagenBank => "volkswagen_bank",
27346            Unknown(v) => v,
27347        }
27348    }
27349}
27350
27351impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataP24Bank {
27352    type Err = std::convert::Infallible;
27353    fn from_str(s: &str) -> Result<Self, Self::Err> {
27354        use ConfirmPaymentIntentPaymentMethodDataP24Bank::*;
27355        match s {
27356            "alior_bank" => Ok(AliorBank),
27357            "bank_millennium" => Ok(BankMillennium),
27358            "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa),
27359            "bank_pekao_sa" => Ok(BankPekaoSa),
27360            "banki_spbdzielcze" => Ok(BankiSpbdzielcze),
27361            "blik" => Ok(Blik),
27362            "bnp_paribas" => Ok(BnpParibas),
27363            "boz" => Ok(Boz),
27364            "citi_handlowy" => Ok(CitiHandlowy),
27365            "credit_agricole" => Ok(CreditAgricole),
27366            "envelobank" => Ok(Envelobank),
27367            "etransfer_pocztowy24" => Ok(EtransferPocztowy24),
27368            "getin_bank" => Ok(GetinBank),
27369            "ideabank" => Ok(Ideabank),
27370            "ing" => Ok(Ing),
27371            "inteligo" => Ok(Inteligo),
27372            "mbank_mtransfer" => Ok(MbankMtransfer),
27373            "nest_przelew" => Ok(NestPrzelew),
27374            "noble_pay" => Ok(NoblePay),
27375            "pbac_z_ipko" => Ok(PbacZIpko),
27376            "plus_bank" => Ok(PlusBank),
27377            "santander_przelew24" => Ok(SantanderPrzelew24),
27378            "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe),
27379            "toyota_bank" => Ok(ToyotaBank),
27380            "velobank" => Ok(Velobank),
27381            "volkswagen_bank" => Ok(VolkswagenBank),
27382            v => {
27383                tracing::warn!(
27384                    "Unknown value '{}' for enum '{}'",
27385                    v,
27386                    "ConfirmPaymentIntentPaymentMethodDataP24Bank"
27387                );
27388                Ok(Unknown(v.to_owned()))
27389            }
27390        }
27391    }
27392}
27393impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataP24Bank {
27394    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27395        f.write_str(self.as_str())
27396    }
27397}
27398
27399impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataP24Bank {
27400    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27401        f.write_str(self.as_str())
27402    }
27403}
27404impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataP24Bank {
27405    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27406    where
27407        S: serde::Serializer,
27408    {
27409        serializer.serialize_str(self.as_str())
27410    }
27411}
27412#[cfg(feature = "deserialize")]
27413impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataP24Bank {
27414    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27415        use std::str::FromStr;
27416        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27417        Ok(Self::from_str(&s).expect("infallible"))
27418    }
27419}
27420/// Options to configure Radar.
27421/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
27422#[derive(Clone, Debug, serde::Serialize)]
27423pub struct ConfirmPaymentIntentPaymentMethodDataRadarOptions {
27424    /// 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.
27425    #[serde(skip_serializing_if = "Option::is_none")]
27426    pub session: Option<String>,
27427}
27428impl ConfirmPaymentIntentPaymentMethodDataRadarOptions {
27429    pub fn new() -> Self {
27430        Self { session: None }
27431    }
27432}
27433impl Default for ConfirmPaymentIntentPaymentMethodDataRadarOptions {
27434    fn default() -> Self {
27435        Self::new()
27436    }
27437}
27438/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
27439#[derive(Clone, Debug, serde::Serialize)]
27440pub struct ConfirmPaymentIntentPaymentMethodDataSepaDebit {
27441    /// IBAN of the bank account.
27442    pub iban: String,
27443}
27444impl ConfirmPaymentIntentPaymentMethodDataSepaDebit {
27445    pub fn new(iban: impl Into<String>) -> Self {
27446        Self { iban: iban.into() }
27447    }
27448}
27449/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
27450#[derive(Clone, Debug, serde::Serialize)]
27451pub struct ConfirmPaymentIntentPaymentMethodDataSofort {
27452    /// Two-letter ISO code representing the country the bank account is located in.
27453    pub country: ConfirmPaymentIntentPaymentMethodDataSofortCountry,
27454}
27455impl ConfirmPaymentIntentPaymentMethodDataSofort {
27456    pub fn new(country: impl Into<ConfirmPaymentIntentPaymentMethodDataSofortCountry>) -> Self {
27457        Self { country: country.into() }
27458    }
27459}
27460/// Two-letter ISO code representing the country the bank account is located in.
27461#[derive(Clone, Eq, PartialEq)]
27462#[non_exhaustive]
27463pub enum ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27464    At,
27465    Be,
27466    De,
27467    Es,
27468    It,
27469    Nl,
27470    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27471    Unknown(String),
27472}
27473impl ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27474    pub fn as_str(&self) -> &str {
27475        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
27476        match self {
27477            At => "AT",
27478            Be => "BE",
27479            De => "DE",
27480            Es => "ES",
27481            It => "IT",
27482            Nl => "NL",
27483            Unknown(v) => v,
27484        }
27485    }
27486}
27487
27488impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27489    type Err = std::convert::Infallible;
27490    fn from_str(s: &str) -> Result<Self, Self::Err> {
27491        use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*;
27492        match s {
27493            "AT" => Ok(At),
27494            "BE" => Ok(Be),
27495            "DE" => Ok(De),
27496            "ES" => Ok(Es),
27497            "IT" => Ok(It),
27498            "NL" => Ok(Nl),
27499            v => {
27500                tracing::warn!(
27501                    "Unknown value '{}' for enum '{}'",
27502                    v,
27503                    "ConfirmPaymentIntentPaymentMethodDataSofortCountry"
27504                );
27505                Ok(Unknown(v.to_owned()))
27506            }
27507        }
27508    }
27509}
27510impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27511    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27512        f.write_str(self.as_str())
27513    }
27514}
27515
27516impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27517    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27518        f.write_str(self.as_str())
27519    }
27520}
27521impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27522    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27523    where
27524        S: serde::Serializer,
27525    {
27526        serializer.serialize_str(self.as_str())
27527    }
27528}
27529#[cfg(feature = "deserialize")]
27530impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataSofortCountry {
27531    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27532        use std::str::FromStr;
27533        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27534        Ok(Self::from_str(&s).expect("infallible"))
27535    }
27536}
27537/// The type of the PaymentMethod.
27538/// An additional hash is included on the PaymentMethod with a name matching this value.
27539/// It contains additional information specific to the PaymentMethod type.
27540#[derive(Clone, Eq, PartialEq)]
27541#[non_exhaustive]
27542pub enum ConfirmPaymentIntentPaymentMethodDataType {
27543    AcssDebit,
27544    Affirm,
27545    AfterpayClearpay,
27546    Alipay,
27547    Alma,
27548    AmazonPay,
27549    AuBecsDebit,
27550    BacsDebit,
27551    Bancontact,
27552    Billie,
27553    Blik,
27554    Boleto,
27555    Cashapp,
27556    Crypto,
27557    CustomerBalance,
27558    Eps,
27559    Fpx,
27560    Giropay,
27561    Grabpay,
27562    Ideal,
27563    KakaoPay,
27564    Klarna,
27565    Konbini,
27566    KrCard,
27567    Link,
27568    MbWay,
27569    Mobilepay,
27570    Multibanco,
27571    NaverPay,
27572    NzBankAccount,
27573    Oxxo,
27574    P24,
27575    PayByBank,
27576    Payco,
27577    Paynow,
27578    Paypal,
27579    Pix,
27580    Promptpay,
27581    RevolutPay,
27582    SamsungPay,
27583    Satispay,
27584    SepaDebit,
27585    Sofort,
27586    Swish,
27587    Twint,
27588    UsBankAccount,
27589    WechatPay,
27590    Zip,
27591    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27592    Unknown(String),
27593}
27594impl ConfirmPaymentIntentPaymentMethodDataType {
27595    pub fn as_str(&self) -> &str {
27596        use ConfirmPaymentIntentPaymentMethodDataType::*;
27597        match self {
27598            AcssDebit => "acss_debit",
27599            Affirm => "affirm",
27600            AfterpayClearpay => "afterpay_clearpay",
27601            Alipay => "alipay",
27602            Alma => "alma",
27603            AmazonPay => "amazon_pay",
27604            AuBecsDebit => "au_becs_debit",
27605            BacsDebit => "bacs_debit",
27606            Bancontact => "bancontact",
27607            Billie => "billie",
27608            Blik => "blik",
27609            Boleto => "boleto",
27610            Cashapp => "cashapp",
27611            Crypto => "crypto",
27612            CustomerBalance => "customer_balance",
27613            Eps => "eps",
27614            Fpx => "fpx",
27615            Giropay => "giropay",
27616            Grabpay => "grabpay",
27617            Ideal => "ideal",
27618            KakaoPay => "kakao_pay",
27619            Klarna => "klarna",
27620            Konbini => "konbini",
27621            KrCard => "kr_card",
27622            Link => "link",
27623            MbWay => "mb_way",
27624            Mobilepay => "mobilepay",
27625            Multibanco => "multibanco",
27626            NaverPay => "naver_pay",
27627            NzBankAccount => "nz_bank_account",
27628            Oxxo => "oxxo",
27629            P24 => "p24",
27630            PayByBank => "pay_by_bank",
27631            Payco => "payco",
27632            Paynow => "paynow",
27633            Paypal => "paypal",
27634            Pix => "pix",
27635            Promptpay => "promptpay",
27636            RevolutPay => "revolut_pay",
27637            SamsungPay => "samsung_pay",
27638            Satispay => "satispay",
27639            SepaDebit => "sepa_debit",
27640            Sofort => "sofort",
27641            Swish => "swish",
27642            Twint => "twint",
27643            UsBankAccount => "us_bank_account",
27644            WechatPay => "wechat_pay",
27645            Zip => "zip",
27646            Unknown(v) => v,
27647        }
27648    }
27649}
27650
27651impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataType {
27652    type Err = std::convert::Infallible;
27653    fn from_str(s: &str) -> Result<Self, Self::Err> {
27654        use ConfirmPaymentIntentPaymentMethodDataType::*;
27655        match s {
27656            "acss_debit" => Ok(AcssDebit),
27657            "affirm" => Ok(Affirm),
27658            "afterpay_clearpay" => Ok(AfterpayClearpay),
27659            "alipay" => Ok(Alipay),
27660            "alma" => Ok(Alma),
27661            "amazon_pay" => Ok(AmazonPay),
27662            "au_becs_debit" => Ok(AuBecsDebit),
27663            "bacs_debit" => Ok(BacsDebit),
27664            "bancontact" => Ok(Bancontact),
27665            "billie" => Ok(Billie),
27666            "blik" => Ok(Blik),
27667            "boleto" => Ok(Boleto),
27668            "cashapp" => Ok(Cashapp),
27669            "crypto" => Ok(Crypto),
27670            "customer_balance" => Ok(CustomerBalance),
27671            "eps" => Ok(Eps),
27672            "fpx" => Ok(Fpx),
27673            "giropay" => Ok(Giropay),
27674            "grabpay" => Ok(Grabpay),
27675            "ideal" => Ok(Ideal),
27676            "kakao_pay" => Ok(KakaoPay),
27677            "klarna" => Ok(Klarna),
27678            "konbini" => Ok(Konbini),
27679            "kr_card" => Ok(KrCard),
27680            "link" => Ok(Link),
27681            "mb_way" => Ok(MbWay),
27682            "mobilepay" => Ok(Mobilepay),
27683            "multibanco" => Ok(Multibanco),
27684            "naver_pay" => Ok(NaverPay),
27685            "nz_bank_account" => Ok(NzBankAccount),
27686            "oxxo" => Ok(Oxxo),
27687            "p24" => Ok(P24),
27688            "pay_by_bank" => Ok(PayByBank),
27689            "payco" => Ok(Payco),
27690            "paynow" => Ok(Paynow),
27691            "paypal" => Ok(Paypal),
27692            "pix" => Ok(Pix),
27693            "promptpay" => Ok(Promptpay),
27694            "revolut_pay" => Ok(RevolutPay),
27695            "samsung_pay" => Ok(SamsungPay),
27696            "satispay" => Ok(Satispay),
27697            "sepa_debit" => Ok(SepaDebit),
27698            "sofort" => Ok(Sofort),
27699            "swish" => Ok(Swish),
27700            "twint" => Ok(Twint),
27701            "us_bank_account" => Ok(UsBankAccount),
27702            "wechat_pay" => Ok(WechatPay),
27703            "zip" => Ok(Zip),
27704            v => {
27705                tracing::warn!(
27706                    "Unknown value '{}' for enum '{}'",
27707                    v,
27708                    "ConfirmPaymentIntentPaymentMethodDataType"
27709                );
27710                Ok(Unknown(v.to_owned()))
27711            }
27712        }
27713    }
27714}
27715impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataType {
27716    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27717        f.write_str(self.as_str())
27718    }
27719}
27720
27721impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataType {
27722    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27723        f.write_str(self.as_str())
27724    }
27725}
27726impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataType {
27727    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27728    where
27729        S: serde::Serializer,
27730    {
27731        serializer.serialize_str(self.as_str())
27732    }
27733}
27734#[cfg(feature = "deserialize")]
27735impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodDataType {
27736    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27737        use std::str::FromStr;
27738        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27739        Ok(Self::from_str(&s).expect("infallible"))
27740    }
27741}
27742/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
27743#[derive(Clone, Debug, serde::Serialize)]
27744pub struct ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
27745    /// Account holder type: individual or company.
27746    #[serde(skip_serializing_if = "Option::is_none")]
27747    pub account_holder_type:
27748        Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType>,
27749    /// Account number of the bank account.
27750    #[serde(skip_serializing_if = "Option::is_none")]
27751    pub account_number: Option<String>,
27752    /// Account type: checkings or savings. Defaults to checking if omitted.
27753    #[serde(skip_serializing_if = "Option::is_none")]
27754    pub account_type: Option<ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType>,
27755    /// The ID of a Financial Connections Account to use as a payment method.
27756    #[serde(skip_serializing_if = "Option::is_none")]
27757    pub financial_connections_account: Option<String>,
27758    /// Routing number of the bank account.
27759    #[serde(skip_serializing_if = "Option::is_none")]
27760    pub routing_number: Option<String>,
27761}
27762impl ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
27763    pub fn new() -> Self {
27764        Self {
27765            account_holder_type: None,
27766            account_number: None,
27767            account_type: None,
27768            financial_connections_account: None,
27769            routing_number: None,
27770        }
27771    }
27772}
27773impl Default for ConfirmPaymentIntentPaymentMethodDataUsBankAccount {
27774    fn default() -> Self {
27775        Self::new()
27776    }
27777}
27778/// Account holder type: individual or company.
27779#[derive(Clone, Eq, PartialEq)]
27780#[non_exhaustive]
27781pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
27782    Company,
27783    Individual,
27784    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27785    Unknown(String),
27786}
27787impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
27788    pub fn as_str(&self) -> &str {
27789        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
27790        match self {
27791            Company => "company",
27792            Individual => "individual",
27793            Unknown(v) => v,
27794        }
27795    }
27796}
27797
27798impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
27799    type Err = std::convert::Infallible;
27800    fn from_str(s: &str) -> Result<Self, Self::Err> {
27801        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
27802        match s {
27803            "company" => Ok(Company),
27804            "individual" => Ok(Individual),
27805            v => {
27806                tracing::warn!(
27807                    "Unknown value '{}' for enum '{}'",
27808                    v,
27809                    "ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType"
27810                );
27811                Ok(Unknown(v.to_owned()))
27812            }
27813        }
27814    }
27815}
27816impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
27817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27818        f.write_str(self.as_str())
27819    }
27820}
27821
27822impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
27823    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27824        f.write_str(self.as_str())
27825    }
27826}
27827impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType {
27828    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27829    where
27830        S: serde::Serializer,
27831    {
27832        serializer.serialize_str(self.as_str())
27833    }
27834}
27835#[cfg(feature = "deserialize")]
27836impl<'de> serde::Deserialize<'de>
27837    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType
27838{
27839    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27840        use std::str::FromStr;
27841        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27842        Ok(Self::from_str(&s).expect("infallible"))
27843    }
27844}
27845/// Account type: checkings or savings. Defaults to checking if omitted.
27846#[derive(Clone, Eq, PartialEq)]
27847#[non_exhaustive]
27848pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
27849    Checking,
27850    Savings,
27851    /// An unrecognized value from Stripe. Should not be used as a request parameter.
27852    Unknown(String),
27853}
27854impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
27855    pub fn as_str(&self) -> &str {
27856        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
27857        match self {
27858            Checking => "checking",
27859            Savings => "savings",
27860            Unknown(v) => v,
27861        }
27862    }
27863}
27864
27865impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
27866    type Err = std::convert::Infallible;
27867    fn from_str(s: &str) -> Result<Self, Self::Err> {
27868        use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*;
27869        match s {
27870            "checking" => Ok(Checking),
27871            "savings" => Ok(Savings),
27872            v => {
27873                tracing::warn!(
27874                    "Unknown value '{}' for enum '{}'",
27875                    v,
27876                    "ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType"
27877                );
27878                Ok(Unknown(v.to_owned()))
27879            }
27880        }
27881    }
27882}
27883impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
27884    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27885        f.write_str(self.as_str())
27886    }
27887}
27888
27889impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
27890    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27891        f.write_str(self.as_str())
27892    }
27893}
27894impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType {
27895    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
27896    where
27897        S: serde::Serializer,
27898    {
27899        serializer.serialize_str(self.as_str())
27900    }
27901}
27902#[cfg(feature = "deserialize")]
27903impl<'de> serde::Deserialize<'de>
27904    for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType
27905{
27906    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
27907        use std::str::FromStr;
27908        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
27909        Ok(Self::from_str(&s).expect("infallible"))
27910    }
27911}
27912/// Payment method-specific configuration for this PaymentIntent.
27913#[derive(Clone, Debug, serde::Serialize)]
27914pub struct ConfirmPaymentIntentPaymentMethodOptions {
27915    /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
27916    #[serde(skip_serializing_if = "Option::is_none")]
27917    pub acss_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebit>,
27918    /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
27919    #[serde(skip_serializing_if = "Option::is_none")]
27920    pub affirm: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirm>,
27921    /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
27922    #[serde(skip_serializing_if = "Option::is_none")]
27923    pub afterpay_clearpay: Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay>,
27924    /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
27925    #[serde(skip_serializing_if = "Option::is_none")]
27926    pub alipay: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipay>,
27927    /// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
27928    #[serde(skip_serializing_if = "Option::is_none")]
27929    pub alma: Option<ConfirmPaymentIntentPaymentMethodOptionsAlma>,
27930    /// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
27931    #[serde(skip_serializing_if = "Option::is_none")]
27932    pub amazon_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPay>,
27933    /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
27934    #[serde(skip_serializing_if = "Option::is_none")]
27935    pub au_becs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit>,
27936    /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
27937    #[serde(skip_serializing_if = "Option::is_none")]
27938    pub bacs_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebit>,
27939    /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
27940    #[serde(skip_serializing_if = "Option::is_none")]
27941    pub bancontact: Option<ConfirmPaymentIntentPaymentMethodOptionsBancontact>,
27942    /// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
27943    #[serde(skip_serializing_if = "Option::is_none")]
27944    pub billie: Option<ConfirmPaymentIntentPaymentMethodOptionsBillie>,
27945    /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
27946    #[serde(skip_serializing_if = "Option::is_none")]
27947    pub blik: Option<ConfirmPaymentIntentPaymentMethodOptionsBlik>,
27948    /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
27949    #[serde(skip_serializing_if = "Option::is_none")]
27950    pub boleto: Option<ConfirmPaymentIntentPaymentMethodOptionsBoleto>,
27951    /// Configuration for any card payments attempted on this PaymentIntent.
27952    #[serde(skip_serializing_if = "Option::is_none")]
27953    pub card: Option<ConfirmPaymentIntentPaymentMethodOptionsCard>,
27954    /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
27955    #[serde(skip_serializing_if = "Option::is_none")]
27956    pub card_present: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresent>,
27957    /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
27958    #[serde(skip_serializing_if = "Option::is_none")]
27959    pub cashapp: Option<ConfirmPaymentIntentPaymentMethodOptionsCashapp>,
27960    /// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
27961    #[serde(skip_serializing_if = "Option::is_none")]
27962    pub crypto: Option<ConfirmPaymentIntentPaymentMethodOptionsCrypto>,
27963    /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
27964    #[serde(skip_serializing_if = "Option::is_none")]
27965    pub customer_balance: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance>,
27966    /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
27967    #[serde(skip_serializing_if = "Option::is_none")]
27968    pub eps: Option<ConfirmPaymentIntentPaymentMethodOptionsEps>,
27969    /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
27970    #[serde(skip_serializing_if = "Option::is_none")]
27971    pub fpx: Option<ConfirmPaymentIntentPaymentMethodOptionsFpx>,
27972    /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
27973    #[serde(skip_serializing_if = "Option::is_none")]
27974    pub giropay: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropay>,
27975    /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
27976    #[serde(skip_serializing_if = "Option::is_none")]
27977    pub grabpay: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpay>,
27978    /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
27979    #[serde(skip_serializing_if = "Option::is_none")]
27980    pub ideal: Option<ConfirmPaymentIntentPaymentMethodOptionsIdeal>,
27981    /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
27982    #[serde(skip_serializing_if = "Option::is_none")]
27983    #[serde(with = "stripe_types::with_serde_json_opt")]
27984    pub interac_present: Option<miniserde::json::Value>,
27985    /// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
27986    #[serde(skip_serializing_if = "Option::is_none")]
27987    pub kakao_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPay>,
27988    /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
27989    #[serde(skip_serializing_if = "Option::is_none")]
27990    pub klarna: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarna>,
27991    /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
27992    #[serde(skip_serializing_if = "Option::is_none")]
27993    pub konbini: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbini>,
27994    /// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
27995    #[serde(skip_serializing_if = "Option::is_none")]
27996    pub kr_card: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCard>,
27997    /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
27998    #[serde(skip_serializing_if = "Option::is_none")]
27999    pub link: Option<ConfirmPaymentIntentPaymentMethodOptionsLink>,
28000    /// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
28001    #[serde(skip_serializing_if = "Option::is_none")]
28002    pub mb_way: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWay>,
28003    /// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
28004    #[serde(skip_serializing_if = "Option::is_none")]
28005    pub mobilepay: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepay>,
28006    /// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
28007    #[serde(skip_serializing_if = "Option::is_none")]
28008    pub multibanco: Option<ConfirmPaymentIntentPaymentMethodOptionsMultibanco>,
28009    /// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
28010    #[serde(skip_serializing_if = "Option::is_none")]
28011    pub naver_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPay>,
28012    /// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
28013    #[serde(skip_serializing_if = "Option::is_none")]
28014    pub nz_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount>,
28015    /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
28016    #[serde(skip_serializing_if = "Option::is_none")]
28017    pub oxxo: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxo>,
28018    /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
28019    #[serde(skip_serializing_if = "Option::is_none")]
28020    pub p24: Option<ConfirmPaymentIntentPaymentMethodOptionsP24>,
28021    /// If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options.
28022    #[serde(skip_serializing_if = "Option::is_none")]
28023    #[serde(with = "stripe_types::with_serde_json_opt")]
28024    pub pay_by_bank: Option<miniserde::json::Value>,
28025    /// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
28026    #[serde(skip_serializing_if = "Option::is_none")]
28027    pub payco: Option<ConfirmPaymentIntentPaymentMethodOptionsPayco>,
28028    /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
28029    #[serde(skip_serializing_if = "Option::is_none")]
28030    pub paynow: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynow>,
28031    /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
28032    #[serde(skip_serializing_if = "Option::is_none")]
28033    pub paypal: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypal>,
28034    /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
28035    #[serde(skip_serializing_if = "Option::is_none")]
28036    pub pix: Option<ConfirmPaymentIntentPaymentMethodOptionsPix>,
28037    /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
28038    #[serde(skip_serializing_if = "Option::is_none")]
28039    pub promptpay: Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpay>,
28040    /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
28041    #[serde(skip_serializing_if = "Option::is_none")]
28042    pub revolut_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPay>,
28043    /// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
28044    #[serde(skip_serializing_if = "Option::is_none")]
28045    pub samsung_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPay>,
28046    /// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
28047    #[serde(skip_serializing_if = "Option::is_none")]
28048    pub satispay: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispay>,
28049    /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
28050    #[serde(skip_serializing_if = "Option::is_none")]
28051    pub sepa_debit: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebit>,
28052    /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
28053    #[serde(skip_serializing_if = "Option::is_none")]
28054    pub sofort: Option<ConfirmPaymentIntentPaymentMethodOptionsSofort>,
28055    /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
28056    #[serde(skip_serializing_if = "Option::is_none")]
28057    pub swish: Option<ConfirmPaymentIntentPaymentMethodOptionsSwish>,
28058    /// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
28059    #[serde(skip_serializing_if = "Option::is_none")]
28060    pub twint: Option<ConfirmPaymentIntentPaymentMethodOptionsTwint>,
28061    /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
28062    #[serde(skip_serializing_if = "Option::is_none")]
28063    pub us_bank_account: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount>,
28064    /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
28065    #[serde(skip_serializing_if = "Option::is_none")]
28066    pub wechat_pay: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPay>,
28067    /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
28068    #[serde(skip_serializing_if = "Option::is_none")]
28069    pub zip: Option<ConfirmPaymentIntentPaymentMethodOptionsZip>,
28070}
28071impl ConfirmPaymentIntentPaymentMethodOptions {
28072    pub fn new() -> Self {
28073        Self {
28074            acss_debit: None,
28075            affirm: None,
28076            afterpay_clearpay: None,
28077            alipay: None,
28078            alma: None,
28079            amazon_pay: None,
28080            au_becs_debit: None,
28081            bacs_debit: None,
28082            bancontact: None,
28083            billie: None,
28084            blik: None,
28085            boleto: None,
28086            card: None,
28087            card_present: None,
28088            cashapp: None,
28089            crypto: None,
28090            customer_balance: None,
28091            eps: None,
28092            fpx: None,
28093            giropay: None,
28094            grabpay: None,
28095            ideal: None,
28096            interac_present: None,
28097            kakao_pay: None,
28098            klarna: None,
28099            konbini: None,
28100            kr_card: None,
28101            link: None,
28102            mb_way: None,
28103            mobilepay: None,
28104            multibanco: None,
28105            naver_pay: None,
28106            nz_bank_account: None,
28107            oxxo: None,
28108            p24: None,
28109            pay_by_bank: None,
28110            payco: None,
28111            paynow: None,
28112            paypal: None,
28113            pix: None,
28114            promptpay: None,
28115            revolut_pay: None,
28116            samsung_pay: None,
28117            satispay: None,
28118            sepa_debit: None,
28119            sofort: None,
28120            swish: None,
28121            twint: None,
28122            us_bank_account: None,
28123            wechat_pay: None,
28124            zip: None,
28125        }
28126    }
28127}
28128impl Default for ConfirmPaymentIntentPaymentMethodOptions {
28129    fn default() -> Self {
28130        Self::new()
28131    }
28132}
28133/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options.
28134#[derive(Clone, Debug, serde::Serialize)]
28135pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
28136    /// Additional fields for Mandate creation
28137    #[serde(skip_serializing_if = "Option::is_none")]
28138    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions>,
28139    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28140    ///
28141    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28142    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28143    ///
28144    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28145    ///
28146    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28147    ///
28148    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28149    #[serde(skip_serializing_if = "Option::is_none")]
28150    pub setup_future_usage:
28151        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage>,
28152    /// Controls when Stripe will attempt to debit the funds from the customer's account.
28153    /// The date must be a string in YYYY-MM-DD format.
28154    /// The date must be in the future and between 3 and 15 calendar days from now.
28155    #[serde(skip_serializing_if = "Option::is_none")]
28156    pub target_date: Option<String>,
28157    /// Bank account verification method.
28158    #[serde(skip_serializing_if = "Option::is_none")]
28159    pub verification_method:
28160        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
28161}
28162impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
28163    pub fn new() -> Self {
28164        Self {
28165            mandate_options: None,
28166            setup_future_usage: None,
28167            target_date: None,
28168            verification_method: None,
28169        }
28170    }
28171}
28172impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebit {
28173    fn default() -> Self {
28174        Self::new()
28175    }
28176}
28177/// Additional fields for Mandate creation
28178#[derive(Clone, Debug, serde::Serialize)]
28179pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
28180    /// A URL for custom mandate text to render during confirmation step.
28181    /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,.
28182    /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
28183    #[serde(skip_serializing_if = "Option::is_none")]
28184    pub custom_mandate_url: Option<String>,
28185    /// Description of the mandate interval.
28186    /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
28187    #[serde(skip_serializing_if = "Option::is_none")]
28188    pub interval_description: Option<String>,
28189    /// Payment schedule for the mandate.
28190    #[serde(skip_serializing_if = "Option::is_none")]
28191    pub payment_schedule:
28192        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
28193    /// Transaction type of the mandate.
28194    #[serde(skip_serializing_if = "Option::is_none")]
28195    pub transaction_type:
28196        Option<ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
28197}
28198impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
28199    pub fn new() -> Self {
28200        Self {
28201            custom_mandate_url: None,
28202            interval_description: None,
28203            payment_schedule: None,
28204            transaction_type: None,
28205        }
28206    }
28207}
28208impl Default for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions {
28209    fn default() -> Self {
28210        Self::new()
28211    }
28212}
28213/// Payment schedule for the mandate.
28214#[derive(Clone, Eq, PartialEq)]
28215#[non_exhaustive]
28216pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
28217    Combined,
28218    Interval,
28219    Sporadic,
28220    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28221    Unknown(String),
28222}
28223impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
28224    pub fn as_str(&self) -> &str {
28225        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
28226        match self {
28227            Combined => "combined",
28228            Interval => "interval",
28229            Sporadic => "sporadic",
28230            Unknown(v) => v,
28231        }
28232    }
28233}
28234
28235impl std::str::FromStr
28236    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
28237{
28238    type Err = std::convert::Infallible;
28239    fn from_str(s: &str) -> Result<Self, Self::Err> {
28240        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
28241        match s {
28242            "combined" => Ok(Combined),
28243            "interval" => Ok(Interval),
28244            "sporadic" => Ok(Sporadic),
28245            v => {
28246                tracing::warn!(
28247                    "Unknown value '{}' for enum '{}'",
28248                    v,
28249                    "ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
28250                );
28251                Ok(Unknown(v.to_owned()))
28252            }
28253        }
28254    }
28255}
28256impl std::fmt::Display
28257    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
28258{
28259    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28260        f.write_str(self.as_str())
28261    }
28262}
28263
28264impl std::fmt::Debug
28265    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
28266{
28267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28268        f.write_str(self.as_str())
28269    }
28270}
28271impl serde::Serialize
28272    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
28273{
28274    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28275    where
28276        S: serde::Serializer,
28277    {
28278        serializer.serialize_str(self.as_str())
28279    }
28280}
28281#[cfg(feature = "deserialize")]
28282impl<'de> serde::Deserialize<'de>
28283    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
28284{
28285    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28286        use std::str::FromStr;
28287        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28288        Ok(Self::from_str(&s).expect("infallible"))
28289    }
28290}
28291/// Transaction type of the mandate.
28292#[derive(Clone, Eq, PartialEq)]
28293#[non_exhaustive]
28294pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
28295    Business,
28296    Personal,
28297    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28298    Unknown(String),
28299}
28300impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
28301    pub fn as_str(&self) -> &str {
28302        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
28303        match self {
28304            Business => "business",
28305            Personal => "personal",
28306            Unknown(v) => v,
28307        }
28308    }
28309}
28310
28311impl std::str::FromStr
28312    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
28313{
28314    type Err = std::convert::Infallible;
28315    fn from_str(s: &str) -> Result<Self, Self::Err> {
28316        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
28317        match s {
28318            "business" => Ok(Business),
28319            "personal" => Ok(Personal),
28320            v => {
28321                tracing::warn!(
28322                    "Unknown value '{}' for enum '{}'",
28323                    v,
28324                    "ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
28325                );
28326                Ok(Unknown(v.to_owned()))
28327            }
28328        }
28329    }
28330}
28331impl std::fmt::Display
28332    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
28333{
28334    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28335        f.write_str(self.as_str())
28336    }
28337}
28338
28339impl std::fmt::Debug
28340    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
28341{
28342    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28343        f.write_str(self.as_str())
28344    }
28345}
28346impl serde::Serialize
28347    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
28348{
28349    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28350    where
28351        S: serde::Serializer,
28352    {
28353        serializer.serialize_str(self.as_str())
28354    }
28355}
28356#[cfg(feature = "deserialize")]
28357impl<'de> serde::Deserialize<'de>
28358    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
28359{
28360    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28361        use std::str::FromStr;
28362        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28363        Ok(Self::from_str(&s).expect("infallible"))
28364    }
28365}
28366/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28367///
28368/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28369/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28370///
28371/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28372///
28373/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28374///
28375/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28376#[derive(Clone, Eq, PartialEq)]
28377#[non_exhaustive]
28378pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
28379    None,
28380    OffSession,
28381    OnSession,
28382    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28383    Unknown(String),
28384}
28385impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
28386    pub fn as_str(&self) -> &str {
28387        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
28388        match self {
28389            None => "none",
28390            OffSession => "off_session",
28391            OnSession => "on_session",
28392            Unknown(v) => v,
28393        }
28394    }
28395}
28396
28397impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
28398    type Err = std::convert::Infallible;
28399    fn from_str(s: &str) -> Result<Self, Self::Err> {
28400        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*;
28401        match s {
28402            "none" => Ok(None),
28403            "off_session" => Ok(OffSession),
28404            "on_session" => Ok(OnSession),
28405            v => {
28406                tracing::warn!(
28407                    "Unknown value '{}' for enum '{}'",
28408                    v,
28409                    "ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage"
28410                );
28411                Ok(Unknown(v.to_owned()))
28412            }
28413        }
28414    }
28415}
28416impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
28417    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28418        f.write_str(self.as_str())
28419    }
28420}
28421
28422impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
28423    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28424        f.write_str(self.as_str())
28425    }
28426}
28427impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage {
28428    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28429    where
28430        S: serde::Serializer,
28431    {
28432        serializer.serialize_str(self.as_str())
28433    }
28434}
28435#[cfg(feature = "deserialize")]
28436impl<'de> serde::Deserialize<'de>
28437    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage
28438{
28439    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28440        use std::str::FromStr;
28441        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28442        Ok(Self::from_str(&s).expect("infallible"))
28443    }
28444}
28445/// Bank account verification method.
28446#[derive(Clone, Eq, PartialEq)]
28447#[non_exhaustive]
28448pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
28449    Automatic,
28450    Instant,
28451    Microdeposits,
28452    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28453    Unknown(String),
28454}
28455impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
28456    pub fn as_str(&self) -> &str {
28457        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
28458        match self {
28459            Automatic => "automatic",
28460            Instant => "instant",
28461            Microdeposits => "microdeposits",
28462            Unknown(v) => v,
28463        }
28464    }
28465}
28466
28467impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
28468    type Err = std::convert::Infallible;
28469    fn from_str(s: &str) -> Result<Self, Self::Err> {
28470        use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
28471        match s {
28472            "automatic" => Ok(Automatic),
28473            "instant" => Ok(Instant),
28474            "microdeposits" => Ok(Microdeposits),
28475            v => {
28476                tracing::warn!(
28477                    "Unknown value '{}' for enum '{}'",
28478                    v,
28479                    "ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod"
28480                );
28481                Ok(Unknown(v.to_owned()))
28482            }
28483        }
28484    }
28485}
28486impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
28487    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28488        f.write_str(self.as_str())
28489    }
28490}
28491
28492impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
28493    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28494        f.write_str(self.as_str())
28495    }
28496}
28497impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod {
28498    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28499    where
28500        S: serde::Serializer,
28501    {
28502        serializer.serialize_str(self.as_str())
28503    }
28504}
28505#[cfg(feature = "deserialize")]
28506impl<'de> serde::Deserialize<'de>
28507    for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod
28508{
28509    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28510        use std::str::FromStr;
28511        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28512        Ok(Self::from_str(&s).expect("infallible"))
28513    }
28514}
28515/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options.
28516#[derive(Clone, Debug, serde::Serialize)]
28517pub struct ConfirmPaymentIntentPaymentMethodOptionsAffirm {
28518    /// Controls when the funds are captured from the customer's account.
28519    ///
28520    /// 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.
28521    ///
28522    /// 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.
28523    #[serde(skip_serializing_if = "Option::is_none")]
28524    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod>,
28525    /// Preferred language of the Affirm authorization page that the customer is redirected to.
28526    #[serde(skip_serializing_if = "Option::is_none")]
28527    pub preferred_locale: Option<String>,
28528    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28529    ///
28530    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28531    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28532    ///
28533    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28534    ///
28535    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28536    ///
28537    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28538    #[serde(skip_serializing_if = "Option::is_none")]
28539    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage>,
28540}
28541impl ConfirmPaymentIntentPaymentMethodOptionsAffirm {
28542    pub fn new() -> Self {
28543        Self { capture_method: None, preferred_locale: None, setup_future_usage: None }
28544    }
28545}
28546impl Default for ConfirmPaymentIntentPaymentMethodOptionsAffirm {
28547    fn default() -> Self {
28548        Self::new()
28549    }
28550}
28551/// Controls when the funds are captured from the customer's account.
28552///
28553/// 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.
28554///
28555/// 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.
28556#[derive(Clone, Eq, PartialEq)]
28557#[non_exhaustive]
28558pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28559    Manual,
28560    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28561    Unknown(String),
28562}
28563impl ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28564    pub fn as_str(&self) -> &str {
28565        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
28566        match self {
28567            Manual => "manual",
28568            Unknown(v) => v,
28569        }
28570    }
28571}
28572
28573impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28574    type Err = std::convert::Infallible;
28575    fn from_str(s: &str) -> Result<Self, Self::Err> {
28576        use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*;
28577        match s {
28578            "manual" => Ok(Manual),
28579            v => {
28580                tracing::warn!(
28581                    "Unknown value '{}' for enum '{}'",
28582                    v,
28583                    "ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod"
28584                );
28585                Ok(Unknown(v.to_owned()))
28586            }
28587        }
28588    }
28589}
28590impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28591    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28592        f.write_str(self.as_str())
28593    }
28594}
28595
28596impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28597    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28598        f.write_str(self.as_str())
28599    }
28600}
28601impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28602    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28603    where
28604        S: serde::Serializer,
28605    {
28606        serializer.serialize_str(self.as_str())
28607    }
28608}
28609#[cfg(feature = "deserialize")]
28610impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod {
28611    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28612        use std::str::FromStr;
28613        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28614        Ok(Self::from_str(&s).expect("infallible"))
28615    }
28616}
28617/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28618///
28619/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28620/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28621///
28622/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28623///
28624/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28625///
28626/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28627#[derive(Clone, Eq, PartialEq)]
28628#[non_exhaustive]
28629pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
28630    None,
28631    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28632    Unknown(String),
28633}
28634impl ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
28635    pub fn as_str(&self) -> &str {
28636        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
28637        match self {
28638            None => "none",
28639            Unknown(v) => v,
28640        }
28641    }
28642}
28643
28644impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
28645    type Err = std::convert::Infallible;
28646    fn from_str(s: &str) -> Result<Self, Self::Err> {
28647        use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*;
28648        match s {
28649            "none" => Ok(None),
28650            v => {
28651                tracing::warn!(
28652                    "Unknown value '{}' for enum '{}'",
28653                    v,
28654                    "ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage"
28655                );
28656                Ok(Unknown(v.to_owned()))
28657            }
28658        }
28659    }
28660}
28661impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
28662    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28663        f.write_str(self.as_str())
28664    }
28665}
28666
28667impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
28668    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28669        f.write_str(self.as_str())
28670    }
28671}
28672impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage {
28673    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28674    where
28675        S: serde::Serializer,
28676    {
28677        serializer.serialize_str(self.as_str())
28678    }
28679}
28680#[cfg(feature = "deserialize")]
28681impl<'de> serde::Deserialize<'de>
28682    for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage
28683{
28684    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28685        use std::str::FromStr;
28686        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28687        Ok(Self::from_str(&s).expect("infallible"))
28688    }
28689}
28690/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options.
28691#[derive(Clone, Debug, serde::Serialize)]
28692pub struct ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
28693    /// Controls when the funds are captured from the customer's account.
28694    ///
28695    /// 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.
28696    ///
28697    /// 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.
28698    #[serde(skip_serializing_if = "Option::is_none")]
28699    pub capture_method:
28700        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod>,
28701    /// An internal identifier or reference that this payment corresponds to.
28702    /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes.
28703    /// This field differs from the statement descriptor and item name.
28704    #[serde(skip_serializing_if = "Option::is_none")]
28705    pub reference: Option<String>,
28706    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28707    ///
28708    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28709    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28710    ///
28711    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28712    ///
28713    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28714    ///
28715    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28716    #[serde(skip_serializing_if = "Option::is_none")]
28717    pub setup_future_usage:
28718        Option<ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage>,
28719}
28720impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
28721    pub fn new() -> Self {
28722        Self { capture_method: None, reference: None, setup_future_usage: None }
28723    }
28724}
28725impl Default for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay {
28726    fn default() -> Self {
28727        Self::new()
28728    }
28729}
28730/// Controls when the funds are captured from the customer's account.
28731///
28732/// 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.
28733///
28734/// 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.
28735#[derive(Clone, Eq, PartialEq)]
28736#[non_exhaustive]
28737pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
28738    Manual,
28739    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28740    Unknown(String),
28741}
28742impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
28743    pub fn as_str(&self) -> &str {
28744        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
28745        match self {
28746            Manual => "manual",
28747            Unknown(v) => v,
28748        }
28749    }
28750}
28751
28752impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
28753    type Err = std::convert::Infallible;
28754    fn from_str(s: &str) -> Result<Self, Self::Err> {
28755        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*;
28756        match s {
28757            "manual" => Ok(Manual),
28758            v => {
28759                tracing::warn!(
28760                    "Unknown value '{}' for enum '{}'",
28761                    v,
28762                    "ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod"
28763                );
28764                Ok(Unknown(v.to_owned()))
28765            }
28766        }
28767    }
28768}
28769impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
28770    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28771        f.write_str(self.as_str())
28772    }
28773}
28774
28775impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
28776    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28777        f.write_str(self.as_str())
28778    }
28779}
28780impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod {
28781    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28782    where
28783        S: serde::Serializer,
28784    {
28785        serializer.serialize_str(self.as_str())
28786    }
28787}
28788#[cfg(feature = "deserialize")]
28789impl<'de> serde::Deserialize<'de>
28790    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod
28791{
28792    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28793        use std::str::FromStr;
28794        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28795        Ok(Self::from_str(&s).expect("infallible"))
28796    }
28797}
28798/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28799///
28800/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28801/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28802///
28803/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28804///
28805/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28806///
28807/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28808#[derive(Clone, Eq, PartialEq)]
28809#[non_exhaustive]
28810pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
28811    None,
28812    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28813    Unknown(String),
28814}
28815impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
28816    pub fn as_str(&self) -> &str {
28817        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
28818        match self {
28819            None => "none",
28820            Unknown(v) => v,
28821        }
28822    }
28823}
28824
28825impl std::str::FromStr
28826    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
28827{
28828    type Err = std::convert::Infallible;
28829    fn from_str(s: &str) -> Result<Self, Self::Err> {
28830        use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*;
28831        match s {
28832            "none" => Ok(None),
28833            v => {
28834                tracing::warn!(
28835                    "Unknown value '{}' for enum '{}'",
28836                    v,
28837                    "ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage"
28838                );
28839                Ok(Unknown(v.to_owned()))
28840            }
28841        }
28842    }
28843}
28844impl std::fmt::Display
28845    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
28846{
28847    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28848        f.write_str(self.as_str())
28849    }
28850}
28851
28852impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
28853    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28854        f.write_str(self.as_str())
28855    }
28856}
28857impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage {
28858    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28859    where
28860        S: serde::Serializer,
28861    {
28862        serializer.serialize_str(self.as_str())
28863    }
28864}
28865#[cfg(feature = "deserialize")]
28866impl<'de> serde::Deserialize<'de>
28867    for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage
28868{
28869    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28870        use std::str::FromStr;
28871        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28872        Ok(Self::from_str(&s).expect("infallible"))
28873    }
28874}
28875/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
28876#[derive(Clone, Debug, serde::Serialize)]
28877pub struct ConfirmPaymentIntentPaymentMethodOptionsAlipay {
28878    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28879    ///
28880    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28881    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28882    ///
28883    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28884    ///
28885    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28886    ///
28887    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28888    #[serde(skip_serializing_if = "Option::is_none")]
28889    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage>,
28890}
28891impl ConfirmPaymentIntentPaymentMethodOptionsAlipay {
28892    pub fn new() -> Self {
28893        Self { setup_future_usage: None }
28894    }
28895}
28896impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlipay {
28897    fn default() -> Self {
28898        Self::new()
28899    }
28900}
28901/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
28902///
28903/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
28904/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
28905///
28906/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
28907///
28908/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
28909///
28910/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
28911#[derive(Clone, Eq, PartialEq)]
28912#[non_exhaustive]
28913pub enum ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
28914    None,
28915    OffSession,
28916    /// An unrecognized value from Stripe. Should not be used as a request parameter.
28917    Unknown(String),
28918}
28919impl ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
28920    pub fn as_str(&self) -> &str {
28921        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
28922        match self {
28923            None => "none",
28924            OffSession => "off_session",
28925            Unknown(v) => v,
28926        }
28927    }
28928}
28929
28930impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
28931    type Err = std::convert::Infallible;
28932    fn from_str(s: &str) -> Result<Self, Self::Err> {
28933        use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*;
28934        match s {
28935            "none" => Ok(None),
28936            "off_session" => Ok(OffSession),
28937            v => {
28938                tracing::warn!(
28939                    "Unknown value '{}' for enum '{}'",
28940                    v,
28941                    "ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage"
28942                );
28943                Ok(Unknown(v.to_owned()))
28944            }
28945        }
28946    }
28947}
28948impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
28949    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28950        f.write_str(self.as_str())
28951    }
28952}
28953
28954impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
28955    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28956        f.write_str(self.as_str())
28957    }
28958}
28959impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage {
28960    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
28961    where
28962        S: serde::Serializer,
28963    {
28964        serializer.serialize_str(self.as_str())
28965    }
28966}
28967#[cfg(feature = "deserialize")]
28968impl<'de> serde::Deserialize<'de>
28969    for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage
28970{
28971    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
28972        use std::str::FromStr;
28973        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
28974        Ok(Self::from_str(&s).expect("infallible"))
28975    }
28976}
28977/// If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options.
28978#[derive(Clone, Debug, serde::Serialize)]
28979pub struct ConfirmPaymentIntentPaymentMethodOptionsAlma {
28980    /// Controls when the funds are captured from the customer's account.
28981    ///
28982    /// 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.
28983    ///
28984    /// 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.
28985    #[serde(skip_serializing_if = "Option::is_none")]
28986    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod>,
28987}
28988impl ConfirmPaymentIntentPaymentMethodOptionsAlma {
28989    pub fn new() -> Self {
28990        Self { capture_method: None }
28991    }
28992}
28993impl Default for ConfirmPaymentIntentPaymentMethodOptionsAlma {
28994    fn default() -> Self {
28995        Self::new()
28996    }
28997}
28998/// Controls when the funds are captured from the customer's account.
28999///
29000/// 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.
29001///
29002/// 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.
29003#[derive(Clone, Eq, PartialEq)]
29004#[non_exhaustive]
29005pub enum ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29006    Manual,
29007    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29008    Unknown(String),
29009}
29010impl ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29011    pub fn as_str(&self) -> &str {
29012        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
29013        match self {
29014            Manual => "manual",
29015            Unknown(v) => v,
29016        }
29017    }
29018}
29019
29020impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29021    type Err = std::convert::Infallible;
29022    fn from_str(s: &str) -> Result<Self, Self::Err> {
29023        use ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod::*;
29024        match s {
29025            "manual" => Ok(Manual),
29026            v => {
29027                tracing::warn!(
29028                    "Unknown value '{}' for enum '{}'",
29029                    v,
29030                    "ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod"
29031                );
29032                Ok(Unknown(v.to_owned()))
29033            }
29034        }
29035    }
29036}
29037impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29038    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29039        f.write_str(self.as_str())
29040    }
29041}
29042
29043impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29044    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29045        f.write_str(self.as_str())
29046    }
29047}
29048impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29049    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29050    where
29051        S: serde::Serializer,
29052    {
29053        serializer.serialize_str(self.as_str())
29054    }
29055}
29056#[cfg(feature = "deserialize")]
29057impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsAlmaCaptureMethod {
29058    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29059        use std::str::FromStr;
29060        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29061        Ok(Self::from_str(&s).expect("infallible"))
29062    }
29063}
29064/// If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options.
29065#[derive(Clone, Debug, serde::Serialize)]
29066pub struct ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
29067    /// Controls when the funds are captured from the customer's account.
29068    ///
29069    /// 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.
29070    ///
29071    /// 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.
29072    #[serde(skip_serializing_if = "Option::is_none")]
29073    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod>,
29074    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29075    ///
29076    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29077    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29078    ///
29079    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29080    ///
29081    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29082    #[serde(skip_serializing_if = "Option::is_none")]
29083    pub setup_future_usage:
29084        Option<ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage>,
29085}
29086impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
29087    pub fn new() -> Self {
29088        Self { capture_method: None, setup_future_usage: None }
29089    }
29090}
29091impl Default for ConfirmPaymentIntentPaymentMethodOptionsAmazonPay {
29092    fn default() -> Self {
29093        Self::new()
29094    }
29095}
29096/// Controls when the funds are captured from the customer's account.
29097///
29098/// 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.
29099///
29100/// 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.
29101#[derive(Clone, Eq, PartialEq)]
29102#[non_exhaustive]
29103pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
29104    Manual,
29105    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29106    Unknown(String),
29107}
29108impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
29109    pub fn as_str(&self) -> &str {
29110        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
29111        match self {
29112            Manual => "manual",
29113            Unknown(v) => v,
29114        }
29115    }
29116}
29117
29118impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
29119    type Err = std::convert::Infallible;
29120    fn from_str(s: &str) -> Result<Self, Self::Err> {
29121        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod::*;
29122        match s {
29123            "manual" => Ok(Manual),
29124            v => {
29125                tracing::warn!(
29126                    "Unknown value '{}' for enum '{}'",
29127                    v,
29128                    "ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod"
29129                );
29130                Ok(Unknown(v.to_owned()))
29131            }
29132        }
29133    }
29134}
29135impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
29136    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29137        f.write_str(self.as_str())
29138    }
29139}
29140
29141impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
29142    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29143        f.write_str(self.as_str())
29144    }
29145}
29146impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod {
29147    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29148    where
29149        S: serde::Serializer,
29150    {
29151        serializer.serialize_str(self.as_str())
29152    }
29153}
29154#[cfg(feature = "deserialize")]
29155impl<'de> serde::Deserialize<'de>
29156    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPayCaptureMethod
29157{
29158    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29159        use std::str::FromStr;
29160        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29161        Ok(Self::from_str(&s).expect("infallible"))
29162    }
29163}
29164/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29165///
29166/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29167/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29168///
29169/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29170///
29171/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29172#[derive(Clone, Eq, PartialEq)]
29173#[non_exhaustive]
29174pub enum ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
29175    None,
29176    OffSession,
29177    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29178    Unknown(String),
29179}
29180impl ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
29181    pub fn as_str(&self) -> &str {
29182        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
29183        match self {
29184            None => "none",
29185            OffSession => "off_session",
29186            Unknown(v) => v,
29187        }
29188    }
29189}
29190
29191impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
29192    type Err = std::convert::Infallible;
29193    fn from_str(s: &str) -> Result<Self, Self::Err> {
29194        use ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage::*;
29195        match s {
29196            "none" => Ok(None),
29197            "off_session" => Ok(OffSession),
29198            v => {
29199                tracing::warn!(
29200                    "Unknown value '{}' for enum '{}'",
29201                    v,
29202                    "ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage"
29203                );
29204                Ok(Unknown(v.to_owned()))
29205            }
29206        }
29207    }
29208}
29209impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
29210    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29211        f.write_str(self.as_str())
29212    }
29213}
29214
29215impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
29216    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29217        f.write_str(self.as_str())
29218    }
29219}
29220impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage {
29221    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29222    where
29223        S: serde::Serializer,
29224    {
29225        serializer.serialize_str(self.as_str())
29226    }
29227}
29228#[cfg(feature = "deserialize")]
29229impl<'de> serde::Deserialize<'de>
29230    for ConfirmPaymentIntentPaymentMethodOptionsAmazonPaySetupFutureUsage
29231{
29232    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29233        use std::str::FromStr;
29234        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29235        Ok(Self::from_str(&s).expect("infallible"))
29236    }
29237}
29238/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
29239#[derive(Clone, Debug, serde::Serialize)]
29240pub struct ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
29241    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29242    ///
29243    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29244    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29245    ///
29246    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29247    ///
29248    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29249    ///
29250    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29251    #[serde(skip_serializing_if = "Option::is_none")]
29252    pub setup_future_usage:
29253        Option<ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage>,
29254    /// Controls when Stripe will attempt to debit the funds from the customer's account.
29255    /// The date must be a string in YYYY-MM-DD format.
29256    /// The date must be in the future and between 3 and 15 calendar days from now.
29257    #[serde(skip_serializing_if = "Option::is_none")]
29258    pub target_date: Option<String>,
29259}
29260impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
29261    pub fn new() -> Self {
29262        Self { setup_future_usage: None, target_date: None }
29263    }
29264}
29265impl Default for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit {
29266    fn default() -> Self {
29267        Self::new()
29268    }
29269}
29270/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29271///
29272/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29273/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29274///
29275/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29276///
29277/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29278///
29279/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29280#[derive(Clone, Eq, PartialEq)]
29281#[non_exhaustive]
29282pub enum ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
29283    None,
29284    OffSession,
29285    OnSession,
29286    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29287    Unknown(String),
29288}
29289impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
29290    pub fn as_str(&self) -> &str {
29291        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
29292        match self {
29293            None => "none",
29294            OffSession => "off_session",
29295            OnSession => "on_session",
29296            Unknown(v) => v,
29297        }
29298    }
29299}
29300
29301impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
29302    type Err = std::convert::Infallible;
29303    fn from_str(s: &str) -> Result<Self, Self::Err> {
29304        use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*;
29305        match s {
29306            "none" => Ok(None),
29307            "off_session" => Ok(OffSession),
29308            "on_session" => Ok(OnSession),
29309            v => {
29310                tracing::warn!(
29311                    "Unknown value '{}' for enum '{}'",
29312                    v,
29313                    "ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage"
29314                );
29315                Ok(Unknown(v.to_owned()))
29316            }
29317        }
29318    }
29319}
29320impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
29321    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29322        f.write_str(self.as_str())
29323    }
29324}
29325
29326impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
29327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29328        f.write_str(self.as_str())
29329    }
29330}
29331impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage {
29332    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29333    where
29334        S: serde::Serializer,
29335    {
29336        serializer.serialize_str(self.as_str())
29337    }
29338}
29339#[cfg(feature = "deserialize")]
29340impl<'de> serde::Deserialize<'de>
29341    for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage
29342{
29343    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29344        use std::str::FromStr;
29345        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29346        Ok(Self::from_str(&s).expect("infallible"))
29347    }
29348}
29349/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
29350#[derive(Clone, Debug, serde::Serialize)]
29351pub struct ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
29352    /// Additional fields for Mandate creation
29353    #[serde(skip_serializing_if = "Option::is_none")]
29354    pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
29355    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29356    ///
29357    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29358    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29359    ///
29360    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29361    ///
29362    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29363    ///
29364    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29365    #[serde(skip_serializing_if = "Option::is_none")]
29366    pub setup_future_usage:
29367        Option<ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage>,
29368    /// Controls when Stripe will attempt to debit the funds from the customer's account.
29369    /// The date must be a string in YYYY-MM-DD format.
29370    /// The date must be in the future and between 3 and 15 calendar days from now.
29371    #[serde(skip_serializing_if = "Option::is_none")]
29372    pub target_date: Option<String>,
29373}
29374impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
29375    pub fn new() -> Self {
29376        Self { mandate_options: None, setup_future_usage: None, target_date: None }
29377    }
29378}
29379impl Default for ConfirmPaymentIntentPaymentMethodOptionsBacsDebit {
29380    fn default() -> Self {
29381        Self::new()
29382    }
29383}
29384/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29385///
29386/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29387/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29388///
29389/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29390///
29391/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29392///
29393/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29394#[derive(Clone, Eq, PartialEq)]
29395#[non_exhaustive]
29396pub enum ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
29397    None,
29398    OffSession,
29399    OnSession,
29400    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29401    Unknown(String),
29402}
29403impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
29404    pub fn as_str(&self) -> &str {
29405        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
29406        match self {
29407            None => "none",
29408            OffSession => "off_session",
29409            OnSession => "on_session",
29410            Unknown(v) => v,
29411        }
29412    }
29413}
29414
29415impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
29416    type Err = std::convert::Infallible;
29417    fn from_str(s: &str) -> Result<Self, Self::Err> {
29418        use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*;
29419        match s {
29420            "none" => Ok(None),
29421            "off_session" => Ok(OffSession),
29422            "on_session" => Ok(OnSession),
29423            v => {
29424                tracing::warn!(
29425                    "Unknown value '{}' for enum '{}'",
29426                    v,
29427                    "ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage"
29428                );
29429                Ok(Unknown(v.to_owned()))
29430            }
29431        }
29432    }
29433}
29434impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
29435    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29436        f.write_str(self.as_str())
29437    }
29438}
29439
29440impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
29441    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29442        f.write_str(self.as_str())
29443    }
29444}
29445impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage {
29446    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29447    where
29448        S: serde::Serializer,
29449    {
29450        serializer.serialize_str(self.as_str())
29451    }
29452}
29453#[cfg(feature = "deserialize")]
29454impl<'de> serde::Deserialize<'de>
29455    for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage
29456{
29457    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29458        use std::str::FromStr;
29459        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29460        Ok(Self::from_str(&s).expect("infallible"))
29461    }
29462}
29463/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
29464#[derive(Clone, Debug, serde::Serialize)]
29465pub struct ConfirmPaymentIntentPaymentMethodOptionsBancontact {
29466    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
29467    #[serde(skip_serializing_if = "Option::is_none")]
29468    pub preferred_language:
29469        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage>,
29470    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29471    ///
29472    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29473    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29474    ///
29475    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29476    ///
29477    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29478    ///
29479    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29480    #[serde(skip_serializing_if = "Option::is_none")]
29481    pub setup_future_usage:
29482        Option<ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage>,
29483}
29484impl ConfirmPaymentIntentPaymentMethodOptionsBancontact {
29485    pub fn new() -> Self {
29486        Self { preferred_language: None, setup_future_usage: None }
29487    }
29488}
29489impl Default for ConfirmPaymentIntentPaymentMethodOptionsBancontact {
29490    fn default() -> Self {
29491        Self::new()
29492    }
29493}
29494/// Preferred language of the Bancontact authorization page that the customer is redirected to.
29495#[derive(Clone, Eq, PartialEq)]
29496#[non_exhaustive]
29497pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
29498    De,
29499    En,
29500    Fr,
29501    Nl,
29502    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29503    Unknown(String),
29504}
29505impl ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
29506    pub fn as_str(&self) -> &str {
29507        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
29508        match self {
29509            De => "de",
29510            En => "en",
29511            Fr => "fr",
29512            Nl => "nl",
29513            Unknown(v) => v,
29514        }
29515    }
29516}
29517
29518impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
29519    type Err = std::convert::Infallible;
29520    fn from_str(s: &str) -> Result<Self, Self::Err> {
29521        use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*;
29522        match s {
29523            "de" => Ok(De),
29524            "en" => Ok(En),
29525            "fr" => Ok(Fr),
29526            "nl" => Ok(Nl),
29527            v => {
29528                tracing::warn!(
29529                    "Unknown value '{}' for enum '{}'",
29530                    v,
29531                    "ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage"
29532                );
29533                Ok(Unknown(v.to_owned()))
29534            }
29535        }
29536    }
29537}
29538impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
29539    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29540        f.write_str(self.as_str())
29541    }
29542}
29543
29544impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
29545    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29546        f.write_str(self.as_str())
29547    }
29548}
29549impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage {
29550    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29551    where
29552        S: serde::Serializer,
29553    {
29554        serializer.serialize_str(self.as_str())
29555    }
29556}
29557#[cfg(feature = "deserialize")]
29558impl<'de> serde::Deserialize<'de>
29559    for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage
29560{
29561    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29562        use std::str::FromStr;
29563        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29564        Ok(Self::from_str(&s).expect("infallible"))
29565    }
29566}
29567/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29568///
29569/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29570/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29571///
29572/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29573///
29574/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29575///
29576/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29577#[derive(Clone, Eq, PartialEq)]
29578#[non_exhaustive]
29579pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
29580    None,
29581    OffSession,
29582    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29583    Unknown(String),
29584}
29585impl ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
29586    pub fn as_str(&self) -> &str {
29587        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
29588        match self {
29589            None => "none",
29590            OffSession => "off_session",
29591            Unknown(v) => v,
29592        }
29593    }
29594}
29595
29596impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
29597    type Err = std::convert::Infallible;
29598    fn from_str(s: &str) -> Result<Self, Self::Err> {
29599        use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*;
29600        match s {
29601            "none" => Ok(None),
29602            "off_session" => Ok(OffSession),
29603            v => {
29604                tracing::warn!(
29605                    "Unknown value '{}' for enum '{}'",
29606                    v,
29607                    "ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage"
29608                );
29609                Ok(Unknown(v.to_owned()))
29610            }
29611        }
29612    }
29613}
29614impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
29615    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29616        f.write_str(self.as_str())
29617    }
29618}
29619
29620impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
29621    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29622        f.write_str(self.as_str())
29623    }
29624}
29625impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage {
29626    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29627    where
29628        S: serde::Serializer,
29629    {
29630        serializer.serialize_str(self.as_str())
29631    }
29632}
29633#[cfg(feature = "deserialize")]
29634impl<'de> serde::Deserialize<'de>
29635    for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage
29636{
29637    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29638        use std::str::FromStr;
29639        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29640        Ok(Self::from_str(&s).expect("infallible"))
29641    }
29642}
29643/// If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options.
29644#[derive(Clone, Debug, serde::Serialize)]
29645pub struct ConfirmPaymentIntentPaymentMethodOptionsBillie {
29646    /// Controls when the funds are captured from the customer's account.
29647    ///
29648    /// 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.
29649    ///
29650    /// 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.
29651    #[serde(skip_serializing_if = "Option::is_none")]
29652    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod>,
29653}
29654impl ConfirmPaymentIntentPaymentMethodOptionsBillie {
29655    pub fn new() -> Self {
29656        Self { capture_method: None }
29657    }
29658}
29659impl Default for ConfirmPaymentIntentPaymentMethodOptionsBillie {
29660    fn default() -> Self {
29661        Self::new()
29662    }
29663}
29664/// Controls when the funds are captured from the customer's account.
29665///
29666/// 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.
29667///
29668/// 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.
29669#[derive(Clone, Eq, PartialEq)]
29670#[non_exhaustive]
29671pub enum ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29672    Manual,
29673    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29674    Unknown(String),
29675}
29676impl ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29677    pub fn as_str(&self) -> &str {
29678        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
29679        match self {
29680            Manual => "manual",
29681            Unknown(v) => v,
29682        }
29683    }
29684}
29685
29686impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29687    type Err = std::convert::Infallible;
29688    fn from_str(s: &str) -> Result<Self, Self::Err> {
29689        use ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod::*;
29690        match s {
29691            "manual" => Ok(Manual),
29692            v => {
29693                tracing::warn!(
29694                    "Unknown value '{}' for enum '{}'",
29695                    v,
29696                    "ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod"
29697                );
29698                Ok(Unknown(v.to_owned()))
29699            }
29700        }
29701    }
29702}
29703impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29704    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29705        f.write_str(self.as_str())
29706    }
29707}
29708
29709impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29710    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29711        f.write_str(self.as_str())
29712    }
29713}
29714impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29715    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29716    where
29717        S: serde::Serializer,
29718    {
29719        serializer.serialize_str(self.as_str())
29720    }
29721}
29722#[cfg(feature = "deserialize")]
29723impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBillieCaptureMethod {
29724    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29725        use std::str::FromStr;
29726        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29727        Ok(Self::from_str(&s).expect("infallible"))
29728    }
29729}
29730/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
29731#[derive(Clone, Debug, serde::Serialize)]
29732pub struct ConfirmPaymentIntentPaymentMethodOptionsBlik {
29733    /// The 6-digit BLIK code that a customer has generated using their banking application.
29734    /// Can only be set on confirmation.
29735    #[serde(skip_serializing_if = "Option::is_none")]
29736    pub code: Option<String>,
29737    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29738    ///
29739    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29740    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29741    ///
29742    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29743    ///
29744    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29745    ///
29746    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29747    #[serde(skip_serializing_if = "Option::is_none")]
29748    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage>,
29749}
29750impl ConfirmPaymentIntentPaymentMethodOptionsBlik {
29751    pub fn new() -> Self {
29752        Self { code: None, setup_future_usage: None }
29753    }
29754}
29755impl Default for ConfirmPaymentIntentPaymentMethodOptionsBlik {
29756    fn default() -> Self {
29757        Self::new()
29758    }
29759}
29760/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29761///
29762/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29763/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29764///
29765/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29766///
29767/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29768///
29769/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29770#[derive(Clone, Eq, PartialEq)]
29771#[non_exhaustive]
29772pub enum ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29773    None,
29774    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29775    Unknown(String),
29776}
29777impl ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29778    pub fn as_str(&self) -> &str {
29779        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
29780        match self {
29781            None => "none",
29782            Unknown(v) => v,
29783        }
29784    }
29785}
29786
29787impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29788    type Err = std::convert::Infallible;
29789    fn from_str(s: &str) -> Result<Self, Self::Err> {
29790        use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*;
29791        match s {
29792            "none" => Ok(None),
29793            v => {
29794                tracing::warn!(
29795                    "Unknown value '{}' for enum '{}'",
29796                    v,
29797                    "ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage"
29798                );
29799                Ok(Unknown(v.to_owned()))
29800            }
29801        }
29802    }
29803}
29804impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29806        f.write_str(self.as_str())
29807    }
29808}
29809
29810impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29812        f.write_str(self.as_str())
29813    }
29814}
29815impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29817    where
29818        S: serde::Serializer,
29819    {
29820        serializer.serialize_str(self.as_str())
29821    }
29822}
29823#[cfg(feature = "deserialize")]
29824impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage {
29825    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29826        use std::str::FromStr;
29827        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29828        Ok(Self::from_str(&s).expect("infallible"))
29829    }
29830}
29831/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
29832#[derive(Clone, Debug, serde::Serialize)]
29833pub struct ConfirmPaymentIntentPaymentMethodOptionsBoleto {
29834    /// The number of calendar days before a Boleto voucher expires.
29835    /// 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.
29836    #[serde(skip_serializing_if = "Option::is_none")]
29837    pub expires_after_days: Option<u32>,
29838    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29839    ///
29840    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29841    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29842    ///
29843    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29844    ///
29845    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29846    ///
29847    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29848    #[serde(skip_serializing_if = "Option::is_none")]
29849    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage>,
29850}
29851impl ConfirmPaymentIntentPaymentMethodOptionsBoleto {
29852    pub fn new() -> Self {
29853        Self { expires_after_days: None, setup_future_usage: None }
29854    }
29855}
29856impl Default for ConfirmPaymentIntentPaymentMethodOptionsBoleto {
29857    fn default() -> Self {
29858        Self::new()
29859    }
29860}
29861/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
29862///
29863/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
29864/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
29865///
29866/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
29867///
29868/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
29869///
29870/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
29871#[derive(Clone, Eq, PartialEq)]
29872#[non_exhaustive]
29873pub enum ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
29874    None,
29875    OffSession,
29876    OnSession,
29877    /// An unrecognized value from Stripe. Should not be used as a request parameter.
29878    Unknown(String),
29879}
29880impl ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
29881    pub fn as_str(&self) -> &str {
29882        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
29883        match self {
29884            None => "none",
29885            OffSession => "off_session",
29886            OnSession => "on_session",
29887            Unknown(v) => v,
29888        }
29889    }
29890}
29891
29892impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
29893    type Err = std::convert::Infallible;
29894    fn from_str(s: &str) -> Result<Self, Self::Err> {
29895        use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*;
29896        match s {
29897            "none" => Ok(None),
29898            "off_session" => Ok(OffSession),
29899            "on_session" => Ok(OnSession),
29900            v => {
29901                tracing::warn!(
29902                    "Unknown value '{}' for enum '{}'",
29903                    v,
29904                    "ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage"
29905                );
29906                Ok(Unknown(v.to_owned()))
29907            }
29908        }
29909    }
29910}
29911impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
29912    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29913        f.write_str(self.as_str())
29914    }
29915}
29916
29917impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
29918    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29919        f.write_str(self.as_str())
29920    }
29921}
29922impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage {
29923    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
29924    where
29925        S: serde::Serializer,
29926    {
29927        serializer.serialize_str(self.as_str())
29928    }
29929}
29930#[cfg(feature = "deserialize")]
29931impl<'de> serde::Deserialize<'de>
29932    for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage
29933{
29934    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
29935        use std::str::FromStr;
29936        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
29937        Ok(Self::from_str(&s).expect("infallible"))
29938    }
29939}
29940/// Configuration for any card payments attempted on this PaymentIntent.
29941#[derive(Clone, Debug, serde::Serialize)]
29942pub struct ConfirmPaymentIntentPaymentMethodOptionsCard {
29943    /// Controls when the funds are captured from the customer's account.
29944    ///
29945    /// 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.
29946    ///
29947    /// 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.
29948    #[serde(skip_serializing_if = "Option::is_none")]
29949    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod>,
29950    /// A single-use `cvc_update` Token that represents a card CVC value.
29951    /// When provided, the CVC value will be verified during the card payment attempt.
29952    /// This parameter can only be provided during confirmation.
29953    #[serde(skip_serializing_if = "Option::is_none")]
29954    pub cvc_token: Option<String>,
29955    /// Installment configuration for payments attempted on this PaymentIntent.
29956    ///
29957    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
29958    #[serde(skip_serializing_if = "Option::is_none")]
29959    pub installments: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallments>,
29960    /// Configuration options for setting up an eMandate for cards issued in India.
29961    #[serde(skip_serializing_if = "Option::is_none")]
29962    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions>,
29963    /// When specified, this parameter indicates that a transaction will be marked
29964    /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This
29965    /// parameter can only be provided during confirmation.
29966    #[serde(skip_serializing_if = "Option::is_none")]
29967    pub moto: Option<bool>,
29968    /// Selected network to process this PaymentIntent on.
29969    /// Depends on the available networks of the card attached to the PaymentIntent.
29970    /// Can be only set confirm-time.
29971    #[serde(skip_serializing_if = "Option::is_none")]
29972    pub network: Option<ConfirmPaymentIntentPaymentMethodOptionsCardNetwork>,
29973    /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
29974    #[serde(skip_serializing_if = "Option::is_none")]
29975    pub request_extended_authorization:
29976        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization>,
29977    /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
29978    #[serde(skip_serializing_if = "Option::is_none")]
29979    pub request_incremental_authorization:
29980        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization>,
29981    /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
29982    #[serde(skip_serializing_if = "Option::is_none")]
29983    pub request_multicapture:
29984        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture>,
29985    /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
29986    #[serde(skip_serializing_if = "Option::is_none")]
29987    pub request_overcapture: Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture>,
29988    /// 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).
29989    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
29990    /// If not provided, this value defaults to `automatic`.
29991    /// 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.
29992    #[serde(skip_serializing_if = "Option::is_none")]
29993    pub request_three_d_secure:
29994        Option<ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,
29995    /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e.
29996    /// using the cvc_token parameter).
29997    #[serde(skip_serializing_if = "Option::is_none")]
29998    pub require_cvc_recollection: Option<bool>,
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    #[serde(skip_serializing_if = "Option::is_none")]
30010    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage>,
30011    /// Provides information about a card payment that customers see on their statements.
30012    /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor.
30013    /// Maximum 22 characters.
30014    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
30015    #[serde(skip_serializing_if = "Option::is_none")]
30016    pub statement_descriptor_suffix_kana: Option<String>,
30017    /// Provides information about a card payment that customers see on their statements.
30018    /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor.
30019    /// Maximum 17 characters.
30020    /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
30021    #[serde(skip_serializing_if = "Option::is_none")]
30022    pub statement_descriptor_suffix_kanji: Option<String>,
30023    /// If 3D Secure authentication was performed with a third-party provider,
30024    /// the authentication details to use for this payment.
30025    #[serde(skip_serializing_if = "Option::is_none")]
30026    pub three_d_secure: Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure>,
30027}
30028impl ConfirmPaymentIntentPaymentMethodOptionsCard {
30029    pub fn new() -> Self {
30030        Self {
30031            capture_method: None,
30032            cvc_token: None,
30033            installments: None,
30034            mandate_options: None,
30035            moto: None,
30036            network: None,
30037            request_extended_authorization: None,
30038            request_incremental_authorization: None,
30039            request_multicapture: None,
30040            request_overcapture: None,
30041            request_three_d_secure: None,
30042            require_cvc_recollection: None,
30043            setup_future_usage: None,
30044            statement_descriptor_suffix_kana: None,
30045            statement_descriptor_suffix_kanji: None,
30046            three_d_secure: None,
30047        }
30048    }
30049}
30050impl Default for ConfirmPaymentIntentPaymentMethodOptionsCard {
30051    fn default() -> Self {
30052        Self::new()
30053    }
30054}
30055/// Controls when the funds are captured from the customer's account.
30056///
30057/// 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.
30058///
30059/// 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.
30060#[derive(Clone, Eq, PartialEq)]
30061#[non_exhaustive]
30062pub enum ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30063    Manual,
30064    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30065    Unknown(String),
30066}
30067impl ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30068    pub fn as_str(&self) -> &str {
30069        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
30070        match self {
30071            Manual => "manual",
30072            Unknown(v) => v,
30073        }
30074    }
30075}
30076
30077impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30078    type Err = std::convert::Infallible;
30079    fn from_str(s: &str) -> Result<Self, Self::Err> {
30080        use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*;
30081        match s {
30082            "manual" => Ok(Manual),
30083            v => {
30084                tracing::warn!(
30085                    "Unknown value '{}' for enum '{}'",
30086                    v,
30087                    "ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod"
30088                );
30089                Ok(Unknown(v.to_owned()))
30090            }
30091        }
30092    }
30093}
30094impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30095    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30096        f.write_str(self.as_str())
30097    }
30098}
30099
30100impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30101    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30102        f.write_str(self.as_str())
30103    }
30104}
30105impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30106    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30107    where
30108        S: serde::Serializer,
30109    {
30110        serializer.serialize_str(self.as_str())
30111    }
30112}
30113#[cfg(feature = "deserialize")]
30114impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod {
30115    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30116        use std::str::FromStr;
30117        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30118        Ok(Self::from_str(&s).expect("infallible"))
30119    }
30120}
30121/// Installment configuration for payments attempted on this PaymentIntent.
30122///
30123/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
30124#[derive(Clone, Debug, serde::Serialize)]
30125pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
30126    /// Setting to true enables installments for this PaymentIntent.
30127    /// This will cause the response to contain a list of available installment plans.
30128    /// Setting to false will prevent any selected plan from applying to a charge.
30129    #[serde(skip_serializing_if = "Option::is_none")]
30130    pub enabled: Option<bool>,
30131    /// The selected installment plan to use for this payment attempt.
30132    /// This parameter can only be provided during confirmation.
30133    #[serde(skip_serializing_if = "Option::is_none")]
30134    pub plan: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan>,
30135}
30136impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
30137    pub fn new() -> Self {
30138        Self { enabled: None, plan: None }
30139    }
30140}
30141impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardInstallments {
30142    fn default() -> Self {
30143        Self::new()
30144    }
30145}
30146/// The selected installment plan to use for this payment attempt.
30147/// This parameter can only be provided during confirmation.
30148#[derive(Clone, Debug, serde::Serialize)]
30149pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
30150    /// For `fixed_count` installment plans, this is required.
30151    /// It represents the number of installment payments your customer will make to their credit card.
30152    #[serde(skip_serializing_if = "Option::is_none")]
30153    pub count: Option<u64>,
30154    /// For `fixed_count` installment plans, this is required.
30155    /// It represents the interval between installment payments your customer will make to their credit card.
30156    /// One of `month`.
30157    #[serde(skip_serializing_if = "Option::is_none")]
30158    pub interval: Option<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval>,
30159    /// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
30160    #[serde(rename = "type")]
30161    pub type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
30162}
30163impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
30164    pub fn new(
30165        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType>,
30166    ) -> Self {
30167        Self { count: None, interval: None, type_: type_.into() }
30168    }
30169}
30170/// For `fixed_count` installment plans, this is required.
30171/// It represents the interval between installment payments your customer will make to their credit card.
30172/// One of `month`.
30173#[derive(Clone, Eq, PartialEq)]
30174#[non_exhaustive]
30175pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
30176    Month,
30177    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30178    Unknown(String),
30179}
30180impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
30181    pub fn as_str(&self) -> &str {
30182        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
30183        match self {
30184            Month => "month",
30185            Unknown(v) => v,
30186        }
30187    }
30188}
30189
30190impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
30191    type Err = std::convert::Infallible;
30192    fn from_str(s: &str) -> Result<Self, Self::Err> {
30193        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*;
30194        match s {
30195            "month" => Ok(Month),
30196            v => {
30197                tracing::warn!(
30198                    "Unknown value '{}' for enum '{}'",
30199                    v,
30200                    "ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval"
30201                );
30202                Ok(Unknown(v.to_owned()))
30203            }
30204        }
30205    }
30206}
30207impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
30208    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30209        f.write_str(self.as_str())
30210    }
30211}
30212
30213impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
30214    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30215        f.write_str(self.as_str())
30216    }
30217}
30218impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval {
30219    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30220    where
30221        S: serde::Serializer,
30222    {
30223        serializer.serialize_str(self.as_str())
30224    }
30225}
30226#[cfg(feature = "deserialize")]
30227impl<'de> serde::Deserialize<'de>
30228    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval
30229{
30230    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30231        use std::str::FromStr;
30232        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30233        Ok(Self::from_str(&s).expect("infallible"))
30234    }
30235}
30236/// Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
30237#[derive(Clone, Eq, PartialEq)]
30238#[non_exhaustive]
30239pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
30240    Bonus,
30241    FixedCount,
30242    Revolving,
30243    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30244    Unknown(String),
30245}
30246impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
30247    pub fn as_str(&self) -> &str {
30248        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
30249        match self {
30250            Bonus => "bonus",
30251            FixedCount => "fixed_count",
30252            Revolving => "revolving",
30253            Unknown(v) => v,
30254        }
30255    }
30256}
30257
30258impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
30259    type Err = std::convert::Infallible;
30260    fn from_str(s: &str) -> Result<Self, Self::Err> {
30261        use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*;
30262        match s {
30263            "bonus" => Ok(Bonus),
30264            "fixed_count" => Ok(FixedCount),
30265            "revolving" => Ok(Revolving),
30266            v => {
30267                tracing::warn!(
30268                    "Unknown value '{}' for enum '{}'",
30269                    v,
30270                    "ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType"
30271                );
30272                Ok(Unknown(v.to_owned()))
30273            }
30274        }
30275    }
30276}
30277impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
30278    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30279        f.write_str(self.as_str())
30280    }
30281}
30282
30283impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
30284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30285        f.write_str(self.as_str())
30286    }
30287}
30288impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType {
30289    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30290    where
30291        S: serde::Serializer,
30292    {
30293        serializer.serialize_str(self.as_str())
30294    }
30295}
30296#[cfg(feature = "deserialize")]
30297impl<'de> serde::Deserialize<'de>
30298    for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType
30299{
30300    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30301        use std::str::FromStr;
30302        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30303        Ok(Self::from_str(&s).expect("infallible"))
30304    }
30305}
30306/// Configuration options for setting up an eMandate for cards issued in India.
30307#[derive(Clone, Debug, serde::Serialize)]
30308pub struct ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
30309    /// Amount to be charged for future payments.
30310    pub amount: i64,
30311    /// One of `fixed` or `maximum`.
30312    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
30313    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
30314    pub amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType,
30315    /// A description of the mandate or subscription that is meant to be displayed to the customer.
30316    #[serde(skip_serializing_if = "Option::is_none")]
30317    pub description: Option<String>,
30318    /// End date of the mandate or subscription.
30319    /// If not provided, the mandate will be active until canceled.
30320    /// If provided, end date should be after start date.
30321    #[serde(skip_serializing_if = "Option::is_none")]
30322    pub end_date: Option<stripe_types::Timestamp>,
30323    /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
30324    pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval,
30325    /// The number of intervals between payments.
30326    /// For example, `interval=month` and `interval_count=3` indicates one payment every three months.
30327    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
30328    /// This parameter is optional when `interval=sporadic`.
30329    #[serde(skip_serializing_if = "Option::is_none")]
30330    pub interval_count: Option<u64>,
30331    /// Unique identifier for the mandate or subscription.
30332    pub reference: String,
30333    /// Start date of the mandate or subscription. Start date should not be lesser than yesterday.
30334    pub start_date: stripe_types::Timestamp,
30335    /// Specifies the type of mandates supported. Possible values are `india`.
30336    #[serde(skip_serializing_if = "Option::is_none")]
30337    pub supported_types:
30338        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
30339}
30340impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions {
30341    pub fn new(
30342        amount: impl Into<i64>,
30343        amount_type: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
30344        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval>,
30345        reference: impl Into<String>,
30346        start_date: impl Into<stripe_types::Timestamp>,
30347    ) -> Self {
30348        Self {
30349            amount: amount.into(),
30350            amount_type: amount_type.into(),
30351            description: None,
30352            end_date: None,
30353            interval: interval.into(),
30354            interval_count: None,
30355            reference: reference.into(),
30356            start_date: start_date.into(),
30357            supported_types: None,
30358        }
30359    }
30360}
30361/// One of `fixed` or `maximum`.
30362/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
30363/// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
30364#[derive(Clone, Eq, PartialEq)]
30365#[non_exhaustive]
30366pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
30367    Fixed,
30368    Maximum,
30369    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30370    Unknown(String),
30371}
30372impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
30373    pub fn as_str(&self) -> &str {
30374        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
30375        match self {
30376            Fixed => "fixed",
30377            Maximum => "maximum",
30378            Unknown(v) => v,
30379        }
30380    }
30381}
30382
30383impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
30384    type Err = std::convert::Infallible;
30385    fn from_str(s: &str) -> Result<Self, Self::Err> {
30386        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
30387        match s {
30388            "fixed" => Ok(Fixed),
30389            "maximum" => Ok(Maximum),
30390            v => {
30391                tracing::warn!(
30392                    "Unknown value '{}' for enum '{}'",
30393                    v,
30394                    "ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType"
30395                );
30396                Ok(Unknown(v.to_owned()))
30397            }
30398        }
30399    }
30400}
30401impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
30402    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30403        f.write_str(self.as_str())
30404    }
30405}
30406
30407impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
30408    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30409        f.write_str(self.as_str())
30410    }
30411}
30412impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType {
30413    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30414    where
30415        S: serde::Serializer,
30416    {
30417        serializer.serialize_str(self.as_str())
30418    }
30419}
30420#[cfg(feature = "deserialize")]
30421impl<'de> serde::Deserialize<'de>
30422    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType
30423{
30424    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30425        use std::str::FromStr;
30426        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30427        Ok(Self::from_str(&s).expect("infallible"))
30428    }
30429}
30430/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
30431#[derive(Clone, Eq, PartialEq)]
30432#[non_exhaustive]
30433pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
30434    Day,
30435    Month,
30436    Sporadic,
30437    Week,
30438    Year,
30439    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30440    Unknown(String),
30441}
30442impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
30443    pub fn as_str(&self) -> &str {
30444        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
30445        match self {
30446            Day => "day",
30447            Month => "month",
30448            Sporadic => "sporadic",
30449            Week => "week",
30450            Year => "year",
30451            Unknown(v) => v,
30452        }
30453    }
30454}
30455
30456impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
30457    type Err = std::convert::Infallible;
30458    fn from_str(s: &str) -> Result<Self, Self::Err> {
30459        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
30460        match s {
30461            "day" => Ok(Day),
30462            "month" => Ok(Month),
30463            "sporadic" => Ok(Sporadic),
30464            "week" => Ok(Week),
30465            "year" => Ok(Year),
30466            v => {
30467                tracing::warn!(
30468                    "Unknown value '{}' for enum '{}'",
30469                    v,
30470                    "ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval"
30471                );
30472                Ok(Unknown(v.to_owned()))
30473            }
30474        }
30475    }
30476}
30477impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
30478    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30479        f.write_str(self.as_str())
30480    }
30481}
30482
30483impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
30484    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30485        f.write_str(self.as_str())
30486    }
30487}
30488impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval {
30489    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30490    where
30491        S: serde::Serializer,
30492    {
30493        serializer.serialize_str(self.as_str())
30494    }
30495}
30496#[cfg(feature = "deserialize")]
30497impl<'de> serde::Deserialize<'de>
30498    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval
30499{
30500    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30501        use std::str::FromStr;
30502        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30503        Ok(Self::from_str(&s).expect("infallible"))
30504    }
30505}
30506/// Specifies the type of mandates supported. Possible values are `india`.
30507#[derive(Clone, Eq, PartialEq)]
30508#[non_exhaustive]
30509pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
30510    India,
30511    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30512    Unknown(String),
30513}
30514impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
30515    pub fn as_str(&self) -> &str {
30516        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
30517        match self {
30518            India => "india",
30519            Unknown(v) => v,
30520        }
30521    }
30522}
30523
30524impl std::str::FromStr
30525    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
30526{
30527    type Err = std::convert::Infallible;
30528    fn from_str(s: &str) -> Result<Self, Self::Err> {
30529        use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
30530        match s {
30531            "india" => Ok(India),
30532            v => {
30533                tracing::warn!(
30534                    "Unknown value '{}' for enum '{}'",
30535                    v,
30536                    "ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
30537                );
30538                Ok(Unknown(v.to_owned()))
30539            }
30540        }
30541    }
30542}
30543impl std::fmt::Display
30544    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
30545{
30546    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30547        f.write_str(self.as_str())
30548    }
30549}
30550
30551impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
30552    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30553        f.write_str(self.as_str())
30554    }
30555}
30556impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
30557    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30558    where
30559        S: serde::Serializer,
30560    {
30561        serializer.serialize_str(self.as_str())
30562    }
30563}
30564#[cfg(feature = "deserialize")]
30565impl<'de> serde::Deserialize<'de>
30566    for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
30567{
30568    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30569        use std::str::FromStr;
30570        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30571        Ok(Self::from_str(&s).expect("infallible"))
30572    }
30573}
30574/// Selected network to process this PaymentIntent on.
30575/// Depends on the available networks of the card attached to the PaymentIntent.
30576/// Can be only set confirm-time.
30577#[derive(Clone, Eq, PartialEq)]
30578#[non_exhaustive]
30579pub enum ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30580    Amex,
30581    CartesBancaires,
30582    Diners,
30583    Discover,
30584    EftposAu,
30585    Girocard,
30586    Interac,
30587    Jcb,
30588    Link,
30589    Mastercard,
30590    Unionpay,
30591    Unknown,
30592    Visa,
30593    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30594    /// This variant is prefixed with an underscore to avoid conflicts with Stripe's 'Unknown' variant.
30595    _Unknown(String),
30596}
30597impl ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30598    pub fn as_str(&self) -> &str {
30599        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
30600        match self {
30601            Amex => "amex",
30602            CartesBancaires => "cartes_bancaires",
30603            Diners => "diners",
30604            Discover => "discover",
30605            EftposAu => "eftpos_au",
30606            Girocard => "girocard",
30607            Interac => "interac",
30608            Jcb => "jcb",
30609            Link => "link",
30610            Mastercard => "mastercard",
30611            Unionpay => "unionpay",
30612            Unknown => "unknown",
30613            Visa => "visa",
30614            _Unknown(v) => v,
30615        }
30616    }
30617}
30618
30619impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30620    type Err = std::convert::Infallible;
30621    fn from_str(s: &str) -> Result<Self, Self::Err> {
30622        use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*;
30623        match s {
30624            "amex" => Ok(Amex),
30625            "cartes_bancaires" => Ok(CartesBancaires),
30626            "diners" => Ok(Diners),
30627            "discover" => Ok(Discover),
30628            "eftpos_au" => Ok(EftposAu),
30629            "girocard" => Ok(Girocard),
30630            "interac" => Ok(Interac),
30631            "jcb" => Ok(Jcb),
30632            "link" => Ok(Link),
30633            "mastercard" => Ok(Mastercard),
30634            "unionpay" => Ok(Unionpay),
30635            "unknown" => Ok(Unknown),
30636            "visa" => Ok(Visa),
30637            v => {
30638                tracing::warn!(
30639                    "Unknown value '{}' for enum '{}'",
30640                    v,
30641                    "ConfirmPaymentIntentPaymentMethodOptionsCardNetwork"
30642                );
30643                Ok(_Unknown(v.to_owned()))
30644            }
30645        }
30646    }
30647}
30648impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30649    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30650        f.write_str(self.as_str())
30651    }
30652}
30653
30654impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30655    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30656        f.write_str(self.as_str())
30657    }
30658}
30659impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30660    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30661    where
30662        S: serde::Serializer,
30663    {
30664        serializer.serialize_str(self.as_str())
30665    }
30666}
30667#[cfg(feature = "deserialize")]
30668impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork {
30669    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30670        use std::str::FromStr;
30671        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30672        Ok(Self::from_str(&s).expect("infallible"))
30673    }
30674}
30675/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent.
30676#[derive(Clone, Eq, PartialEq)]
30677#[non_exhaustive]
30678pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
30679    IfAvailable,
30680    Never,
30681    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30682    Unknown(String),
30683}
30684impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
30685    pub fn as_str(&self) -> &str {
30686        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
30687        match self {
30688            IfAvailable => "if_available",
30689            Never => "never",
30690            Unknown(v) => v,
30691        }
30692    }
30693}
30694
30695impl std::str::FromStr
30696    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
30697{
30698    type Err = std::convert::Infallible;
30699    fn from_str(s: &str) -> Result<Self, Self::Err> {
30700        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*;
30701        match s {
30702            "if_available" => Ok(IfAvailable),
30703            "never" => Ok(Never),
30704            v => {
30705                tracing::warn!(
30706                    "Unknown value '{}' for enum '{}'",
30707                    v,
30708                    "ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization"
30709                );
30710                Ok(Unknown(v.to_owned()))
30711            }
30712        }
30713    }
30714}
30715impl std::fmt::Display
30716    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
30717{
30718    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30719        f.write_str(self.as_str())
30720    }
30721}
30722
30723impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
30724    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30725        f.write_str(self.as_str())
30726    }
30727}
30728impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization {
30729    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30730    where
30731        S: serde::Serializer,
30732    {
30733        serializer.serialize_str(self.as_str())
30734    }
30735}
30736#[cfg(feature = "deserialize")]
30737impl<'de> serde::Deserialize<'de>
30738    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization
30739{
30740    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30741        use std::str::FromStr;
30742        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30743        Ok(Self::from_str(&s).expect("infallible"))
30744    }
30745}
30746/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent.
30747#[derive(Clone, Eq, PartialEq)]
30748#[non_exhaustive]
30749pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
30750    IfAvailable,
30751    Never,
30752    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30753    Unknown(String),
30754}
30755impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization {
30756    pub fn as_str(&self) -> &str {
30757        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
30758        match self {
30759            IfAvailable => "if_available",
30760            Never => "never",
30761            Unknown(v) => v,
30762        }
30763    }
30764}
30765
30766impl std::str::FromStr
30767    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
30768{
30769    type Err = std::convert::Infallible;
30770    fn from_str(s: &str) -> Result<Self, Self::Err> {
30771        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*;
30772        match s {
30773            "if_available" => Ok(IfAvailable),
30774            "never" => Ok(Never),
30775            v => {
30776                tracing::warn!(
30777                    "Unknown value '{}' for enum '{}'",
30778                    v,
30779                    "ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization"
30780                );
30781                Ok(Unknown(v.to_owned()))
30782            }
30783        }
30784    }
30785}
30786impl std::fmt::Display
30787    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
30788{
30789    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30790        f.write_str(self.as_str())
30791    }
30792}
30793
30794impl std::fmt::Debug
30795    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
30796{
30797    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30798        f.write_str(self.as_str())
30799    }
30800}
30801impl serde::Serialize
30802    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
30803{
30804    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30805    where
30806        S: serde::Serializer,
30807    {
30808        serializer.serialize_str(self.as_str())
30809    }
30810}
30811#[cfg(feature = "deserialize")]
30812impl<'de> serde::Deserialize<'de>
30813    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization
30814{
30815    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30816        use std::str::FromStr;
30817        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30818        Ok(Self::from_str(&s).expect("infallible"))
30819    }
30820}
30821/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent.
30822#[derive(Clone, Eq, PartialEq)]
30823#[non_exhaustive]
30824pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
30825    IfAvailable,
30826    Never,
30827    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30828    Unknown(String),
30829}
30830impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
30831    pub fn as_str(&self) -> &str {
30832        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
30833        match self {
30834            IfAvailable => "if_available",
30835            Never => "never",
30836            Unknown(v) => v,
30837        }
30838    }
30839}
30840
30841impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
30842    type Err = std::convert::Infallible;
30843    fn from_str(s: &str) -> Result<Self, Self::Err> {
30844        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*;
30845        match s {
30846            "if_available" => Ok(IfAvailable),
30847            "never" => Ok(Never),
30848            v => {
30849                tracing::warn!(
30850                    "Unknown value '{}' for enum '{}'",
30851                    v,
30852                    "ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture"
30853                );
30854                Ok(Unknown(v.to_owned()))
30855            }
30856        }
30857    }
30858}
30859impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
30860    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30861        f.write_str(self.as_str())
30862    }
30863}
30864
30865impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
30866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30867        f.write_str(self.as_str())
30868    }
30869}
30870impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture {
30871    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30872    where
30873        S: serde::Serializer,
30874    {
30875        serializer.serialize_str(self.as_str())
30876    }
30877}
30878#[cfg(feature = "deserialize")]
30879impl<'de> serde::Deserialize<'de>
30880    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture
30881{
30882    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30883        use std::str::FromStr;
30884        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30885        Ok(Self::from_str(&s).expect("infallible"))
30886    }
30887}
30888/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent.
30889#[derive(Clone, Eq, PartialEq)]
30890#[non_exhaustive]
30891pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
30892    IfAvailable,
30893    Never,
30894    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30895    Unknown(String),
30896}
30897impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
30898    pub fn as_str(&self) -> &str {
30899        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
30900        match self {
30901            IfAvailable => "if_available",
30902            Never => "never",
30903            Unknown(v) => v,
30904        }
30905    }
30906}
30907
30908impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
30909    type Err = std::convert::Infallible;
30910    fn from_str(s: &str) -> Result<Self, Self::Err> {
30911        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*;
30912        match s {
30913            "if_available" => Ok(IfAvailable),
30914            "never" => Ok(Never),
30915            v => {
30916                tracing::warn!(
30917                    "Unknown value '{}' for enum '{}'",
30918                    v,
30919                    "ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture"
30920                );
30921                Ok(Unknown(v.to_owned()))
30922            }
30923        }
30924    }
30925}
30926impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
30927    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30928        f.write_str(self.as_str())
30929    }
30930}
30931
30932impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
30933    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30934        f.write_str(self.as_str())
30935    }
30936}
30937impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture {
30938    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
30939    where
30940        S: serde::Serializer,
30941    {
30942        serializer.serialize_str(self.as_str())
30943    }
30944}
30945#[cfg(feature = "deserialize")]
30946impl<'de> serde::Deserialize<'de>
30947    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture
30948{
30949    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
30950        use std::str::FromStr;
30951        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
30952        Ok(Self::from_str(&s).expect("infallible"))
30953    }
30954}
30955/// 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).
30956/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
30957/// If not provided, this value defaults to `automatic`.
30958/// 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.
30959#[derive(Clone, Eq, PartialEq)]
30960#[non_exhaustive]
30961pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
30962    Any,
30963    Automatic,
30964    Challenge,
30965    /// An unrecognized value from Stripe. Should not be used as a request parameter.
30966    Unknown(String),
30967}
30968impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
30969    pub fn as_str(&self) -> &str {
30970        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
30971        match self {
30972            Any => "any",
30973            Automatic => "automatic",
30974            Challenge => "challenge",
30975            Unknown(v) => v,
30976        }
30977    }
30978}
30979
30980impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
30981    type Err = std::convert::Infallible;
30982    fn from_str(s: &str) -> Result<Self, Self::Err> {
30983        use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
30984        match s {
30985            "any" => Ok(Any),
30986            "automatic" => Ok(Automatic),
30987            "challenge" => Ok(Challenge),
30988            v => {
30989                tracing::warn!(
30990                    "Unknown value '{}' for enum '{}'",
30991                    v,
30992                    "ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure"
30993                );
30994                Ok(Unknown(v.to_owned()))
30995            }
30996        }
30997    }
30998}
30999impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
31000    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31001        f.write_str(self.as_str())
31002    }
31003}
31004
31005impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
31006    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31007        f.write_str(self.as_str())
31008    }
31009}
31010impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
31011    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31012    where
31013        S: serde::Serializer,
31014    {
31015        serializer.serialize_str(self.as_str())
31016    }
31017}
31018#[cfg(feature = "deserialize")]
31019impl<'de> serde::Deserialize<'de>
31020    for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure
31021{
31022    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31023        use std::str::FromStr;
31024        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31025        Ok(Self::from_str(&s).expect("infallible"))
31026    }
31027}
31028/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31029///
31030/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31031/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31032///
31033/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31034///
31035/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31036///
31037/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31038#[derive(Clone, Eq, PartialEq)]
31039#[non_exhaustive]
31040pub enum ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31041    None,
31042    OffSession,
31043    OnSession,
31044    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31045    Unknown(String),
31046}
31047impl ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31048    pub fn as_str(&self) -> &str {
31049        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
31050        match self {
31051            None => "none",
31052            OffSession => "off_session",
31053            OnSession => "on_session",
31054            Unknown(v) => v,
31055        }
31056    }
31057}
31058
31059impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31060    type Err = std::convert::Infallible;
31061    fn from_str(s: &str) -> Result<Self, Self::Err> {
31062        use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*;
31063        match s {
31064            "none" => Ok(None),
31065            "off_session" => Ok(OffSession),
31066            "on_session" => Ok(OnSession),
31067            v => {
31068                tracing::warn!(
31069                    "Unknown value '{}' for enum '{}'",
31070                    v,
31071                    "ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage"
31072                );
31073                Ok(Unknown(v.to_owned()))
31074            }
31075        }
31076    }
31077}
31078impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31079    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31080        f.write_str(self.as_str())
31081    }
31082}
31083
31084impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31085    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31086        f.write_str(self.as_str())
31087    }
31088}
31089impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31090    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31091    where
31092        S: serde::Serializer,
31093    {
31094        serializer.serialize_str(self.as_str())
31095    }
31096}
31097#[cfg(feature = "deserialize")]
31098impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage {
31099    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31100        use std::str::FromStr;
31101        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31102        Ok(Self::from_str(&s).expect("infallible"))
31103    }
31104}
31105/// If 3D Secure authentication was performed with a third-party provider,
31106/// the authentication details to use for this payment.
31107#[derive(Clone, Debug, serde::Serialize)]
31108pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
31109    /// The `transStatus` returned from the card Issuer’s ACS in the ARes.
31110    #[serde(skip_serializing_if = "Option::is_none")]
31111    pub ares_trans_status:
31112        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
31113    /// The cryptogram, also known as the "authentication value" (AAV, CAVV or
31114    /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
31115    /// (Most 3D Secure providers will return the base64-encoded version, which
31116    /// is what you should specify here.)
31117    pub cryptogram: String,
31118    /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
31119    /// provider and indicates what degree of authentication was performed.
31120    #[serde(skip_serializing_if = "Option::is_none")]
31121    pub electronic_commerce_indicator:
31122        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
31123    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
31124    #[serde(skip_serializing_if = "Option::is_none")]
31125    pub exemption_indicator:
31126        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator>,
31127    /// Network specific 3DS fields. Network specific arguments require an
31128    /// explicit card brand choice. The parameter `payment_method_options.card.network``
31129    /// must be populated accordingly
31130    #[serde(skip_serializing_if = "Option::is_none")]
31131    pub network_options:
31132        Option<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
31133    /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the
31134    /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99.
31135    #[serde(skip_serializing_if = "Option::is_none")]
31136    pub requestor_challenge_indicator: Option<String>,
31137    /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server
31138    /// Transaction ID (dsTransID).
31139    pub transaction_id: String,
31140    /// The version of 3D Secure that was performed.
31141    pub version: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion,
31142}
31143impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure {
31144    pub fn new(
31145        cryptogram: impl Into<String>,
31146        transaction_id: impl Into<String>,
31147        version: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion>,
31148    ) -> Self {
31149        Self {
31150            ares_trans_status: None,
31151            cryptogram: cryptogram.into(),
31152            electronic_commerce_indicator: None,
31153            exemption_indicator: None,
31154            network_options: None,
31155            requestor_challenge_indicator: None,
31156            transaction_id: transaction_id.into(),
31157            version: version.into(),
31158        }
31159    }
31160}
31161/// The `transStatus` returned from the card Issuer’s ACS in the ARes.
31162#[derive(Clone, Eq, PartialEq)]
31163#[non_exhaustive]
31164pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
31165    A,
31166    C,
31167    I,
31168    N,
31169    R,
31170    U,
31171    Y,
31172    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31173    Unknown(String),
31174}
31175impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
31176    pub fn as_str(&self) -> &str {
31177        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
31178        match self {
31179            A => "A",
31180            C => "C",
31181            I => "I",
31182            N => "N",
31183            R => "R",
31184            U => "U",
31185            Y => "Y",
31186            Unknown(v) => v,
31187        }
31188    }
31189}
31190
31191impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
31192    type Err = std::convert::Infallible;
31193    fn from_str(s: &str) -> Result<Self, Self::Err> {
31194        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
31195        match s {
31196            "A" => Ok(A),
31197            "C" => Ok(C),
31198            "I" => Ok(I),
31199            "N" => Ok(N),
31200            "R" => Ok(R),
31201            "U" => Ok(U),
31202            "Y" => Ok(Y),
31203            v => {
31204                tracing::warn!(
31205                    "Unknown value '{}' for enum '{}'",
31206                    v,
31207                    "ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
31208                );
31209                Ok(Unknown(v.to_owned()))
31210            }
31211        }
31212    }
31213}
31214impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
31215    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31216        f.write_str(self.as_str())
31217    }
31218}
31219
31220impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
31221    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31222        f.write_str(self.as_str())
31223    }
31224}
31225impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
31226    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31227    where
31228        S: serde::Serializer,
31229    {
31230        serializer.serialize_str(self.as_str())
31231    }
31232}
31233#[cfg(feature = "deserialize")]
31234impl<'de> serde::Deserialize<'de>
31235    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
31236{
31237    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31238        use std::str::FromStr;
31239        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31240        Ok(Self::from_str(&s).expect("infallible"))
31241    }
31242}
31243/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure
31244/// provider and indicates what degree of authentication was performed.
31245#[derive(Clone, Eq, PartialEq)]
31246#[non_exhaustive]
31247pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
31248    V01,
31249    V02,
31250    V05,
31251    V06,
31252    V07,
31253    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31254    Unknown(String),
31255}
31256impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
31257    pub fn as_str(&self) -> &str {
31258        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
31259        match self {
31260            V01 => "01",
31261            V02 => "02",
31262            V05 => "05",
31263            V06 => "06",
31264            V07 => "07",
31265            Unknown(v) => v,
31266        }
31267    }
31268}
31269
31270impl std::str::FromStr
31271    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
31272{
31273    type Err = std::convert::Infallible;
31274    fn from_str(s: &str) -> Result<Self, Self::Err> {
31275        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
31276        match s {
31277            "01" => Ok(V01),
31278            "02" => Ok(V02),
31279            "05" => Ok(V05),
31280            "06" => Ok(V06),
31281            "07" => Ok(V07),
31282            v => {
31283                tracing::warn!(
31284                    "Unknown value '{}' for enum '{}'",
31285                    v,
31286                    "ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
31287                );
31288                Ok(Unknown(v.to_owned()))
31289            }
31290        }
31291    }
31292}
31293impl std::fmt::Display
31294    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
31295{
31296    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31297        f.write_str(self.as_str())
31298    }
31299}
31300
31301impl std::fmt::Debug
31302    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
31303{
31304    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31305        f.write_str(self.as_str())
31306    }
31307}
31308impl serde::Serialize
31309    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
31310{
31311    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31312    where
31313        S: serde::Serializer,
31314    {
31315        serializer.serialize_str(self.as_str())
31316    }
31317}
31318#[cfg(feature = "deserialize")]
31319impl<'de> serde::Deserialize<'de>
31320    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
31321{
31322    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31323        use std::str::FromStr;
31324        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31325        Ok(Self::from_str(&s).expect("infallible"))
31326    }
31327}
31328/// The exemption requested via 3DS and accepted by the issuer at authentication time.
31329#[derive(Clone, Eq, PartialEq)]
31330#[non_exhaustive]
31331pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
31332    LowRisk,
31333    None,
31334    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31335    Unknown(String),
31336}
31337impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator {
31338    pub fn as_str(&self) -> &str {
31339        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
31340        match self {
31341            LowRisk => "low_risk",
31342            None => "none",
31343            Unknown(v) => v,
31344        }
31345    }
31346}
31347
31348impl std::str::FromStr
31349    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
31350{
31351    type Err = std::convert::Infallible;
31352    fn from_str(s: &str) -> Result<Self, Self::Err> {
31353        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*;
31354        match s {
31355            "low_risk" => Ok(LowRisk),
31356            "none" => Ok(None),
31357            v => {
31358                tracing::warn!(
31359                    "Unknown value '{}' for enum '{}'",
31360                    v,
31361                    "ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator"
31362                );
31363                Ok(Unknown(v.to_owned()))
31364            }
31365        }
31366    }
31367}
31368impl std::fmt::Display
31369    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
31370{
31371    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31372        f.write_str(self.as_str())
31373    }
31374}
31375
31376impl std::fmt::Debug
31377    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
31378{
31379    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31380        f.write_str(self.as_str())
31381    }
31382}
31383impl serde::Serialize
31384    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
31385{
31386    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31387    where
31388        S: serde::Serializer,
31389    {
31390        serializer.serialize_str(self.as_str())
31391    }
31392}
31393#[cfg(feature = "deserialize")]
31394impl<'de> serde::Deserialize<'de>
31395    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator
31396{
31397    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31398        use std::str::FromStr;
31399        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31400        Ok(Self::from_str(&s).expect("infallible"))
31401    }
31402}
31403/// Network specific 3DS fields. Network specific arguments require an
31404/// explicit card brand choice. The parameter `payment_method_options.card.network``
31405/// must be populated accordingly
31406#[derive(Clone, Debug, serde::Serialize)]
31407pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
31408    /// Cartes Bancaires-specific 3DS fields.
31409    #[serde(skip_serializing_if = "Option::is_none")]
31410    pub cartes_bancaires: Option<
31411        ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires,
31412    >,
31413}
31414impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
31415    pub fn new() -> Self {
31416        Self { cartes_bancaires: None }
31417    }
31418}
31419impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
31420    fn default() -> Self {
31421        Self::new()
31422    }
31423}
31424/// Cartes Bancaires-specific 3DS fields.
31425#[derive(Clone, Debug, serde::Serialize)]
31426pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
31427    /// The cryptogram calculation algorithm used by the card Issuer's ACS
31428    /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
31429    /// messageExtension: CB-AVALGO
31430pub cb_avalgo: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
31431    /// The exemption indicator returned from Cartes Bancaires in the ARes.
31432    /// message extension: CB-EXEMPTION; string (4 characters)
31433    /// This is a 3 byte bitmap (low significant byte first and most significant
31434    /// bit first) that has been Base64 encoded
31435#[serde(skip_serializing_if = "Option::is_none")]
31436pub cb_exemption: Option<String>,
31437    /// The risk score returned from Cartes Bancaires in the ARes.
31438    /// message extension: CB-SCORE; numeric value 0-99
31439#[serde(skip_serializing_if = "Option::is_none")]
31440pub cb_score: Option<i64>,
31441
31442}
31443impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
31444    pub fn new(
31445        cb_avalgo: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
31446    ) -> Self {
31447        Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
31448    }
31449}
31450/// The cryptogram calculation algorithm used by the card Issuer's ACS
31451/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`.
31452/// messageExtension: CB-AVALGO
31453#[derive(Clone, Eq, PartialEq)]
31454#[non_exhaustive]
31455pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
31456{
31457    V0,
31458    V1,
31459    V2,
31460    V3,
31461    V4,
31462    A,
31463    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31464    Unknown(String),
31465}
31466impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
31467    pub fn as_str(&self) -> &str {
31468        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
31469        match self {
31470            V0 => "0",
31471            V1 => "1",
31472            V2 => "2",
31473            V3 => "3",
31474            V4 => "4",
31475            A => "A",
31476            Unknown(v) => v,
31477        }
31478    }
31479}
31480
31481impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
31482    type Err = std::convert::Infallible;
31483    fn from_str(s: &str) -> Result<Self, Self::Err> {
31484        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
31485        match s {
31486    "0" => Ok(V0),
31487"1" => Ok(V1),
31488"2" => Ok(V2),
31489"3" => Ok(V3),
31490"4" => Ok(V4),
31491"A" => Ok(A),
31492v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"); Ok(Unknown(v.to_owned())) }
31493
31494        }
31495    }
31496}
31497impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
31498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31499        f.write_str(self.as_str())
31500    }
31501}
31502
31503impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
31504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31505        f.write_str(self.as_str())
31506    }
31507}
31508impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
31509    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
31510        serializer.serialize_str(self.as_str())
31511    }
31512}
31513#[cfg(feature = "deserialize")]
31514impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
31515    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31516        use std::str::FromStr;
31517        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31518        Ok(Self::from_str(&s).expect("infallible"))
31519    }
31520}
31521/// The version of 3D Secure that was performed.
31522#[derive(Clone, Eq, PartialEq)]
31523#[non_exhaustive]
31524pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
31525    V1_0_2,
31526    V2_1_0,
31527    V2_2_0,
31528    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31529    Unknown(String),
31530}
31531impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
31532    pub fn as_str(&self) -> &str {
31533        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
31534        match self {
31535            V1_0_2 => "1.0.2",
31536            V2_1_0 => "2.1.0",
31537            V2_2_0 => "2.2.0",
31538            Unknown(v) => v,
31539        }
31540    }
31541}
31542
31543impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
31544    type Err = std::convert::Infallible;
31545    fn from_str(s: &str) -> Result<Self, Self::Err> {
31546        use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
31547        match s {
31548            "1.0.2" => Ok(V1_0_2),
31549            "2.1.0" => Ok(V2_1_0),
31550            "2.2.0" => Ok(V2_2_0),
31551            v => {
31552                tracing::warn!(
31553                    "Unknown value '{}' for enum '{}'",
31554                    v,
31555                    "ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion"
31556                );
31557                Ok(Unknown(v.to_owned()))
31558            }
31559        }
31560    }
31561}
31562impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
31563    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31564        f.write_str(self.as_str())
31565    }
31566}
31567
31568impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
31569    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31570        f.write_str(self.as_str())
31571    }
31572}
31573impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion {
31574    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31575    where
31576        S: serde::Serializer,
31577    {
31578        serializer.serialize_str(self.as_str())
31579    }
31580}
31581#[cfg(feature = "deserialize")]
31582impl<'de> serde::Deserialize<'de>
31583    for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion
31584{
31585    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31586        use std::str::FromStr;
31587        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31588        Ok(Self::from_str(&s).expect("infallible"))
31589    }
31590}
31591/// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options.
31592#[derive(Clone, Debug, serde::Serialize)]
31593pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
31594    /// Controls when the funds are captured from the customer's account.
31595    ///
31596    /// 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.
31597    ///
31598    /// 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.
31599    #[serde(skip_serializing_if = "Option::is_none")]
31600    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod>,
31601    /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity).
31602    #[serde(skip_serializing_if = "Option::is_none")]
31603    pub request_extended_authorization: Option<bool>,
31604    /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible.
31605    /// 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.
31606    #[serde(skip_serializing_if = "Option::is_none")]
31607    pub request_incremental_authorization_support: Option<bool>,
31608    /// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
31609    #[serde(skip_serializing_if = "Option::is_none")]
31610    pub routing: Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting>,
31611}
31612impl ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
31613    pub fn new() -> Self {
31614        Self {
31615            capture_method: None,
31616            request_extended_authorization: None,
31617            request_incremental_authorization_support: None,
31618            routing: None,
31619        }
31620    }
31621}
31622impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresent {
31623    fn default() -> Self {
31624        Self::new()
31625    }
31626}
31627/// Controls when the funds are captured from the customer's account.
31628///
31629/// 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.
31630///
31631/// 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.
31632#[derive(Clone, Eq, PartialEq)]
31633#[non_exhaustive]
31634pub enum ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
31635    Manual,
31636    ManualPreferred,
31637    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31638    Unknown(String),
31639}
31640impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
31641    pub fn as_str(&self) -> &str {
31642        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
31643        match self {
31644            Manual => "manual",
31645            ManualPreferred => "manual_preferred",
31646            Unknown(v) => v,
31647        }
31648    }
31649}
31650
31651impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
31652    type Err = std::convert::Infallible;
31653    fn from_str(s: &str) -> Result<Self, Self::Err> {
31654        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod::*;
31655        match s {
31656            "manual" => Ok(Manual),
31657            "manual_preferred" => Ok(ManualPreferred),
31658            v => {
31659                tracing::warn!(
31660                    "Unknown value '{}' for enum '{}'",
31661                    v,
31662                    "ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod"
31663                );
31664                Ok(Unknown(v.to_owned()))
31665            }
31666        }
31667    }
31668}
31669impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
31670    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31671        f.write_str(self.as_str())
31672    }
31673}
31674
31675impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
31676    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31677        f.write_str(self.as_str())
31678    }
31679}
31680impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod {
31681    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31682    where
31683        S: serde::Serializer,
31684    {
31685        serializer.serialize_str(self.as_str())
31686    }
31687}
31688#[cfg(feature = "deserialize")]
31689impl<'de> serde::Deserialize<'de>
31690    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentCaptureMethod
31691{
31692    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31693        use std::str::FromStr;
31694        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31695        Ok(Self::from_str(&s).expect("infallible"))
31696    }
31697}
31698/// Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.
31699#[derive(Clone, Debug, serde::Serialize)]
31700pub struct ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
31701    /// Routing requested priority
31702    #[serde(skip_serializing_if = "Option::is_none")]
31703    pub requested_priority:
31704        Option<ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority>,
31705}
31706impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
31707    pub fn new() -> Self {
31708        Self { requested_priority: None }
31709    }
31710}
31711impl Default for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRouting {
31712    fn default() -> Self {
31713        Self::new()
31714    }
31715}
31716/// Routing requested priority
31717#[derive(Clone, Eq, PartialEq)]
31718#[non_exhaustive]
31719pub enum ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
31720    Domestic,
31721    International,
31722    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31723    Unknown(String),
31724}
31725impl ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority {
31726    pub fn as_str(&self) -> &str {
31727        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
31728        match self {
31729            Domestic => "domestic",
31730            International => "international",
31731            Unknown(v) => v,
31732        }
31733    }
31734}
31735
31736impl std::str::FromStr
31737    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
31738{
31739    type Err = std::convert::Infallible;
31740    fn from_str(s: &str) -> Result<Self, Self::Err> {
31741        use ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority::*;
31742        match s {
31743            "domestic" => Ok(Domestic),
31744            "international" => Ok(International),
31745            v => {
31746                tracing::warn!(
31747                    "Unknown value '{}' for enum '{}'",
31748                    v,
31749                    "ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority"
31750                );
31751                Ok(Unknown(v.to_owned()))
31752            }
31753        }
31754    }
31755}
31756impl std::fmt::Display
31757    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
31758{
31759    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31760        f.write_str(self.as_str())
31761    }
31762}
31763
31764impl std::fmt::Debug
31765    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
31766{
31767    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31768        f.write_str(self.as_str())
31769    }
31770}
31771impl serde::Serialize
31772    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
31773{
31774    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31775    where
31776        S: serde::Serializer,
31777    {
31778        serializer.serialize_str(self.as_str())
31779    }
31780}
31781#[cfg(feature = "deserialize")]
31782impl<'de> serde::Deserialize<'de>
31783    for ConfirmPaymentIntentPaymentMethodOptionsCardPresentRoutingRequestedPriority
31784{
31785    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31786        use std::str::FromStr;
31787        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31788        Ok(Self::from_str(&s).expect("infallible"))
31789    }
31790}
31791/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
31792#[derive(Clone, Debug, serde::Serialize)]
31793pub struct ConfirmPaymentIntentPaymentMethodOptionsCashapp {
31794    /// Controls when the funds are captured from the customer's account.
31795    ///
31796    /// 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.
31797    ///
31798    /// 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.
31799    #[serde(skip_serializing_if = "Option::is_none")]
31800    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod>,
31801    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31802    ///
31803    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31804    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31805    ///
31806    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31807    ///
31808    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31809    ///
31810    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31811    #[serde(skip_serializing_if = "Option::is_none")]
31812    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage>,
31813}
31814impl ConfirmPaymentIntentPaymentMethodOptionsCashapp {
31815    pub fn new() -> Self {
31816        Self { capture_method: None, setup_future_usage: None }
31817    }
31818}
31819impl Default for ConfirmPaymentIntentPaymentMethodOptionsCashapp {
31820    fn default() -> Self {
31821        Self::new()
31822    }
31823}
31824/// Controls when the funds are captured from the customer's account.
31825///
31826/// 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.
31827///
31828/// 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.
31829#[derive(Clone, Eq, PartialEq)]
31830#[non_exhaustive]
31831pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31832    Manual,
31833    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31834    Unknown(String),
31835}
31836impl ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31837    pub fn as_str(&self) -> &str {
31838        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
31839        match self {
31840            Manual => "manual",
31841            Unknown(v) => v,
31842        }
31843    }
31844}
31845
31846impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31847    type Err = std::convert::Infallible;
31848    fn from_str(s: &str) -> Result<Self, Self::Err> {
31849        use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*;
31850        match s {
31851            "manual" => Ok(Manual),
31852            v => {
31853                tracing::warn!(
31854                    "Unknown value '{}' for enum '{}'",
31855                    v,
31856                    "ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod"
31857                );
31858                Ok(Unknown(v.to_owned()))
31859            }
31860        }
31861    }
31862}
31863impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31864    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31865        f.write_str(self.as_str())
31866    }
31867}
31868
31869impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31871        f.write_str(self.as_str())
31872    }
31873}
31874impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31875    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31876    where
31877        S: serde::Serializer,
31878    {
31879        serializer.serialize_str(self.as_str())
31880    }
31881}
31882#[cfg(feature = "deserialize")]
31883impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod {
31884    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31885        use std::str::FromStr;
31886        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31887        Ok(Self::from_str(&s).expect("infallible"))
31888    }
31889}
31890/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31891///
31892/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31893/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31894///
31895/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31896///
31897/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31898///
31899/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31900#[derive(Clone, Eq, PartialEq)]
31901#[non_exhaustive]
31902pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
31903    None,
31904    OffSession,
31905    OnSession,
31906    /// An unrecognized value from Stripe. Should not be used as a request parameter.
31907    Unknown(String),
31908}
31909impl ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
31910    pub fn as_str(&self) -> &str {
31911        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
31912        match self {
31913            None => "none",
31914            OffSession => "off_session",
31915            OnSession => "on_session",
31916            Unknown(v) => v,
31917        }
31918    }
31919}
31920
31921impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
31922    type Err = std::convert::Infallible;
31923    fn from_str(s: &str) -> Result<Self, Self::Err> {
31924        use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*;
31925        match s {
31926            "none" => Ok(None),
31927            "off_session" => Ok(OffSession),
31928            "on_session" => Ok(OnSession),
31929            v => {
31930                tracing::warn!(
31931                    "Unknown value '{}' for enum '{}'",
31932                    v,
31933                    "ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage"
31934                );
31935                Ok(Unknown(v.to_owned()))
31936            }
31937        }
31938    }
31939}
31940impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
31941    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31942        f.write_str(self.as_str())
31943    }
31944}
31945
31946impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
31947    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31948        f.write_str(self.as_str())
31949    }
31950}
31951impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage {
31952    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
31953    where
31954        S: serde::Serializer,
31955    {
31956        serializer.serialize_str(self.as_str())
31957    }
31958}
31959#[cfg(feature = "deserialize")]
31960impl<'de> serde::Deserialize<'de>
31961    for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage
31962{
31963    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31964        use std::str::FromStr;
31965        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
31966        Ok(Self::from_str(&s).expect("infallible"))
31967    }
31968}
31969/// If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
31970#[derive(Clone, Debug, serde::Serialize)]
31971pub struct ConfirmPaymentIntentPaymentMethodOptionsCrypto {
31972    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31973    ///
31974    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31975    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31976    ///
31977    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
31978    ///
31979    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
31980    ///
31981    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
31982    #[serde(skip_serializing_if = "Option::is_none")]
31983    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage>,
31984}
31985impl ConfirmPaymentIntentPaymentMethodOptionsCrypto {
31986    pub fn new() -> Self {
31987        Self { setup_future_usage: None }
31988    }
31989}
31990impl Default for ConfirmPaymentIntentPaymentMethodOptionsCrypto {
31991    fn default() -> Self {
31992        Self::new()
31993    }
31994}
31995/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
31996///
31997/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
31998/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
31999///
32000/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32001///
32002/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32003///
32004/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32005#[derive(Clone, Eq, PartialEq)]
32006#[non_exhaustive]
32007pub enum ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
32008    None,
32009    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32010    Unknown(String),
32011}
32012impl ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
32013    pub fn as_str(&self) -> &str {
32014        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
32015        match self {
32016            None => "none",
32017            Unknown(v) => v,
32018        }
32019    }
32020}
32021
32022impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
32023    type Err = std::convert::Infallible;
32024    fn from_str(s: &str) -> Result<Self, Self::Err> {
32025        use ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage::*;
32026        match s {
32027            "none" => Ok(None),
32028            v => {
32029                tracing::warn!(
32030                    "Unknown value '{}' for enum '{}'",
32031                    v,
32032                    "ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage"
32033                );
32034                Ok(Unknown(v.to_owned()))
32035            }
32036        }
32037    }
32038}
32039impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
32040    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32041        f.write_str(self.as_str())
32042    }
32043}
32044
32045impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
32046    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32047        f.write_str(self.as_str())
32048    }
32049}
32050impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage {
32051    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32052    where
32053        S: serde::Serializer,
32054    {
32055        serializer.serialize_str(self.as_str())
32056    }
32057}
32058#[cfg(feature = "deserialize")]
32059impl<'de> serde::Deserialize<'de>
32060    for ConfirmPaymentIntentPaymentMethodOptionsCryptoSetupFutureUsage
32061{
32062    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32063        use std::str::FromStr;
32064        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32065        Ok(Self::from_str(&s).expect("infallible"))
32066    }
32067}
32068/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
32069#[derive(Clone, Debug, serde::Serialize)]
32070pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
32071    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
32072    #[serde(skip_serializing_if = "Option::is_none")]
32073    pub bank_transfer: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>,
32074    /// The funding method type to be used when there are not enough funds in the customer balance.
32075    /// Permitted values include: `bank_transfer`.
32076    #[serde(skip_serializing_if = "Option::is_none")]
32077    pub funding_type: Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType>,
32078    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32079    ///
32080    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32081    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32082    ///
32083    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32084    ///
32085    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32086    ///
32087    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32088    #[serde(skip_serializing_if = "Option::is_none")]
32089    pub setup_future_usage:
32090        Option<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage>,
32091}
32092impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
32093    pub fn new() -> Self {
32094        Self { bank_transfer: None, funding_type: None, setup_future_usage: None }
32095    }
32096}
32097impl Default for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance {
32098    fn default() -> Self {
32099        Self::new()
32100    }
32101}
32102/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
32103#[derive(Clone, Debug, serde::Serialize)]
32104pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
32105    /// Configuration for the eu_bank_transfer funding type.
32106#[serde(skip_serializing_if = "Option::is_none")]
32107pub eu_bank_transfer: Option<EuBankTransferParams>,
32108        /// List of address types that should be returned in the financial_addresses response.
32109    /// If not specified, all valid types will be returned.
32110    ///
32111    /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
32112#[serde(skip_serializing_if = "Option::is_none")]
32113pub requested_address_types: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,
32114        /// 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`.
32115#[serde(rename = "type")]
32116pub type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType,
32117
32118}
32119impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
32120    pub fn new(
32121        type_: impl Into<ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType>,
32122    ) -> Self {
32123        Self { eu_bank_transfer: None, requested_address_types: None, type_: type_.into() }
32124    }
32125}
32126/// List of address types that should be returned in the financial_addresses response.
32127/// If not specified, all valid types will be returned.
32128///
32129/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
32130#[derive(Clone, Eq, PartialEq)]
32131#[non_exhaustive]
32132pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
32133    Aba,
32134    Iban,
32135    Sepa,
32136    SortCode,
32137    Spei,
32138    Swift,
32139    Zengin,
32140    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32141    Unknown(String),
32142}
32143impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
32144    pub fn as_str(&self) -> &str {
32145        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
32146        match self {
32147            Aba => "aba",
32148            Iban => "iban",
32149            Sepa => "sepa",
32150            SortCode => "sort_code",
32151            Spei => "spei",
32152            Swift => "swift",
32153            Zengin => "zengin",
32154            Unknown(v) => v,
32155        }
32156    }
32157}
32158
32159impl std::str::FromStr
32160    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
32161{
32162    type Err = std::convert::Infallible;
32163    fn from_str(s: &str) -> Result<Self, Self::Err> {
32164        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*;
32165        match s {
32166            "aba" => Ok(Aba),
32167            "iban" => Ok(Iban),
32168            "sepa" => Ok(Sepa),
32169            "sort_code" => Ok(SortCode),
32170            "spei" => Ok(Spei),
32171            "swift" => Ok(Swift),
32172            "zengin" => Ok(Zengin),
32173            v => {
32174                tracing::warn!(
32175                    "Unknown value '{}' for enum '{}'",
32176                    v,
32177                    "ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes"
32178                );
32179                Ok(Unknown(v.to_owned()))
32180            }
32181        }
32182    }
32183}
32184impl std::fmt::Display
32185    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
32186{
32187    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32188        f.write_str(self.as_str())
32189    }
32190}
32191
32192impl std::fmt::Debug
32193    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
32194{
32195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32196        f.write_str(self.as_str())
32197    }
32198}
32199impl serde::Serialize
32200    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
32201{
32202    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32203    where
32204        S: serde::Serializer,
32205    {
32206        serializer.serialize_str(self.as_str())
32207    }
32208}
32209#[cfg(feature = "deserialize")]
32210impl<'de> serde::Deserialize<'de>
32211    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
32212{
32213    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32214        use std::str::FromStr;
32215        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32216        Ok(Self::from_str(&s).expect("infallible"))
32217    }
32218}
32219/// 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`.
32220#[derive(Clone, Eq, PartialEq)]
32221#[non_exhaustive]
32222pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
32223    EuBankTransfer,
32224    GbBankTransfer,
32225    JpBankTransfer,
32226    MxBankTransfer,
32227    UsBankTransfer,
32228    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32229    Unknown(String),
32230}
32231impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
32232    pub fn as_str(&self) -> &str {
32233        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
32234        match self {
32235            EuBankTransfer => "eu_bank_transfer",
32236            GbBankTransfer => "gb_bank_transfer",
32237            JpBankTransfer => "jp_bank_transfer",
32238            MxBankTransfer => "mx_bank_transfer",
32239            UsBankTransfer => "us_bank_transfer",
32240            Unknown(v) => v,
32241        }
32242    }
32243}
32244
32245impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
32246    type Err = std::convert::Infallible;
32247    fn from_str(s: &str) -> Result<Self, Self::Err> {
32248        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*;
32249        match s {
32250            "eu_bank_transfer" => Ok(EuBankTransfer),
32251            "gb_bank_transfer" => Ok(GbBankTransfer),
32252            "jp_bank_transfer" => Ok(JpBankTransfer),
32253            "mx_bank_transfer" => Ok(MxBankTransfer),
32254            "us_bank_transfer" => Ok(UsBankTransfer),
32255            v => {
32256                tracing::warn!(
32257                    "Unknown value '{}' for enum '{}'",
32258                    v,
32259                    "ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType"
32260                );
32261                Ok(Unknown(v.to_owned()))
32262            }
32263        }
32264    }
32265}
32266impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
32267    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32268        f.write_str(self.as_str())
32269    }
32270}
32271
32272impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
32273    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32274        f.write_str(self.as_str())
32275    }
32276}
32277impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
32278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32279    where
32280        S: serde::Serializer,
32281    {
32282        serializer.serialize_str(self.as_str())
32283    }
32284}
32285#[cfg(feature = "deserialize")]
32286impl<'de> serde::Deserialize<'de>
32287    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
32288{
32289    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32290        use std::str::FromStr;
32291        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32292        Ok(Self::from_str(&s).expect("infallible"))
32293    }
32294}
32295/// The funding method type to be used when there are not enough funds in the customer balance.
32296/// Permitted values include: `bank_transfer`.
32297#[derive(Clone, Eq, PartialEq)]
32298#[non_exhaustive]
32299pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
32300    BankTransfer,
32301    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32302    Unknown(String),
32303}
32304impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
32305    pub fn as_str(&self) -> &str {
32306        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
32307        match self {
32308            BankTransfer => "bank_transfer",
32309            Unknown(v) => v,
32310        }
32311    }
32312}
32313
32314impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
32315    type Err = std::convert::Infallible;
32316    fn from_str(s: &str) -> Result<Self, Self::Err> {
32317        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*;
32318        match s {
32319            "bank_transfer" => Ok(BankTransfer),
32320            v => {
32321                tracing::warn!(
32322                    "Unknown value '{}' for enum '{}'",
32323                    v,
32324                    "ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType"
32325                );
32326                Ok(Unknown(v.to_owned()))
32327            }
32328        }
32329    }
32330}
32331impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
32332    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32333        f.write_str(self.as_str())
32334    }
32335}
32336
32337impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
32338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32339        f.write_str(self.as_str())
32340    }
32341}
32342impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType {
32343    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32344    where
32345        S: serde::Serializer,
32346    {
32347        serializer.serialize_str(self.as_str())
32348    }
32349}
32350#[cfg(feature = "deserialize")]
32351impl<'de> serde::Deserialize<'de>
32352    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType
32353{
32354    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32355        use std::str::FromStr;
32356        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32357        Ok(Self::from_str(&s).expect("infallible"))
32358    }
32359}
32360/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32361///
32362/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32363/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32364///
32365/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32366///
32367/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32368///
32369/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32370#[derive(Clone, Eq, PartialEq)]
32371#[non_exhaustive]
32372pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
32373    None,
32374    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32375    Unknown(String),
32376}
32377impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
32378    pub fn as_str(&self) -> &str {
32379        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
32380        match self {
32381            None => "none",
32382            Unknown(v) => v,
32383        }
32384    }
32385}
32386
32387impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
32388    type Err = std::convert::Infallible;
32389    fn from_str(s: &str) -> Result<Self, Self::Err> {
32390        use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*;
32391        match s {
32392            "none" => Ok(None),
32393            v => {
32394                tracing::warn!(
32395                    "Unknown value '{}' for enum '{}'",
32396                    v,
32397                    "ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage"
32398                );
32399                Ok(Unknown(v.to_owned()))
32400            }
32401        }
32402    }
32403}
32404impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
32405    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32406        f.write_str(self.as_str())
32407    }
32408}
32409
32410impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
32411    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32412        f.write_str(self.as_str())
32413    }
32414}
32415impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage {
32416    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32417    where
32418        S: serde::Serializer,
32419    {
32420        serializer.serialize_str(self.as_str())
32421    }
32422}
32423#[cfg(feature = "deserialize")]
32424impl<'de> serde::Deserialize<'de>
32425    for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage
32426{
32427    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32428        use std::str::FromStr;
32429        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32430        Ok(Self::from_str(&s).expect("infallible"))
32431    }
32432}
32433/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
32434#[derive(Clone, Debug, serde::Serialize)]
32435pub struct ConfirmPaymentIntentPaymentMethodOptionsEps {
32436    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32437    ///
32438    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32439    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32440    ///
32441    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32442    ///
32443    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32444    ///
32445    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32446    #[serde(skip_serializing_if = "Option::is_none")]
32447    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage>,
32448}
32449impl ConfirmPaymentIntentPaymentMethodOptionsEps {
32450    pub fn new() -> Self {
32451        Self { setup_future_usage: None }
32452    }
32453}
32454impl Default for ConfirmPaymentIntentPaymentMethodOptionsEps {
32455    fn default() -> Self {
32456        Self::new()
32457    }
32458}
32459/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32460///
32461/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32462/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32463///
32464/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32465///
32466/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32467///
32468/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32469#[derive(Clone, Eq, PartialEq)]
32470#[non_exhaustive]
32471pub enum ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32472    None,
32473    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32474    Unknown(String),
32475}
32476impl ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32477    pub fn as_str(&self) -> &str {
32478        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
32479        match self {
32480            None => "none",
32481            Unknown(v) => v,
32482        }
32483    }
32484}
32485
32486impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32487    type Err = std::convert::Infallible;
32488    fn from_str(s: &str) -> Result<Self, Self::Err> {
32489        use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*;
32490        match s {
32491            "none" => Ok(None),
32492            v => {
32493                tracing::warn!(
32494                    "Unknown value '{}' for enum '{}'",
32495                    v,
32496                    "ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage"
32497                );
32498                Ok(Unknown(v.to_owned()))
32499            }
32500        }
32501    }
32502}
32503impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32505        f.write_str(self.as_str())
32506    }
32507}
32508
32509impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32510    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32511        f.write_str(self.as_str())
32512    }
32513}
32514impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32515    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32516    where
32517        S: serde::Serializer,
32518    {
32519        serializer.serialize_str(self.as_str())
32520    }
32521}
32522#[cfg(feature = "deserialize")]
32523impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage {
32524    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32525        use std::str::FromStr;
32526        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32527        Ok(Self::from_str(&s).expect("infallible"))
32528    }
32529}
32530/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
32531#[derive(Clone, Debug, serde::Serialize)]
32532pub struct ConfirmPaymentIntentPaymentMethodOptionsFpx {
32533    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32534    ///
32535    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32536    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32537    ///
32538    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32539    ///
32540    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32541    ///
32542    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32543    #[serde(skip_serializing_if = "Option::is_none")]
32544    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage>,
32545}
32546impl ConfirmPaymentIntentPaymentMethodOptionsFpx {
32547    pub fn new() -> Self {
32548        Self { setup_future_usage: None }
32549    }
32550}
32551impl Default for ConfirmPaymentIntentPaymentMethodOptionsFpx {
32552    fn default() -> Self {
32553        Self::new()
32554    }
32555}
32556/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32557///
32558/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32559/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32560///
32561/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32562///
32563/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32564///
32565/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32566#[derive(Clone, Eq, PartialEq)]
32567#[non_exhaustive]
32568pub enum ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32569    None,
32570    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32571    Unknown(String),
32572}
32573impl ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32574    pub fn as_str(&self) -> &str {
32575        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
32576        match self {
32577            None => "none",
32578            Unknown(v) => v,
32579        }
32580    }
32581}
32582
32583impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32584    type Err = std::convert::Infallible;
32585    fn from_str(s: &str) -> Result<Self, Self::Err> {
32586        use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*;
32587        match s {
32588            "none" => Ok(None),
32589            v => {
32590                tracing::warn!(
32591                    "Unknown value '{}' for enum '{}'",
32592                    v,
32593                    "ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage"
32594                );
32595                Ok(Unknown(v.to_owned()))
32596            }
32597        }
32598    }
32599}
32600impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32601    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32602        f.write_str(self.as_str())
32603    }
32604}
32605
32606impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32607    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32608        f.write_str(self.as_str())
32609    }
32610}
32611impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32612    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32613    where
32614        S: serde::Serializer,
32615    {
32616        serializer.serialize_str(self.as_str())
32617    }
32618}
32619#[cfg(feature = "deserialize")]
32620impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage {
32621    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32622        use std::str::FromStr;
32623        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32624        Ok(Self::from_str(&s).expect("infallible"))
32625    }
32626}
32627/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
32628#[derive(Clone, Debug, serde::Serialize)]
32629pub struct ConfirmPaymentIntentPaymentMethodOptionsGiropay {
32630    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32631    ///
32632    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32633    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32634    ///
32635    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32636    ///
32637    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32638    ///
32639    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32640    #[serde(skip_serializing_if = "Option::is_none")]
32641    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage>,
32642}
32643impl ConfirmPaymentIntentPaymentMethodOptionsGiropay {
32644    pub fn new() -> Self {
32645        Self { setup_future_usage: None }
32646    }
32647}
32648impl Default for ConfirmPaymentIntentPaymentMethodOptionsGiropay {
32649    fn default() -> Self {
32650        Self::new()
32651    }
32652}
32653/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32654///
32655/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32656/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32657///
32658/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32659///
32660/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32661///
32662/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32663#[derive(Clone, Eq, PartialEq)]
32664#[non_exhaustive]
32665pub enum ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
32666    None,
32667    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32668    Unknown(String),
32669}
32670impl ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
32671    pub fn as_str(&self) -> &str {
32672        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
32673        match self {
32674            None => "none",
32675            Unknown(v) => v,
32676        }
32677    }
32678}
32679
32680impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
32681    type Err = std::convert::Infallible;
32682    fn from_str(s: &str) -> Result<Self, Self::Err> {
32683        use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*;
32684        match s {
32685            "none" => Ok(None),
32686            v => {
32687                tracing::warn!(
32688                    "Unknown value '{}' for enum '{}'",
32689                    v,
32690                    "ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage"
32691                );
32692                Ok(Unknown(v.to_owned()))
32693            }
32694        }
32695    }
32696}
32697impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
32698    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32699        f.write_str(self.as_str())
32700    }
32701}
32702
32703impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
32704    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32705        f.write_str(self.as_str())
32706    }
32707}
32708impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage {
32709    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32710    where
32711        S: serde::Serializer,
32712    {
32713        serializer.serialize_str(self.as_str())
32714    }
32715}
32716#[cfg(feature = "deserialize")]
32717impl<'de> serde::Deserialize<'de>
32718    for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage
32719{
32720    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32721        use std::str::FromStr;
32722        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32723        Ok(Self::from_str(&s).expect("infallible"))
32724    }
32725}
32726/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
32727#[derive(Clone, Debug, serde::Serialize)]
32728pub struct ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
32729    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32730    ///
32731    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32732    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32733    ///
32734    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32735    ///
32736    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32737    ///
32738    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32739    #[serde(skip_serializing_if = "Option::is_none")]
32740    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage>,
32741}
32742impl ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
32743    pub fn new() -> Self {
32744        Self { setup_future_usage: None }
32745    }
32746}
32747impl Default for ConfirmPaymentIntentPaymentMethodOptionsGrabpay {
32748    fn default() -> Self {
32749        Self::new()
32750    }
32751}
32752/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32753///
32754/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32755/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32756///
32757/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32758///
32759/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32760///
32761/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32762#[derive(Clone, Eq, PartialEq)]
32763#[non_exhaustive]
32764pub enum ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
32765    None,
32766    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32767    Unknown(String),
32768}
32769impl ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
32770    pub fn as_str(&self) -> &str {
32771        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
32772        match self {
32773            None => "none",
32774            Unknown(v) => v,
32775        }
32776    }
32777}
32778
32779impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
32780    type Err = std::convert::Infallible;
32781    fn from_str(s: &str) -> Result<Self, Self::Err> {
32782        use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*;
32783        match s {
32784            "none" => Ok(None),
32785            v => {
32786                tracing::warn!(
32787                    "Unknown value '{}' for enum '{}'",
32788                    v,
32789                    "ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage"
32790                );
32791                Ok(Unknown(v.to_owned()))
32792            }
32793        }
32794    }
32795}
32796impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
32797    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32798        f.write_str(self.as_str())
32799    }
32800}
32801
32802impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
32803    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32804        f.write_str(self.as_str())
32805    }
32806}
32807impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage {
32808    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32809    where
32810        S: serde::Serializer,
32811    {
32812        serializer.serialize_str(self.as_str())
32813    }
32814}
32815#[cfg(feature = "deserialize")]
32816impl<'de> serde::Deserialize<'de>
32817    for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage
32818{
32819    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32820        use std::str::FromStr;
32821        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32822        Ok(Self::from_str(&s).expect("infallible"))
32823    }
32824}
32825/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
32826#[derive(Clone, Debug, serde::Serialize)]
32827pub struct ConfirmPaymentIntentPaymentMethodOptionsIdeal {
32828    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32829    ///
32830    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32831    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32832    ///
32833    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32834    ///
32835    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32836    ///
32837    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32838    #[serde(skip_serializing_if = "Option::is_none")]
32839    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage>,
32840}
32841impl ConfirmPaymentIntentPaymentMethodOptionsIdeal {
32842    pub fn new() -> Self {
32843        Self { setup_future_usage: None }
32844    }
32845}
32846impl Default for ConfirmPaymentIntentPaymentMethodOptionsIdeal {
32847    fn default() -> Self {
32848        Self::new()
32849    }
32850}
32851/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32852///
32853/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32854/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32855///
32856/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32857///
32858/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32859///
32860/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
32861#[derive(Clone, Eq, PartialEq)]
32862#[non_exhaustive]
32863pub enum ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
32864    None,
32865    OffSession,
32866    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32867    Unknown(String),
32868}
32869impl ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
32870    pub fn as_str(&self) -> &str {
32871        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
32872        match self {
32873            None => "none",
32874            OffSession => "off_session",
32875            Unknown(v) => v,
32876        }
32877    }
32878}
32879
32880impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
32881    type Err = std::convert::Infallible;
32882    fn from_str(s: &str) -> Result<Self, Self::Err> {
32883        use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*;
32884        match s {
32885            "none" => Ok(None),
32886            "off_session" => Ok(OffSession),
32887            v => {
32888                tracing::warn!(
32889                    "Unknown value '{}' for enum '{}'",
32890                    v,
32891                    "ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage"
32892                );
32893                Ok(Unknown(v.to_owned()))
32894            }
32895        }
32896    }
32897}
32898impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
32899    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32900        f.write_str(self.as_str())
32901    }
32902}
32903
32904impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
32905    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
32906        f.write_str(self.as_str())
32907    }
32908}
32909impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage {
32910    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
32911    where
32912        S: serde::Serializer,
32913    {
32914        serializer.serialize_str(self.as_str())
32915    }
32916}
32917#[cfg(feature = "deserialize")]
32918impl<'de> serde::Deserialize<'de>
32919    for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage
32920{
32921    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
32922        use std::str::FromStr;
32923        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
32924        Ok(Self::from_str(&s).expect("infallible"))
32925    }
32926}
32927/// If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options.
32928#[derive(Clone, Debug, serde::Serialize)]
32929pub struct ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
32930    /// Controls when the funds are captured from the customer's account.
32931    ///
32932    /// 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.
32933    ///
32934    /// 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.
32935    #[serde(skip_serializing_if = "Option::is_none")]
32936    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod>,
32937    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
32938    ///
32939    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
32940    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
32941    ///
32942    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
32943    ///
32944    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
32945    #[serde(skip_serializing_if = "Option::is_none")]
32946    pub setup_future_usage:
32947        Option<ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage>,
32948}
32949impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
32950    pub fn new() -> Self {
32951        Self { capture_method: None, setup_future_usage: None }
32952    }
32953}
32954impl Default for ConfirmPaymentIntentPaymentMethodOptionsKakaoPay {
32955    fn default() -> Self {
32956        Self::new()
32957    }
32958}
32959/// Controls when the funds are captured from the customer's account.
32960///
32961/// 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.
32962///
32963/// 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.
32964#[derive(Clone, Eq, PartialEq)]
32965#[non_exhaustive]
32966pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
32967    Manual,
32968    /// An unrecognized value from Stripe. Should not be used as a request parameter.
32969    Unknown(String),
32970}
32971impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
32972    pub fn as_str(&self) -> &str {
32973        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
32974        match self {
32975            Manual => "manual",
32976            Unknown(v) => v,
32977        }
32978    }
32979}
32980
32981impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
32982    type Err = std::convert::Infallible;
32983    fn from_str(s: &str) -> Result<Self, Self::Err> {
32984        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod::*;
32985        match s {
32986            "manual" => Ok(Manual),
32987            v => {
32988                tracing::warn!(
32989                    "Unknown value '{}' for enum '{}'",
32990                    v,
32991                    "ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod"
32992                );
32993                Ok(Unknown(v.to_owned()))
32994            }
32995        }
32996    }
32997}
32998impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
32999    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33000        f.write_str(self.as_str())
33001    }
33002}
33003
33004impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
33005    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33006        f.write_str(self.as_str())
33007    }
33008}
33009impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod {
33010    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33011    where
33012        S: serde::Serializer,
33013    {
33014        serializer.serialize_str(self.as_str())
33015    }
33016}
33017#[cfg(feature = "deserialize")]
33018impl<'de> serde::Deserialize<'de>
33019    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPayCaptureMethod
33020{
33021    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33022        use std::str::FromStr;
33023        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33024        Ok(Self::from_str(&s).expect("infallible"))
33025    }
33026}
33027/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33028///
33029/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33030/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33031///
33032/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33033///
33034/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33035#[derive(Clone, Eq, PartialEq)]
33036#[non_exhaustive]
33037pub enum ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
33038    None,
33039    OffSession,
33040    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33041    Unknown(String),
33042}
33043impl ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
33044    pub fn as_str(&self) -> &str {
33045        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
33046        match self {
33047            None => "none",
33048            OffSession => "off_session",
33049            Unknown(v) => v,
33050        }
33051    }
33052}
33053
33054impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
33055    type Err = std::convert::Infallible;
33056    fn from_str(s: &str) -> Result<Self, Self::Err> {
33057        use ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage::*;
33058        match s {
33059            "none" => Ok(None),
33060            "off_session" => Ok(OffSession),
33061            v => {
33062                tracing::warn!(
33063                    "Unknown value '{}' for enum '{}'",
33064                    v,
33065                    "ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage"
33066                );
33067                Ok(Unknown(v.to_owned()))
33068            }
33069        }
33070    }
33071}
33072impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
33073    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33074        f.write_str(self.as_str())
33075    }
33076}
33077
33078impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
33079    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33080        f.write_str(self.as_str())
33081    }
33082}
33083impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage {
33084    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33085    where
33086        S: serde::Serializer,
33087    {
33088        serializer.serialize_str(self.as_str())
33089    }
33090}
33091#[cfg(feature = "deserialize")]
33092impl<'de> serde::Deserialize<'de>
33093    for ConfirmPaymentIntentPaymentMethodOptionsKakaoPaySetupFutureUsage
33094{
33095    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33096        use std::str::FromStr;
33097        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33098        Ok(Self::from_str(&s).expect("infallible"))
33099    }
33100}
33101/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
33102#[derive(Clone, Debug, serde::Serialize)]
33103pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarna {
33104    /// Controls when the funds are captured from the customer's account.
33105    ///
33106    /// 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.
33107    ///
33108    /// 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.
33109    #[serde(skip_serializing_if = "Option::is_none")]
33110    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod>,
33111    /// On-demand details if setting up or charging an on-demand payment.
33112    #[serde(skip_serializing_if = "Option::is_none")]
33113    pub on_demand: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand>,
33114    /// Preferred language of the Klarna authorization page that the customer is redirected to
33115    #[serde(skip_serializing_if = "Option::is_none")]
33116    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale>,
33117    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33118    ///
33119    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33120    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33121    ///
33122    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33123    ///
33124    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33125    ///
33126    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33127    #[serde(skip_serializing_if = "Option::is_none")]
33128    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage>,
33129    /// Subscription details if setting up or charging a subscription.
33130    #[serde(skip_serializing_if = "Option::is_none")]
33131    pub subscriptions: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions>>,
33132}
33133impl ConfirmPaymentIntentPaymentMethodOptionsKlarna {
33134    pub fn new() -> Self {
33135        Self {
33136            capture_method: None,
33137            on_demand: None,
33138            preferred_locale: None,
33139            setup_future_usage: None,
33140            subscriptions: None,
33141        }
33142    }
33143}
33144impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarna {
33145    fn default() -> Self {
33146        Self::new()
33147    }
33148}
33149/// Controls when the funds are captured from the customer's account.
33150///
33151/// 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.
33152///
33153/// 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.
33154#[derive(Clone, Eq, PartialEq)]
33155#[non_exhaustive]
33156pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33157    Manual,
33158    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33159    Unknown(String),
33160}
33161impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33162    pub fn as_str(&self) -> &str {
33163        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
33164        match self {
33165            Manual => "manual",
33166            Unknown(v) => v,
33167        }
33168    }
33169}
33170
33171impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33172    type Err = std::convert::Infallible;
33173    fn from_str(s: &str) -> Result<Self, Self::Err> {
33174        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*;
33175        match s {
33176            "manual" => Ok(Manual),
33177            v => {
33178                tracing::warn!(
33179                    "Unknown value '{}' for enum '{}'",
33180                    v,
33181                    "ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod"
33182                );
33183                Ok(Unknown(v.to_owned()))
33184            }
33185        }
33186    }
33187}
33188impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33190        f.write_str(self.as_str())
33191    }
33192}
33193
33194impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33195    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33196        f.write_str(self.as_str())
33197    }
33198}
33199impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33200    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33201    where
33202        S: serde::Serializer,
33203    {
33204        serializer.serialize_str(self.as_str())
33205    }
33206}
33207#[cfg(feature = "deserialize")]
33208impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod {
33209    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33210        use std::str::FromStr;
33211        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33212        Ok(Self::from_str(&s).expect("infallible"))
33213    }
33214}
33215/// On-demand details if setting up or charging an on-demand payment.
33216#[derive(Clone, Debug, serde::Serialize)]
33217pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
33218    /// Your average amount value.
33219    /// You can use a value across your customer base, or segment based on customer type, country, etc.
33220    #[serde(skip_serializing_if = "Option::is_none")]
33221    pub average_amount: Option<i64>,
33222    /// The maximum value you may charge a customer per purchase.
33223    /// You can use a value across your customer base, or segment based on customer type, country, etc.
33224    #[serde(skip_serializing_if = "Option::is_none")]
33225    pub maximum_amount: Option<i64>,
33226    /// The lowest or minimum value you may charge a customer per purchase.
33227    /// You can use a value across your customer base, or segment based on customer type, country, etc.
33228    #[serde(skip_serializing_if = "Option::is_none")]
33229    pub minimum_amount: Option<i64>,
33230    /// Interval at which the customer is making purchases
33231    #[serde(skip_serializing_if = "Option::is_none")]
33232    pub purchase_interval:
33233        Option<ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
33234    /// The number of `purchase_interval` between charges
33235    #[serde(skip_serializing_if = "Option::is_none")]
33236    pub purchase_interval_count: Option<u64>,
33237}
33238impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
33239    pub fn new() -> Self {
33240        Self {
33241            average_amount: None,
33242            maximum_amount: None,
33243            minimum_amount: None,
33244            purchase_interval: None,
33245            purchase_interval_count: None,
33246        }
33247    }
33248}
33249impl Default for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemand {
33250    fn default() -> Self {
33251        Self::new()
33252    }
33253}
33254/// Interval at which the customer is making purchases
33255#[derive(Clone, Eq, PartialEq)]
33256#[non_exhaustive]
33257pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
33258    Day,
33259    Month,
33260    Week,
33261    Year,
33262    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33263    Unknown(String),
33264}
33265impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
33266    pub fn as_str(&self) -> &str {
33267        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
33268        match self {
33269            Day => "day",
33270            Month => "month",
33271            Week => "week",
33272            Year => "year",
33273            Unknown(v) => v,
33274        }
33275    }
33276}
33277
33278impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
33279    type Err = std::convert::Infallible;
33280    fn from_str(s: &str) -> Result<Self, Self::Err> {
33281        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
33282        match s {
33283            "day" => Ok(Day),
33284            "month" => Ok(Month),
33285            "week" => Ok(Week),
33286            "year" => Ok(Year),
33287            v => {
33288                tracing::warn!(
33289                    "Unknown value '{}' for enum '{}'",
33290                    v,
33291                    "ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
33292                );
33293                Ok(Unknown(v.to_owned()))
33294            }
33295        }
33296    }
33297}
33298impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
33299    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33300        f.write_str(self.as_str())
33301    }
33302}
33303
33304impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
33305    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33306        f.write_str(self.as_str())
33307    }
33308}
33309impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
33310    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33311    where
33312        S: serde::Serializer,
33313    {
33314        serializer.serialize_str(self.as_str())
33315    }
33316}
33317#[cfg(feature = "deserialize")]
33318impl<'de> serde::Deserialize<'de>
33319    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
33320{
33321    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33322        use std::str::FromStr;
33323        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33324        Ok(Self::from_str(&s).expect("infallible"))
33325    }
33326}
33327/// Preferred language of the Klarna authorization page that the customer is redirected to
33328#[derive(Clone, Eq, PartialEq)]
33329#[non_exhaustive]
33330pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
33331    CsMinusCz,
33332    DaMinusDk,
33333    DeMinusAt,
33334    DeMinusCh,
33335    DeMinusDe,
33336    ElMinusGr,
33337    EnMinusAt,
33338    EnMinusAu,
33339    EnMinusBe,
33340    EnMinusCa,
33341    EnMinusCh,
33342    EnMinusCz,
33343    EnMinusDe,
33344    EnMinusDk,
33345    EnMinusEs,
33346    EnMinusFi,
33347    EnMinusFr,
33348    EnMinusGb,
33349    EnMinusGr,
33350    EnMinusIe,
33351    EnMinusIt,
33352    EnMinusNl,
33353    EnMinusNo,
33354    EnMinusNz,
33355    EnMinusPl,
33356    EnMinusPt,
33357    EnMinusRo,
33358    EnMinusSe,
33359    EnMinusUs,
33360    EsMinusEs,
33361    EsMinusUs,
33362    FiMinusFi,
33363    FrMinusBe,
33364    FrMinusCa,
33365    FrMinusCh,
33366    FrMinusFr,
33367    ItMinusCh,
33368    ItMinusIt,
33369    NbMinusNo,
33370    NlMinusBe,
33371    NlMinusNl,
33372    PlMinusPl,
33373    PtMinusPt,
33374    RoMinusRo,
33375    SvMinusFi,
33376    SvMinusSe,
33377    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33378    Unknown(String),
33379}
33380impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
33381    pub fn as_str(&self) -> &str {
33382        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
33383        match self {
33384            CsMinusCz => "cs-CZ",
33385            DaMinusDk => "da-DK",
33386            DeMinusAt => "de-AT",
33387            DeMinusCh => "de-CH",
33388            DeMinusDe => "de-DE",
33389            ElMinusGr => "el-GR",
33390            EnMinusAt => "en-AT",
33391            EnMinusAu => "en-AU",
33392            EnMinusBe => "en-BE",
33393            EnMinusCa => "en-CA",
33394            EnMinusCh => "en-CH",
33395            EnMinusCz => "en-CZ",
33396            EnMinusDe => "en-DE",
33397            EnMinusDk => "en-DK",
33398            EnMinusEs => "en-ES",
33399            EnMinusFi => "en-FI",
33400            EnMinusFr => "en-FR",
33401            EnMinusGb => "en-GB",
33402            EnMinusGr => "en-GR",
33403            EnMinusIe => "en-IE",
33404            EnMinusIt => "en-IT",
33405            EnMinusNl => "en-NL",
33406            EnMinusNo => "en-NO",
33407            EnMinusNz => "en-NZ",
33408            EnMinusPl => "en-PL",
33409            EnMinusPt => "en-PT",
33410            EnMinusRo => "en-RO",
33411            EnMinusSe => "en-SE",
33412            EnMinusUs => "en-US",
33413            EsMinusEs => "es-ES",
33414            EsMinusUs => "es-US",
33415            FiMinusFi => "fi-FI",
33416            FrMinusBe => "fr-BE",
33417            FrMinusCa => "fr-CA",
33418            FrMinusCh => "fr-CH",
33419            FrMinusFr => "fr-FR",
33420            ItMinusCh => "it-CH",
33421            ItMinusIt => "it-IT",
33422            NbMinusNo => "nb-NO",
33423            NlMinusBe => "nl-BE",
33424            NlMinusNl => "nl-NL",
33425            PlMinusPl => "pl-PL",
33426            PtMinusPt => "pt-PT",
33427            RoMinusRo => "ro-RO",
33428            SvMinusFi => "sv-FI",
33429            SvMinusSe => "sv-SE",
33430            Unknown(v) => v,
33431        }
33432    }
33433}
33434
33435impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
33436    type Err = std::convert::Infallible;
33437    fn from_str(s: &str) -> Result<Self, Self::Err> {
33438        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
33439        match s {
33440            "cs-CZ" => Ok(CsMinusCz),
33441            "da-DK" => Ok(DaMinusDk),
33442            "de-AT" => Ok(DeMinusAt),
33443            "de-CH" => Ok(DeMinusCh),
33444            "de-DE" => Ok(DeMinusDe),
33445            "el-GR" => Ok(ElMinusGr),
33446            "en-AT" => Ok(EnMinusAt),
33447            "en-AU" => Ok(EnMinusAu),
33448            "en-BE" => Ok(EnMinusBe),
33449            "en-CA" => Ok(EnMinusCa),
33450            "en-CH" => Ok(EnMinusCh),
33451            "en-CZ" => Ok(EnMinusCz),
33452            "en-DE" => Ok(EnMinusDe),
33453            "en-DK" => Ok(EnMinusDk),
33454            "en-ES" => Ok(EnMinusEs),
33455            "en-FI" => Ok(EnMinusFi),
33456            "en-FR" => Ok(EnMinusFr),
33457            "en-GB" => Ok(EnMinusGb),
33458            "en-GR" => Ok(EnMinusGr),
33459            "en-IE" => Ok(EnMinusIe),
33460            "en-IT" => Ok(EnMinusIt),
33461            "en-NL" => Ok(EnMinusNl),
33462            "en-NO" => Ok(EnMinusNo),
33463            "en-NZ" => Ok(EnMinusNz),
33464            "en-PL" => Ok(EnMinusPl),
33465            "en-PT" => Ok(EnMinusPt),
33466            "en-RO" => Ok(EnMinusRo),
33467            "en-SE" => Ok(EnMinusSe),
33468            "en-US" => Ok(EnMinusUs),
33469            "es-ES" => Ok(EsMinusEs),
33470            "es-US" => Ok(EsMinusUs),
33471            "fi-FI" => Ok(FiMinusFi),
33472            "fr-BE" => Ok(FrMinusBe),
33473            "fr-CA" => Ok(FrMinusCa),
33474            "fr-CH" => Ok(FrMinusCh),
33475            "fr-FR" => Ok(FrMinusFr),
33476            "it-CH" => Ok(ItMinusCh),
33477            "it-IT" => Ok(ItMinusIt),
33478            "nb-NO" => Ok(NbMinusNo),
33479            "nl-BE" => Ok(NlMinusBe),
33480            "nl-NL" => Ok(NlMinusNl),
33481            "pl-PL" => Ok(PlMinusPl),
33482            "pt-PT" => Ok(PtMinusPt),
33483            "ro-RO" => Ok(RoMinusRo),
33484            "sv-FI" => Ok(SvMinusFi),
33485            "sv-SE" => Ok(SvMinusSe),
33486            v => {
33487                tracing::warn!(
33488                    "Unknown value '{}' for enum '{}'",
33489                    v,
33490                    "ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale"
33491                );
33492                Ok(Unknown(v.to_owned()))
33493            }
33494        }
33495    }
33496}
33497impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
33498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33499        f.write_str(self.as_str())
33500    }
33501}
33502
33503impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
33504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33505        f.write_str(self.as_str())
33506    }
33507}
33508impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale {
33509    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33510    where
33511        S: serde::Serializer,
33512    {
33513        serializer.serialize_str(self.as_str())
33514    }
33515}
33516#[cfg(feature = "deserialize")]
33517impl<'de> serde::Deserialize<'de>
33518    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale
33519{
33520    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33521        use std::str::FromStr;
33522        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33523        Ok(Self::from_str(&s).expect("infallible"))
33524    }
33525}
33526/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33527///
33528/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33529/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33530///
33531/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33532///
33533/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33534///
33535/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33536#[derive(Clone, Eq, PartialEq)]
33537#[non_exhaustive]
33538pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
33539    None,
33540    OffSession,
33541    OnSession,
33542    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33543    Unknown(String),
33544}
33545impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
33546    pub fn as_str(&self) -> &str {
33547        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
33548        match self {
33549            None => "none",
33550            OffSession => "off_session",
33551            OnSession => "on_session",
33552            Unknown(v) => v,
33553        }
33554    }
33555}
33556
33557impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
33558    type Err = std::convert::Infallible;
33559    fn from_str(s: &str) -> Result<Self, Self::Err> {
33560        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*;
33561        match s {
33562            "none" => Ok(None),
33563            "off_session" => Ok(OffSession),
33564            "on_session" => Ok(OnSession),
33565            v => {
33566                tracing::warn!(
33567                    "Unknown value '{}' for enum '{}'",
33568                    v,
33569                    "ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage"
33570                );
33571                Ok(Unknown(v.to_owned()))
33572            }
33573        }
33574    }
33575}
33576impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
33577    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33578        f.write_str(self.as_str())
33579    }
33580}
33581
33582impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
33583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33584        f.write_str(self.as_str())
33585    }
33586}
33587impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage {
33588    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33589    where
33590        S: serde::Serializer,
33591    {
33592        serializer.serialize_str(self.as_str())
33593    }
33594}
33595#[cfg(feature = "deserialize")]
33596impl<'de> serde::Deserialize<'de>
33597    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage
33598{
33599    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33600        use std::str::FromStr;
33601        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33602        Ok(Self::from_str(&s).expect("infallible"))
33603    }
33604}
33605/// Subscription details if setting up or charging a subscription.
33606#[derive(Clone, Debug, serde::Serialize)]
33607pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
33608    /// Unit of time between subscription charges.
33609    pub interval: ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
33610    /// The number of intervals (specified in the `interval` attribute) between subscription charges.
33611    /// For example, `interval=month` and `interval_count=3` charges every 3 months.
33612    #[serde(skip_serializing_if = "Option::is_none")]
33613    pub interval_count: Option<u64>,
33614    /// Name for subscription.
33615    #[serde(skip_serializing_if = "Option::is_none")]
33616    pub name: Option<String>,
33617    /// Describes the upcoming charge for this subscription.
33618    #[serde(skip_serializing_if = "Option::is_none")]
33619    pub next_billing: Option<SubscriptionNextBillingParam>,
33620    /// A non-customer-facing reference to correlate subscription charges in the Klarna app.
33621    /// Use a value that persists across subscription charges.
33622    pub reference: String,
33623}
33624impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptions {
33625    pub fn new(
33626        interval: impl Into<ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
33627        reference: impl Into<String>,
33628    ) -> Self {
33629        Self {
33630            interval: interval.into(),
33631            interval_count: None,
33632            name: None,
33633            next_billing: None,
33634            reference: reference.into(),
33635        }
33636    }
33637}
33638/// Unit of time between subscription charges.
33639#[derive(Clone, Eq, PartialEq)]
33640#[non_exhaustive]
33641pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
33642    Day,
33643    Month,
33644    Week,
33645    Year,
33646    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33647    Unknown(String),
33648}
33649impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
33650    pub fn as_str(&self) -> &str {
33651        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
33652        match self {
33653            Day => "day",
33654            Month => "month",
33655            Week => "week",
33656            Year => "year",
33657            Unknown(v) => v,
33658        }
33659    }
33660}
33661
33662impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
33663    type Err = std::convert::Infallible;
33664    fn from_str(s: &str) -> Result<Self, Self::Err> {
33665        use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
33666        match s {
33667            "day" => Ok(Day),
33668            "month" => Ok(Month),
33669            "week" => Ok(Week),
33670            "year" => Ok(Year),
33671            v => {
33672                tracing::warn!(
33673                    "Unknown value '{}' for enum '{}'",
33674                    v,
33675                    "ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
33676                );
33677                Ok(Unknown(v.to_owned()))
33678            }
33679        }
33680    }
33681}
33682impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
33683    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33684        f.write_str(self.as_str())
33685    }
33686}
33687
33688impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
33689    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33690        f.write_str(self.as_str())
33691    }
33692}
33693impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
33694    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33695    where
33696        S: serde::Serializer,
33697    {
33698        serializer.serialize_str(self.as_str())
33699    }
33700}
33701#[cfg(feature = "deserialize")]
33702impl<'de> serde::Deserialize<'de>
33703    for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
33704{
33705    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33706        use std::str::FromStr;
33707        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33708        Ok(Self::from_str(&s).expect("infallible"))
33709    }
33710}
33711/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options.
33712#[derive(Clone, Debug, serde::Serialize)]
33713pub struct ConfirmPaymentIntentPaymentMethodOptionsKonbini {
33714    /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.
33715    /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness.
33716    /// We recommend to use the customer's phone number.
33717    #[serde(skip_serializing_if = "Option::is_none")]
33718    pub confirmation_number: Option<String>,
33719    /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire.
33720    /// 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.
33721    /// Defaults to 3 days.
33722    #[serde(skip_serializing_if = "Option::is_none")]
33723    pub expires_after_days: Option<u32>,
33724    /// The timestamp at which the Konbini payment instructions will expire.
33725    /// Only one of `expires_after_days` or `expires_at` may be set.
33726    #[serde(skip_serializing_if = "Option::is_none")]
33727    pub expires_at: Option<stripe_types::Timestamp>,
33728    /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store.
33729    #[serde(skip_serializing_if = "Option::is_none")]
33730    pub product_description: Option<String>,
33731    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33732    ///
33733    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33734    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33735    ///
33736    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33737    ///
33738    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33739    ///
33740    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33741    #[serde(skip_serializing_if = "Option::is_none")]
33742    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage>,
33743}
33744impl ConfirmPaymentIntentPaymentMethodOptionsKonbini {
33745    pub fn new() -> Self {
33746        Self {
33747            confirmation_number: None,
33748            expires_after_days: None,
33749            expires_at: None,
33750            product_description: None,
33751            setup_future_usage: None,
33752        }
33753    }
33754}
33755impl Default for ConfirmPaymentIntentPaymentMethodOptionsKonbini {
33756    fn default() -> Self {
33757        Self::new()
33758    }
33759}
33760/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33761///
33762/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33763/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33764///
33765/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33766///
33767/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33768///
33769/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
33770#[derive(Clone, Eq, PartialEq)]
33771#[non_exhaustive]
33772pub enum ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
33773    None,
33774    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33775    Unknown(String),
33776}
33777impl ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
33778    pub fn as_str(&self) -> &str {
33779        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
33780        match self {
33781            None => "none",
33782            Unknown(v) => v,
33783        }
33784    }
33785}
33786
33787impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
33788    type Err = std::convert::Infallible;
33789    fn from_str(s: &str) -> Result<Self, Self::Err> {
33790        use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*;
33791        match s {
33792            "none" => Ok(None),
33793            v => {
33794                tracing::warn!(
33795                    "Unknown value '{}' for enum '{}'",
33796                    v,
33797                    "ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage"
33798                );
33799                Ok(Unknown(v.to_owned()))
33800            }
33801        }
33802    }
33803}
33804impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
33805    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33806        f.write_str(self.as_str())
33807    }
33808}
33809
33810impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
33811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33812        f.write_str(self.as_str())
33813    }
33814}
33815impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage {
33816    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33817    where
33818        S: serde::Serializer,
33819    {
33820        serializer.serialize_str(self.as_str())
33821    }
33822}
33823#[cfg(feature = "deserialize")]
33824impl<'de> serde::Deserialize<'de>
33825    for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage
33826{
33827    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33828        use std::str::FromStr;
33829        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33830        Ok(Self::from_str(&s).expect("infallible"))
33831    }
33832}
33833/// If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options.
33834#[derive(Clone, Debug, serde::Serialize)]
33835pub struct ConfirmPaymentIntentPaymentMethodOptionsKrCard {
33836    /// Controls when the funds are captured from the customer's account.
33837    ///
33838    /// 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.
33839    ///
33840    /// 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.
33841    #[serde(skip_serializing_if = "Option::is_none")]
33842    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod>,
33843    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33844    ///
33845    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33846    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33847    ///
33848    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33849    ///
33850    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33851    #[serde(skip_serializing_if = "Option::is_none")]
33852    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage>,
33853}
33854impl ConfirmPaymentIntentPaymentMethodOptionsKrCard {
33855    pub fn new() -> Self {
33856        Self { capture_method: None, setup_future_usage: None }
33857    }
33858}
33859impl Default for ConfirmPaymentIntentPaymentMethodOptionsKrCard {
33860    fn default() -> Self {
33861        Self::new()
33862    }
33863}
33864/// Controls when the funds are captured from the customer's account.
33865///
33866/// 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.
33867///
33868/// 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.
33869#[derive(Clone, Eq, PartialEq)]
33870#[non_exhaustive]
33871pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33872    Manual,
33873    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33874    Unknown(String),
33875}
33876impl ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33877    pub fn as_str(&self) -> &str {
33878        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
33879        match self {
33880            Manual => "manual",
33881            Unknown(v) => v,
33882        }
33883    }
33884}
33885
33886impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33887    type Err = std::convert::Infallible;
33888    fn from_str(s: &str) -> Result<Self, Self::Err> {
33889        use ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod::*;
33890        match s {
33891            "manual" => Ok(Manual),
33892            v => {
33893                tracing::warn!(
33894                    "Unknown value '{}' for enum '{}'",
33895                    v,
33896                    "ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod"
33897                );
33898                Ok(Unknown(v.to_owned()))
33899            }
33900        }
33901    }
33902}
33903impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33904    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33905        f.write_str(self.as_str())
33906    }
33907}
33908
33909impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33910    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33911        f.write_str(self.as_str())
33912    }
33913}
33914impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33915    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33916    where
33917        S: serde::Serializer,
33918    {
33919        serializer.serialize_str(self.as_str())
33920    }
33921}
33922#[cfg(feature = "deserialize")]
33923impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsKrCardCaptureMethod {
33924    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33925        use std::str::FromStr;
33926        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
33927        Ok(Self::from_str(&s).expect("infallible"))
33928    }
33929}
33930/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
33931///
33932/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
33933/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
33934///
33935/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
33936///
33937/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
33938#[derive(Clone, Eq, PartialEq)]
33939#[non_exhaustive]
33940pub enum ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
33941    None,
33942    OffSession,
33943    /// An unrecognized value from Stripe. Should not be used as a request parameter.
33944    Unknown(String),
33945}
33946impl ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
33947    pub fn as_str(&self) -> &str {
33948        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
33949        match self {
33950            None => "none",
33951            OffSession => "off_session",
33952            Unknown(v) => v,
33953        }
33954    }
33955}
33956
33957impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
33958    type Err = std::convert::Infallible;
33959    fn from_str(s: &str) -> Result<Self, Self::Err> {
33960        use ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage::*;
33961        match s {
33962            "none" => Ok(None),
33963            "off_session" => Ok(OffSession),
33964            v => {
33965                tracing::warn!(
33966                    "Unknown value '{}' for enum '{}'",
33967                    v,
33968                    "ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage"
33969                );
33970                Ok(Unknown(v.to_owned()))
33971            }
33972        }
33973    }
33974}
33975impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
33976    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33977        f.write_str(self.as_str())
33978    }
33979}
33980
33981impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
33982    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33983        f.write_str(self.as_str())
33984    }
33985}
33986impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage {
33987    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33988    where
33989        S: serde::Serializer,
33990    {
33991        serializer.serialize_str(self.as_str())
33992    }
33993}
33994#[cfg(feature = "deserialize")]
33995impl<'de> serde::Deserialize<'de>
33996    for ConfirmPaymentIntentPaymentMethodOptionsKrCardSetupFutureUsage
33997{
33998    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
33999        use std::str::FromStr;
34000        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34001        Ok(Self::from_str(&s).expect("infallible"))
34002    }
34003}
34004/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
34005#[derive(Clone, Debug, serde::Serialize)]
34006pub struct ConfirmPaymentIntentPaymentMethodOptionsLink {
34007    /// Controls when the funds are captured from the customer's account.
34008    ///
34009    /// 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.
34010    ///
34011    /// 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.
34012    #[serde(skip_serializing_if = "Option::is_none")]
34013    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod>,
34014    /// \[Deprecated\] This is a legacy parameter that no longer has any function.
34015    #[serde(skip_serializing_if = "Option::is_none")]
34016    pub persistent_token: Option<String>,
34017    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34018    ///
34019    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34020    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34021    ///
34022    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34023    ///
34024    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34025    ///
34026    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34027    #[serde(skip_serializing_if = "Option::is_none")]
34028    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage>,
34029}
34030impl ConfirmPaymentIntentPaymentMethodOptionsLink {
34031    pub fn new() -> Self {
34032        Self { capture_method: None, persistent_token: None, setup_future_usage: None }
34033    }
34034}
34035impl Default for ConfirmPaymentIntentPaymentMethodOptionsLink {
34036    fn default() -> Self {
34037        Self::new()
34038    }
34039}
34040/// Controls when the funds are captured from the customer's account.
34041///
34042/// 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.
34043///
34044/// 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.
34045#[derive(Clone, Eq, PartialEq)]
34046#[non_exhaustive]
34047pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34048    Manual,
34049    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34050    Unknown(String),
34051}
34052impl ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34053    pub fn as_str(&self) -> &str {
34054        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
34055        match self {
34056            Manual => "manual",
34057            Unknown(v) => v,
34058        }
34059    }
34060}
34061
34062impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34063    type Err = std::convert::Infallible;
34064    fn from_str(s: &str) -> Result<Self, Self::Err> {
34065        use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*;
34066        match s {
34067            "manual" => Ok(Manual),
34068            v => {
34069                tracing::warn!(
34070                    "Unknown value '{}' for enum '{}'",
34071                    v,
34072                    "ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod"
34073                );
34074                Ok(Unknown(v.to_owned()))
34075            }
34076        }
34077    }
34078}
34079impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34080    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34081        f.write_str(self.as_str())
34082    }
34083}
34084
34085impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34086    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34087        f.write_str(self.as_str())
34088    }
34089}
34090impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34091    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34092    where
34093        S: serde::Serializer,
34094    {
34095        serializer.serialize_str(self.as_str())
34096    }
34097}
34098#[cfg(feature = "deserialize")]
34099impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod {
34100    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34101        use std::str::FromStr;
34102        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34103        Ok(Self::from_str(&s).expect("infallible"))
34104    }
34105}
34106/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34107///
34108/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34109/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34110///
34111/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34112///
34113/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34114///
34115/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34116#[derive(Clone, Eq, PartialEq)]
34117#[non_exhaustive]
34118pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34119    None,
34120    OffSession,
34121    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34122    Unknown(String),
34123}
34124impl ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34125    pub fn as_str(&self) -> &str {
34126        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
34127        match self {
34128            None => "none",
34129            OffSession => "off_session",
34130            Unknown(v) => v,
34131        }
34132    }
34133}
34134
34135impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34136    type Err = std::convert::Infallible;
34137    fn from_str(s: &str) -> Result<Self, Self::Err> {
34138        use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*;
34139        match s {
34140            "none" => Ok(None),
34141            "off_session" => Ok(OffSession),
34142            v => {
34143                tracing::warn!(
34144                    "Unknown value '{}' for enum '{}'",
34145                    v,
34146                    "ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage"
34147                );
34148                Ok(Unknown(v.to_owned()))
34149            }
34150        }
34151    }
34152}
34153impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34154    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34155        f.write_str(self.as_str())
34156    }
34157}
34158
34159impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34160    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34161        f.write_str(self.as_str())
34162    }
34163}
34164impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34165    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34166    where
34167        S: serde::Serializer,
34168    {
34169        serializer.serialize_str(self.as_str())
34170    }
34171}
34172#[cfg(feature = "deserialize")]
34173impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage {
34174    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34175        use std::str::FromStr;
34176        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34177        Ok(Self::from_str(&s).expect("infallible"))
34178    }
34179}
34180/// If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options.
34181#[derive(Clone, Debug, serde::Serialize)]
34182pub struct ConfirmPaymentIntentPaymentMethodOptionsMbWay {
34183    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34184    ///
34185    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34186    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34187    ///
34188    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34189    ///
34190    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34191    ///
34192    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34193    #[serde(skip_serializing_if = "Option::is_none")]
34194    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage>,
34195}
34196impl ConfirmPaymentIntentPaymentMethodOptionsMbWay {
34197    pub fn new() -> Self {
34198        Self { setup_future_usage: None }
34199    }
34200}
34201impl Default for ConfirmPaymentIntentPaymentMethodOptionsMbWay {
34202    fn default() -> Self {
34203        Self::new()
34204    }
34205}
34206/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34207///
34208/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34209/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34210///
34211/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34212///
34213/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34214///
34215/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34216#[derive(Clone, Eq, PartialEq)]
34217#[non_exhaustive]
34218pub enum ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
34219    None,
34220    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34221    Unknown(String),
34222}
34223impl ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
34224    pub fn as_str(&self) -> &str {
34225        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
34226        match self {
34227            None => "none",
34228            Unknown(v) => v,
34229        }
34230    }
34231}
34232
34233impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
34234    type Err = std::convert::Infallible;
34235    fn from_str(s: &str) -> Result<Self, Self::Err> {
34236        use ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage::*;
34237        match s {
34238            "none" => Ok(None),
34239            v => {
34240                tracing::warn!(
34241                    "Unknown value '{}' for enum '{}'",
34242                    v,
34243                    "ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage"
34244                );
34245                Ok(Unknown(v.to_owned()))
34246            }
34247        }
34248    }
34249}
34250impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
34251    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34252        f.write_str(self.as_str())
34253    }
34254}
34255
34256impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
34257    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34258        f.write_str(self.as_str())
34259    }
34260}
34261impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage {
34262    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34263    where
34264        S: serde::Serializer,
34265    {
34266        serializer.serialize_str(self.as_str())
34267    }
34268}
34269#[cfg(feature = "deserialize")]
34270impl<'de> serde::Deserialize<'de>
34271    for ConfirmPaymentIntentPaymentMethodOptionsMbWaySetupFutureUsage
34272{
34273    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34274        use std::str::FromStr;
34275        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34276        Ok(Self::from_str(&s).expect("infallible"))
34277    }
34278}
34279/// If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options.
34280#[derive(Clone, Debug, serde::Serialize)]
34281pub struct ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
34282    /// Controls when the funds are captured from the customer's account.
34283    ///
34284    /// 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.
34285    ///
34286    /// 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.
34287    #[serde(skip_serializing_if = "Option::is_none")]
34288    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod>,
34289    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34290    ///
34291    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34292    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34293    ///
34294    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34295    ///
34296    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34297    ///
34298    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34299    #[serde(skip_serializing_if = "Option::is_none")]
34300    pub setup_future_usage:
34301        Option<ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage>,
34302}
34303impl ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
34304    pub fn new() -> Self {
34305        Self { capture_method: None, setup_future_usage: None }
34306    }
34307}
34308impl Default for ConfirmPaymentIntentPaymentMethodOptionsMobilepay {
34309    fn default() -> Self {
34310        Self::new()
34311    }
34312}
34313/// Controls when the funds are captured from the customer's account.
34314///
34315/// 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.
34316///
34317/// 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.
34318#[derive(Clone, Eq, PartialEq)]
34319#[non_exhaustive]
34320pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
34321    Manual,
34322    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34323    Unknown(String),
34324}
34325impl ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
34326    pub fn as_str(&self) -> &str {
34327        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
34328        match self {
34329            Manual => "manual",
34330            Unknown(v) => v,
34331        }
34332    }
34333}
34334
34335impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
34336    type Err = std::convert::Infallible;
34337    fn from_str(s: &str) -> Result<Self, Self::Err> {
34338        use ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod::*;
34339        match s {
34340            "manual" => Ok(Manual),
34341            v => {
34342                tracing::warn!(
34343                    "Unknown value '{}' for enum '{}'",
34344                    v,
34345                    "ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod"
34346                );
34347                Ok(Unknown(v.to_owned()))
34348            }
34349        }
34350    }
34351}
34352impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
34353    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34354        f.write_str(self.as_str())
34355    }
34356}
34357
34358impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
34359    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34360        f.write_str(self.as_str())
34361    }
34362}
34363impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod {
34364    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34365    where
34366        S: serde::Serializer,
34367    {
34368        serializer.serialize_str(self.as_str())
34369    }
34370}
34371#[cfg(feature = "deserialize")]
34372impl<'de> serde::Deserialize<'de>
34373    for ConfirmPaymentIntentPaymentMethodOptionsMobilepayCaptureMethod
34374{
34375    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34376        use std::str::FromStr;
34377        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34378        Ok(Self::from_str(&s).expect("infallible"))
34379    }
34380}
34381/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34382///
34383/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34384/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34385///
34386/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34387///
34388/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34389///
34390/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34391#[derive(Clone, Eq, PartialEq)]
34392#[non_exhaustive]
34393pub enum ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
34394    None,
34395    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34396    Unknown(String),
34397}
34398impl ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
34399    pub fn as_str(&self) -> &str {
34400        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
34401        match self {
34402            None => "none",
34403            Unknown(v) => v,
34404        }
34405    }
34406}
34407
34408impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
34409    type Err = std::convert::Infallible;
34410    fn from_str(s: &str) -> Result<Self, Self::Err> {
34411        use ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage::*;
34412        match s {
34413            "none" => Ok(None),
34414            v => {
34415                tracing::warn!(
34416                    "Unknown value '{}' for enum '{}'",
34417                    v,
34418                    "ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage"
34419                );
34420                Ok(Unknown(v.to_owned()))
34421            }
34422        }
34423    }
34424}
34425impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
34426    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34427        f.write_str(self.as_str())
34428    }
34429}
34430
34431impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
34432    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34433        f.write_str(self.as_str())
34434    }
34435}
34436impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage {
34437    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34438    where
34439        S: serde::Serializer,
34440    {
34441        serializer.serialize_str(self.as_str())
34442    }
34443}
34444#[cfg(feature = "deserialize")]
34445impl<'de> serde::Deserialize<'de>
34446    for ConfirmPaymentIntentPaymentMethodOptionsMobilepaySetupFutureUsage
34447{
34448    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34449        use std::str::FromStr;
34450        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34451        Ok(Self::from_str(&s).expect("infallible"))
34452    }
34453}
34454/// If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options.
34455#[derive(Clone, Debug, serde::Serialize)]
34456pub struct ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
34457    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34458    ///
34459    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34460    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34461    ///
34462    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34463    ///
34464    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34465    ///
34466    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34467    #[serde(skip_serializing_if = "Option::is_none")]
34468    pub setup_future_usage:
34469        Option<ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage>,
34470}
34471impl ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
34472    pub fn new() -> Self {
34473        Self { setup_future_usage: None }
34474    }
34475}
34476impl Default for ConfirmPaymentIntentPaymentMethodOptionsMultibanco {
34477    fn default() -> Self {
34478        Self::new()
34479    }
34480}
34481/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34482///
34483/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34484/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34485///
34486/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34487///
34488/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34489///
34490/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34491#[derive(Clone, Eq, PartialEq)]
34492#[non_exhaustive]
34493pub enum ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
34494    None,
34495    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34496    Unknown(String),
34497}
34498impl ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
34499    pub fn as_str(&self) -> &str {
34500        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
34501        match self {
34502            None => "none",
34503            Unknown(v) => v,
34504        }
34505    }
34506}
34507
34508impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
34509    type Err = std::convert::Infallible;
34510    fn from_str(s: &str) -> Result<Self, Self::Err> {
34511        use ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage::*;
34512        match s {
34513            "none" => Ok(None),
34514            v => {
34515                tracing::warn!(
34516                    "Unknown value '{}' for enum '{}'",
34517                    v,
34518                    "ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage"
34519                );
34520                Ok(Unknown(v.to_owned()))
34521            }
34522        }
34523    }
34524}
34525impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
34526    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34527        f.write_str(self.as_str())
34528    }
34529}
34530
34531impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
34532    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34533        f.write_str(self.as_str())
34534    }
34535}
34536impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage {
34537    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34538    where
34539        S: serde::Serializer,
34540    {
34541        serializer.serialize_str(self.as_str())
34542    }
34543}
34544#[cfg(feature = "deserialize")]
34545impl<'de> serde::Deserialize<'de>
34546    for ConfirmPaymentIntentPaymentMethodOptionsMultibancoSetupFutureUsage
34547{
34548    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34549        use std::str::FromStr;
34550        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34551        Ok(Self::from_str(&s).expect("infallible"))
34552    }
34553}
34554/// If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options.
34555#[derive(Clone, Debug, serde::Serialize)]
34556pub struct ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
34557    /// Controls when the funds are captured from the customer's account.
34558    ///
34559    /// 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.
34560    ///
34561    /// 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.
34562    #[serde(skip_serializing_if = "Option::is_none")]
34563    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod>,
34564    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34565    ///
34566    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34567    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34568    ///
34569    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34570    ///
34571    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34572    #[serde(skip_serializing_if = "Option::is_none")]
34573    pub setup_future_usage:
34574        Option<ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage>,
34575}
34576impl ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
34577    pub fn new() -> Self {
34578        Self { capture_method: None, setup_future_usage: None }
34579    }
34580}
34581impl Default for ConfirmPaymentIntentPaymentMethodOptionsNaverPay {
34582    fn default() -> Self {
34583        Self::new()
34584    }
34585}
34586/// Controls when the funds are captured from the customer's account.
34587///
34588/// 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.
34589///
34590/// 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.
34591#[derive(Clone, Eq, PartialEq)]
34592#[non_exhaustive]
34593pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
34594    Manual,
34595    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34596    Unknown(String),
34597}
34598impl ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
34599    pub fn as_str(&self) -> &str {
34600        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
34601        match self {
34602            Manual => "manual",
34603            Unknown(v) => v,
34604        }
34605    }
34606}
34607
34608impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
34609    type Err = std::convert::Infallible;
34610    fn from_str(s: &str) -> Result<Self, Self::Err> {
34611        use ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod::*;
34612        match s {
34613            "manual" => Ok(Manual),
34614            v => {
34615                tracing::warn!(
34616                    "Unknown value '{}' for enum '{}'",
34617                    v,
34618                    "ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod"
34619                );
34620                Ok(Unknown(v.to_owned()))
34621            }
34622        }
34623    }
34624}
34625impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
34626    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34627        f.write_str(self.as_str())
34628    }
34629}
34630
34631impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
34632    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34633        f.write_str(self.as_str())
34634    }
34635}
34636impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod {
34637    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34638    where
34639        S: serde::Serializer,
34640    {
34641        serializer.serialize_str(self.as_str())
34642    }
34643}
34644#[cfg(feature = "deserialize")]
34645impl<'de> serde::Deserialize<'de>
34646    for ConfirmPaymentIntentPaymentMethodOptionsNaverPayCaptureMethod
34647{
34648    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34649        use std::str::FromStr;
34650        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34651        Ok(Self::from_str(&s).expect("infallible"))
34652    }
34653}
34654/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34655///
34656/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34657/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34658///
34659/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34660///
34661/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34662#[derive(Clone, Eq, PartialEq)]
34663#[non_exhaustive]
34664pub enum ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
34665    None,
34666    OffSession,
34667    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34668    Unknown(String),
34669}
34670impl ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
34671    pub fn as_str(&self) -> &str {
34672        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
34673        match self {
34674            None => "none",
34675            OffSession => "off_session",
34676            Unknown(v) => v,
34677        }
34678    }
34679}
34680
34681impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
34682    type Err = std::convert::Infallible;
34683    fn from_str(s: &str) -> Result<Self, Self::Err> {
34684        use ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage::*;
34685        match s {
34686            "none" => Ok(None),
34687            "off_session" => Ok(OffSession),
34688            v => {
34689                tracing::warn!(
34690                    "Unknown value '{}' for enum '{}'",
34691                    v,
34692                    "ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage"
34693                );
34694                Ok(Unknown(v.to_owned()))
34695            }
34696        }
34697    }
34698}
34699impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
34700    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34701        f.write_str(self.as_str())
34702    }
34703}
34704
34705impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
34706    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34707        f.write_str(self.as_str())
34708    }
34709}
34710impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage {
34711    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34712    where
34713        S: serde::Serializer,
34714    {
34715        serializer.serialize_str(self.as_str())
34716    }
34717}
34718#[cfg(feature = "deserialize")]
34719impl<'de> serde::Deserialize<'de>
34720    for ConfirmPaymentIntentPaymentMethodOptionsNaverPaySetupFutureUsage
34721{
34722    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34723        use std::str::FromStr;
34724        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34725        Ok(Self::from_str(&s).expect("infallible"))
34726    }
34727}
34728/// If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options.
34729#[derive(Clone, Debug, serde::Serialize)]
34730pub struct ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
34731    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34732    ///
34733    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34734    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34735    ///
34736    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34737    ///
34738    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34739    ///
34740    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34741    #[serde(skip_serializing_if = "Option::is_none")]
34742    pub setup_future_usage:
34743        Option<ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage>,
34744    /// Controls when Stripe will attempt to debit the funds from the customer's account.
34745    /// The date must be a string in YYYY-MM-DD format.
34746    /// The date must be in the future and between 3 and 15 calendar days from now.
34747    #[serde(skip_serializing_if = "Option::is_none")]
34748    pub target_date: Option<String>,
34749}
34750impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
34751    pub fn new() -> Self {
34752        Self { setup_future_usage: None, target_date: None }
34753    }
34754}
34755impl Default for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccount {
34756    fn default() -> Self {
34757        Self::new()
34758    }
34759}
34760/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34761///
34762/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34763/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34764///
34765/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34766///
34767/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34768///
34769/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34770#[derive(Clone, Eq, PartialEq)]
34771#[non_exhaustive]
34772pub enum ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
34773    None,
34774    OffSession,
34775    OnSession,
34776    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34777    Unknown(String),
34778}
34779impl ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
34780    pub fn as_str(&self) -> &str {
34781        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
34782        match self {
34783            None => "none",
34784            OffSession => "off_session",
34785            OnSession => "on_session",
34786            Unknown(v) => v,
34787        }
34788    }
34789}
34790
34791impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
34792    type Err = std::convert::Infallible;
34793    fn from_str(s: &str) -> Result<Self, Self::Err> {
34794        use ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage::*;
34795        match s {
34796            "none" => Ok(None),
34797            "off_session" => Ok(OffSession),
34798            "on_session" => Ok(OnSession),
34799            v => {
34800                tracing::warn!(
34801                    "Unknown value '{}' for enum '{}'",
34802                    v,
34803                    "ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage"
34804                );
34805                Ok(Unknown(v.to_owned()))
34806            }
34807        }
34808    }
34809}
34810impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
34811    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34812        f.write_str(self.as_str())
34813    }
34814}
34815
34816impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
34817    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34818        f.write_str(self.as_str())
34819    }
34820}
34821impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage {
34822    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34823    where
34824        S: serde::Serializer,
34825    {
34826        serializer.serialize_str(self.as_str())
34827    }
34828}
34829#[cfg(feature = "deserialize")]
34830impl<'de> serde::Deserialize<'de>
34831    for ConfirmPaymentIntentPaymentMethodOptionsNzBankAccountSetupFutureUsage
34832{
34833    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34834        use std::str::FromStr;
34835        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34836        Ok(Self::from_str(&s).expect("infallible"))
34837    }
34838}
34839/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
34840#[derive(Clone, Debug, serde::Serialize)]
34841pub struct ConfirmPaymentIntentPaymentMethodOptionsOxxo {
34842    /// The number of calendar days before an OXXO voucher expires.
34843    /// 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.
34844    #[serde(skip_serializing_if = "Option::is_none")]
34845    pub expires_after_days: Option<u32>,
34846    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34847    ///
34848    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34849    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34850    ///
34851    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34852    ///
34853    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34854    ///
34855    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34856    #[serde(skip_serializing_if = "Option::is_none")]
34857    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage>,
34858}
34859impl ConfirmPaymentIntentPaymentMethodOptionsOxxo {
34860    pub fn new() -> Self {
34861        Self { expires_after_days: None, setup_future_usage: None }
34862    }
34863}
34864impl Default for ConfirmPaymentIntentPaymentMethodOptionsOxxo {
34865    fn default() -> Self {
34866        Self::new()
34867    }
34868}
34869/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34870///
34871/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34872/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34873///
34874/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34875///
34876/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34877///
34878/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34879#[derive(Clone, Eq, PartialEq)]
34880#[non_exhaustive]
34881pub enum ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34882    None,
34883    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34884    Unknown(String),
34885}
34886impl ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34887    pub fn as_str(&self) -> &str {
34888        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
34889        match self {
34890            None => "none",
34891            Unknown(v) => v,
34892        }
34893    }
34894}
34895
34896impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34897    type Err = std::convert::Infallible;
34898    fn from_str(s: &str) -> Result<Self, Self::Err> {
34899        use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*;
34900        match s {
34901            "none" => Ok(None),
34902            v => {
34903                tracing::warn!(
34904                    "Unknown value '{}' for enum '{}'",
34905                    v,
34906                    "ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage"
34907                );
34908                Ok(Unknown(v.to_owned()))
34909            }
34910        }
34911    }
34912}
34913impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34914    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34915        f.write_str(self.as_str())
34916    }
34917}
34918
34919impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34920    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
34921        f.write_str(self.as_str())
34922    }
34923}
34924impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34925    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
34926    where
34927        S: serde::Serializer,
34928    {
34929        serializer.serialize_str(self.as_str())
34930    }
34931}
34932#[cfg(feature = "deserialize")]
34933impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage {
34934    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
34935        use std::str::FromStr;
34936        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
34937        Ok(Self::from_str(&s).expect("infallible"))
34938    }
34939}
34940/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options.
34941#[derive(Clone, Debug, serde::Serialize)]
34942pub struct ConfirmPaymentIntentPaymentMethodOptionsP24 {
34943    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34944    ///
34945    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34946    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34947    ///
34948    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34949    ///
34950    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34951    ///
34952    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34953    #[serde(skip_serializing_if = "Option::is_none")]
34954    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage>,
34955    /// Confirm that the payer has accepted the P24 terms and conditions.
34956    #[serde(skip_serializing_if = "Option::is_none")]
34957    pub tos_shown_and_accepted: Option<bool>,
34958}
34959impl ConfirmPaymentIntentPaymentMethodOptionsP24 {
34960    pub fn new() -> Self {
34961        Self { setup_future_usage: None, tos_shown_and_accepted: None }
34962    }
34963}
34964impl Default for ConfirmPaymentIntentPaymentMethodOptionsP24 {
34965    fn default() -> Self {
34966        Self::new()
34967    }
34968}
34969/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
34970///
34971/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
34972/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
34973///
34974/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
34975///
34976/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
34977///
34978/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
34979#[derive(Clone, Eq, PartialEq)]
34980#[non_exhaustive]
34981pub enum ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
34982    None,
34983    /// An unrecognized value from Stripe. Should not be used as a request parameter.
34984    Unknown(String),
34985}
34986impl ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
34987    pub fn as_str(&self) -> &str {
34988        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
34989        match self {
34990            None => "none",
34991            Unknown(v) => v,
34992        }
34993    }
34994}
34995
34996impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
34997    type Err = std::convert::Infallible;
34998    fn from_str(s: &str) -> Result<Self, Self::Err> {
34999        use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*;
35000        match s {
35001            "none" => Ok(None),
35002            v => {
35003                tracing::warn!(
35004                    "Unknown value '{}' for enum '{}'",
35005                    v,
35006                    "ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage"
35007                );
35008                Ok(Unknown(v.to_owned()))
35009            }
35010        }
35011    }
35012}
35013impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
35014    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35015        f.write_str(self.as_str())
35016    }
35017}
35018
35019impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
35020    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35021        f.write_str(self.as_str())
35022    }
35023}
35024impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
35025    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35026    where
35027        S: serde::Serializer,
35028    {
35029        serializer.serialize_str(self.as_str())
35030    }
35031}
35032#[cfg(feature = "deserialize")]
35033impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage {
35034    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35035        use std::str::FromStr;
35036        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35037        Ok(Self::from_str(&s).expect("infallible"))
35038    }
35039}
35040/// If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options.
35041#[derive(Clone, Debug, serde::Serialize)]
35042pub struct ConfirmPaymentIntentPaymentMethodOptionsPayco {
35043    /// Controls when the funds are captured from the customer's account.
35044    ///
35045    /// 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.
35046    ///
35047    /// 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.
35048    #[serde(skip_serializing_if = "Option::is_none")]
35049    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod>,
35050}
35051impl ConfirmPaymentIntentPaymentMethodOptionsPayco {
35052    pub fn new() -> Self {
35053        Self { capture_method: None }
35054    }
35055}
35056impl Default for ConfirmPaymentIntentPaymentMethodOptionsPayco {
35057    fn default() -> Self {
35058        Self::new()
35059    }
35060}
35061/// Controls when the funds are captured from the customer's account.
35062///
35063/// 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.
35064///
35065/// 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.
35066#[derive(Clone, Eq, PartialEq)]
35067#[non_exhaustive]
35068pub enum ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35069    Manual,
35070    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35071    Unknown(String),
35072}
35073impl ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35074    pub fn as_str(&self) -> &str {
35075        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
35076        match self {
35077            Manual => "manual",
35078            Unknown(v) => v,
35079        }
35080    }
35081}
35082
35083impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35084    type Err = std::convert::Infallible;
35085    fn from_str(s: &str) -> Result<Self, Self::Err> {
35086        use ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod::*;
35087        match s {
35088            "manual" => Ok(Manual),
35089            v => {
35090                tracing::warn!(
35091                    "Unknown value '{}' for enum '{}'",
35092                    v,
35093                    "ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod"
35094                );
35095                Ok(Unknown(v.to_owned()))
35096            }
35097        }
35098    }
35099}
35100impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35101    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35102        f.write_str(self.as_str())
35103    }
35104}
35105
35106impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35107    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35108        f.write_str(self.as_str())
35109    }
35110}
35111impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35112    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35113    where
35114        S: serde::Serializer,
35115    {
35116        serializer.serialize_str(self.as_str())
35117    }
35118}
35119#[cfg(feature = "deserialize")]
35120impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaycoCaptureMethod {
35121    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35122        use std::str::FromStr;
35123        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35124        Ok(Self::from_str(&s).expect("infallible"))
35125    }
35126}
35127/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options.
35128#[derive(Clone, Debug, serde::Serialize)]
35129pub struct ConfirmPaymentIntentPaymentMethodOptionsPaynow {
35130    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35131    ///
35132    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35133    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35134    ///
35135    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35136    ///
35137    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35138    ///
35139    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35140    #[serde(skip_serializing_if = "Option::is_none")]
35141    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage>,
35142}
35143impl ConfirmPaymentIntentPaymentMethodOptionsPaynow {
35144    pub fn new() -> Self {
35145        Self { setup_future_usage: None }
35146    }
35147}
35148impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaynow {
35149    fn default() -> Self {
35150        Self::new()
35151    }
35152}
35153/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35154///
35155/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35156/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35157///
35158/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35159///
35160/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35161///
35162/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35163#[derive(Clone, Eq, PartialEq)]
35164#[non_exhaustive]
35165pub enum ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
35166    None,
35167    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35168    Unknown(String),
35169}
35170impl ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
35171    pub fn as_str(&self) -> &str {
35172        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
35173        match self {
35174            None => "none",
35175            Unknown(v) => v,
35176        }
35177    }
35178}
35179
35180impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
35181    type Err = std::convert::Infallible;
35182    fn from_str(s: &str) -> Result<Self, Self::Err> {
35183        use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*;
35184        match s {
35185            "none" => Ok(None),
35186            v => {
35187                tracing::warn!(
35188                    "Unknown value '{}' for enum '{}'",
35189                    v,
35190                    "ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage"
35191                );
35192                Ok(Unknown(v.to_owned()))
35193            }
35194        }
35195    }
35196}
35197impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
35198    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35199        f.write_str(self.as_str())
35200    }
35201}
35202
35203impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
35204    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35205        f.write_str(self.as_str())
35206    }
35207}
35208impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage {
35209    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35210    where
35211        S: serde::Serializer,
35212    {
35213        serializer.serialize_str(self.as_str())
35214    }
35215}
35216#[cfg(feature = "deserialize")]
35217impl<'de> serde::Deserialize<'de>
35218    for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage
35219{
35220    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35221        use std::str::FromStr;
35222        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35223        Ok(Self::from_str(&s).expect("infallible"))
35224    }
35225}
35226/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
35227#[derive(Clone, Debug, serde::Serialize)]
35228pub struct ConfirmPaymentIntentPaymentMethodOptionsPaypal {
35229    /// Controls when the funds will be captured from the customer's account.
35230    #[serde(skip_serializing_if = "Option::is_none")]
35231    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod>,
35232    /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
35233    #[serde(skip_serializing_if = "Option::is_none")]
35234    pub preferred_locale: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale>,
35235    /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID.
35236    /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
35237    #[serde(skip_serializing_if = "Option::is_none")]
35238    pub reference: Option<String>,
35239    /// The risk correlation ID for an on-session payment using a saved PayPal payment method.
35240    #[serde(skip_serializing_if = "Option::is_none")]
35241    pub risk_correlation_id: Option<String>,
35242    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35243    ///
35244    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35245    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35246    ///
35247    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35248    ///
35249    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35250    ///
35251    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35252    #[serde(skip_serializing_if = "Option::is_none")]
35253    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage>,
35254}
35255impl ConfirmPaymentIntentPaymentMethodOptionsPaypal {
35256    pub fn new() -> Self {
35257        Self {
35258            capture_method: None,
35259            preferred_locale: None,
35260            reference: None,
35261            risk_correlation_id: None,
35262            setup_future_usage: None,
35263        }
35264    }
35265}
35266impl Default for ConfirmPaymentIntentPaymentMethodOptionsPaypal {
35267    fn default() -> Self {
35268        Self::new()
35269    }
35270}
35271/// Controls when the funds will be captured from the customer's account.
35272#[derive(Clone, Eq, PartialEq)]
35273#[non_exhaustive]
35274pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35275    Manual,
35276    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35277    Unknown(String),
35278}
35279impl ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35280    pub fn as_str(&self) -> &str {
35281        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
35282        match self {
35283            Manual => "manual",
35284            Unknown(v) => v,
35285        }
35286    }
35287}
35288
35289impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35290    type Err = std::convert::Infallible;
35291    fn from_str(s: &str) -> Result<Self, Self::Err> {
35292        use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*;
35293        match s {
35294            "manual" => Ok(Manual),
35295            v => {
35296                tracing::warn!(
35297                    "Unknown value '{}' for enum '{}'",
35298                    v,
35299                    "ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod"
35300                );
35301                Ok(Unknown(v.to_owned()))
35302            }
35303        }
35304    }
35305}
35306impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35307    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35308        f.write_str(self.as_str())
35309    }
35310}
35311
35312impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35313    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35314        f.write_str(self.as_str())
35315    }
35316}
35317impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35318    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35319    where
35320        S: serde::Serializer,
35321    {
35322        serializer.serialize_str(self.as_str())
35323    }
35324}
35325#[cfg(feature = "deserialize")]
35326impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod {
35327    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35328        use std::str::FromStr;
35329        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35330        Ok(Self::from_str(&s).expect("infallible"))
35331    }
35332}
35333/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
35334#[derive(Clone, Eq, PartialEq)]
35335#[non_exhaustive]
35336pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
35337    CsMinusCz,
35338    DaMinusDk,
35339    DeMinusAt,
35340    DeMinusDe,
35341    DeMinusLu,
35342    ElMinusGr,
35343    EnMinusGb,
35344    EnMinusUs,
35345    EsMinusEs,
35346    FiMinusFi,
35347    FrMinusBe,
35348    FrMinusFr,
35349    FrMinusLu,
35350    HuMinusHu,
35351    ItMinusIt,
35352    NlMinusBe,
35353    NlMinusNl,
35354    PlMinusPl,
35355    PtMinusPt,
35356    SkMinusSk,
35357    SvMinusSe,
35358    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35359    Unknown(String),
35360}
35361impl ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
35362    pub fn as_str(&self) -> &str {
35363        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
35364        match self {
35365            CsMinusCz => "cs-CZ",
35366            DaMinusDk => "da-DK",
35367            DeMinusAt => "de-AT",
35368            DeMinusDe => "de-DE",
35369            DeMinusLu => "de-LU",
35370            ElMinusGr => "el-GR",
35371            EnMinusGb => "en-GB",
35372            EnMinusUs => "en-US",
35373            EsMinusEs => "es-ES",
35374            FiMinusFi => "fi-FI",
35375            FrMinusBe => "fr-BE",
35376            FrMinusFr => "fr-FR",
35377            FrMinusLu => "fr-LU",
35378            HuMinusHu => "hu-HU",
35379            ItMinusIt => "it-IT",
35380            NlMinusBe => "nl-BE",
35381            NlMinusNl => "nl-NL",
35382            PlMinusPl => "pl-PL",
35383            PtMinusPt => "pt-PT",
35384            SkMinusSk => "sk-SK",
35385            SvMinusSe => "sv-SE",
35386            Unknown(v) => v,
35387        }
35388    }
35389}
35390
35391impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
35392    type Err = std::convert::Infallible;
35393    fn from_str(s: &str) -> Result<Self, Self::Err> {
35394        use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*;
35395        match s {
35396            "cs-CZ" => Ok(CsMinusCz),
35397            "da-DK" => Ok(DaMinusDk),
35398            "de-AT" => Ok(DeMinusAt),
35399            "de-DE" => Ok(DeMinusDe),
35400            "de-LU" => Ok(DeMinusLu),
35401            "el-GR" => Ok(ElMinusGr),
35402            "en-GB" => Ok(EnMinusGb),
35403            "en-US" => Ok(EnMinusUs),
35404            "es-ES" => Ok(EsMinusEs),
35405            "fi-FI" => Ok(FiMinusFi),
35406            "fr-BE" => Ok(FrMinusBe),
35407            "fr-FR" => Ok(FrMinusFr),
35408            "fr-LU" => Ok(FrMinusLu),
35409            "hu-HU" => Ok(HuMinusHu),
35410            "it-IT" => Ok(ItMinusIt),
35411            "nl-BE" => Ok(NlMinusBe),
35412            "nl-NL" => Ok(NlMinusNl),
35413            "pl-PL" => Ok(PlMinusPl),
35414            "pt-PT" => Ok(PtMinusPt),
35415            "sk-SK" => Ok(SkMinusSk),
35416            "sv-SE" => Ok(SvMinusSe),
35417            v => {
35418                tracing::warn!(
35419                    "Unknown value '{}' for enum '{}'",
35420                    v,
35421                    "ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale"
35422                );
35423                Ok(Unknown(v.to_owned()))
35424            }
35425        }
35426    }
35427}
35428impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
35429    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35430        f.write_str(self.as_str())
35431    }
35432}
35433
35434impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
35435    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35436        f.write_str(self.as_str())
35437    }
35438}
35439impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale {
35440    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35441    where
35442        S: serde::Serializer,
35443    {
35444        serializer.serialize_str(self.as_str())
35445    }
35446}
35447#[cfg(feature = "deserialize")]
35448impl<'de> serde::Deserialize<'de>
35449    for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale
35450{
35451    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35452        use std::str::FromStr;
35453        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35454        Ok(Self::from_str(&s).expect("infallible"))
35455    }
35456}
35457/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35458///
35459/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35460/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35461///
35462/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35463///
35464/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35465///
35466/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35467#[derive(Clone, Eq, PartialEq)]
35468#[non_exhaustive]
35469pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
35470    None,
35471    OffSession,
35472    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35473    Unknown(String),
35474}
35475impl ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
35476    pub fn as_str(&self) -> &str {
35477        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
35478        match self {
35479            None => "none",
35480            OffSession => "off_session",
35481            Unknown(v) => v,
35482        }
35483    }
35484}
35485
35486impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
35487    type Err = std::convert::Infallible;
35488    fn from_str(s: &str) -> Result<Self, Self::Err> {
35489        use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*;
35490        match s {
35491            "none" => Ok(None),
35492            "off_session" => Ok(OffSession),
35493            v => {
35494                tracing::warn!(
35495                    "Unknown value '{}' for enum '{}'",
35496                    v,
35497                    "ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage"
35498                );
35499                Ok(Unknown(v.to_owned()))
35500            }
35501        }
35502    }
35503}
35504impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
35505    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35506        f.write_str(self.as_str())
35507    }
35508}
35509
35510impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
35511    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35512        f.write_str(self.as_str())
35513    }
35514}
35515impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage {
35516    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35517    where
35518        S: serde::Serializer,
35519    {
35520        serializer.serialize_str(self.as_str())
35521    }
35522}
35523#[cfg(feature = "deserialize")]
35524impl<'de> serde::Deserialize<'de>
35525    for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage
35526{
35527    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35528        use std::str::FromStr;
35529        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35530        Ok(Self::from_str(&s).expect("infallible"))
35531    }
35532}
35533/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options.
35534#[derive(Clone, Debug, serde::Serialize)]
35535pub struct ConfirmPaymentIntentPaymentMethodOptionsPix {
35536    /// Determines if the amount includes the IOF tax. Defaults to `never`.
35537    #[serde(skip_serializing_if = "Option::is_none")]
35538    pub amount_includes_iof: Option<ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof>,
35539    /// The number of seconds (between 10 and 1209600) after which Pix payment will expire.
35540    /// Defaults to 86400 seconds.
35541    #[serde(skip_serializing_if = "Option::is_none")]
35542    pub expires_after_seconds: Option<i64>,
35543    /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future).
35544    /// Defaults to 1 day in the future.
35545    #[serde(skip_serializing_if = "Option::is_none")]
35546    pub expires_at: Option<stripe_types::Timestamp>,
35547    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35548    ///
35549    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35550    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35551    ///
35552    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35553    ///
35554    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35555    ///
35556    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35557    #[serde(skip_serializing_if = "Option::is_none")]
35558    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage>,
35559}
35560impl ConfirmPaymentIntentPaymentMethodOptionsPix {
35561    pub fn new() -> Self {
35562        Self {
35563            amount_includes_iof: None,
35564            expires_after_seconds: None,
35565            expires_at: None,
35566            setup_future_usage: None,
35567        }
35568    }
35569}
35570impl Default for ConfirmPaymentIntentPaymentMethodOptionsPix {
35571    fn default() -> Self {
35572        Self::new()
35573    }
35574}
35575/// Determines if the amount includes the IOF tax. Defaults to `never`.
35576#[derive(Clone, Eq, PartialEq)]
35577#[non_exhaustive]
35578pub enum ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35579    Always,
35580    Never,
35581    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35582    Unknown(String),
35583}
35584impl ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35585    pub fn as_str(&self) -> &str {
35586        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
35587        match self {
35588            Always => "always",
35589            Never => "never",
35590            Unknown(v) => v,
35591        }
35592    }
35593}
35594
35595impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35596    type Err = std::convert::Infallible;
35597    fn from_str(s: &str) -> Result<Self, Self::Err> {
35598        use ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof::*;
35599        match s {
35600            "always" => Ok(Always),
35601            "never" => Ok(Never),
35602            v => {
35603                tracing::warn!(
35604                    "Unknown value '{}' for enum '{}'",
35605                    v,
35606                    "ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof"
35607                );
35608                Ok(Unknown(v.to_owned()))
35609            }
35610        }
35611    }
35612}
35613impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35614    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35615        f.write_str(self.as_str())
35616    }
35617}
35618
35619impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35620    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35621        f.write_str(self.as_str())
35622    }
35623}
35624impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35625    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35626    where
35627        S: serde::Serializer,
35628    {
35629        serializer.serialize_str(self.as_str())
35630    }
35631}
35632#[cfg(feature = "deserialize")]
35633impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixAmountIncludesIof {
35634    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35635        use std::str::FromStr;
35636        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35637        Ok(Self::from_str(&s).expect("infallible"))
35638    }
35639}
35640/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35641///
35642/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35643/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35644///
35645/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35646///
35647/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35648///
35649/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35650#[derive(Clone, Eq, PartialEq)]
35651#[non_exhaustive]
35652pub enum ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35653    None,
35654    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35655    Unknown(String),
35656}
35657impl ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35658    pub fn as_str(&self) -> &str {
35659        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
35660        match self {
35661            None => "none",
35662            Unknown(v) => v,
35663        }
35664    }
35665}
35666
35667impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35668    type Err = std::convert::Infallible;
35669    fn from_str(s: &str) -> Result<Self, Self::Err> {
35670        use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*;
35671        match s {
35672            "none" => Ok(None),
35673            v => {
35674                tracing::warn!(
35675                    "Unknown value '{}' for enum '{}'",
35676                    v,
35677                    "ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage"
35678                );
35679                Ok(Unknown(v.to_owned()))
35680            }
35681        }
35682    }
35683}
35684impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35685    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35686        f.write_str(self.as_str())
35687    }
35688}
35689
35690impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35691    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35692        f.write_str(self.as_str())
35693    }
35694}
35695impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35696    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35697    where
35698        S: serde::Serializer,
35699    {
35700        serializer.serialize_str(self.as_str())
35701    }
35702}
35703#[cfg(feature = "deserialize")]
35704impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage {
35705    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35706        use std::str::FromStr;
35707        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35708        Ok(Self::from_str(&s).expect("infallible"))
35709    }
35710}
35711/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options.
35712#[derive(Clone, Debug, serde::Serialize)]
35713pub struct ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
35714    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35715    ///
35716    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35717    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35718    ///
35719    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35720    ///
35721    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35722    ///
35723    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35724    #[serde(skip_serializing_if = "Option::is_none")]
35725    pub setup_future_usage:
35726        Option<ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage>,
35727}
35728impl ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
35729    pub fn new() -> Self {
35730        Self { setup_future_usage: None }
35731    }
35732}
35733impl Default for ConfirmPaymentIntentPaymentMethodOptionsPromptpay {
35734    fn default() -> Self {
35735        Self::new()
35736    }
35737}
35738/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35739///
35740/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35741/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35742///
35743/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35744///
35745/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35746///
35747/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
35748#[derive(Clone, Eq, PartialEq)]
35749#[non_exhaustive]
35750pub enum ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
35751    None,
35752    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35753    Unknown(String),
35754}
35755impl ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
35756    pub fn as_str(&self) -> &str {
35757        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
35758        match self {
35759            None => "none",
35760            Unknown(v) => v,
35761        }
35762    }
35763}
35764
35765impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
35766    type Err = std::convert::Infallible;
35767    fn from_str(s: &str) -> Result<Self, Self::Err> {
35768        use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*;
35769        match s {
35770            "none" => Ok(None),
35771            v => {
35772                tracing::warn!(
35773                    "Unknown value '{}' for enum '{}'",
35774                    v,
35775                    "ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage"
35776                );
35777                Ok(Unknown(v.to_owned()))
35778            }
35779        }
35780    }
35781}
35782impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
35783    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35784        f.write_str(self.as_str())
35785    }
35786}
35787
35788impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
35789    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35790        f.write_str(self.as_str())
35791    }
35792}
35793impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage {
35794    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35795    where
35796        S: serde::Serializer,
35797    {
35798        serializer.serialize_str(self.as_str())
35799    }
35800}
35801#[cfg(feature = "deserialize")]
35802impl<'de> serde::Deserialize<'de>
35803    for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage
35804{
35805    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35806        use std::str::FromStr;
35807        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35808        Ok(Self::from_str(&s).expect("infallible"))
35809    }
35810}
35811/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options.
35812#[derive(Clone, Debug, serde::Serialize)]
35813pub struct ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
35814    /// Controls when the funds are captured from the customer's account.
35815    ///
35816    /// 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.
35817    ///
35818    /// 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.
35819    #[serde(skip_serializing_if = "Option::is_none")]
35820    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod>,
35821    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35822    ///
35823    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35824    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35825    ///
35826    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35827    ///
35828    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35829    #[serde(skip_serializing_if = "Option::is_none")]
35830    pub setup_future_usage:
35831        Option<ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage>,
35832}
35833impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
35834    pub fn new() -> Self {
35835        Self { capture_method: None, setup_future_usage: None }
35836    }
35837}
35838impl Default for ConfirmPaymentIntentPaymentMethodOptionsRevolutPay {
35839    fn default() -> Self {
35840        Self::new()
35841    }
35842}
35843/// Controls when the funds are captured from the customer's account.
35844///
35845/// 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.
35846///
35847/// 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.
35848#[derive(Clone, Eq, PartialEq)]
35849#[non_exhaustive]
35850pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
35851    Manual,
35852    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35853    Unknown(String),
35854}
35855impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
35856    pub fn as_str(&self) -> &str {
35857        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
35858        match self {
35859            Manual => "manual",
35860            Unknown(v) => v,
35861        }
35862    }
35863}
35864
35865impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
35866    type Err = std::convert::Infallible;
35867    fn from_str(s: &str) -> Result<Self, Self::Err> {
35868        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod::*;
35869        match s {
35870            "manual" => Ok(Manual),
35871            v => {
35872                tracing::warn!(
35873                    "Unknown value '{}' for enum '{}'",
35874                    v,
35875                    "ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod"
35876                );
35877                Ok(Unknown(v.to_owned()))
35878            }
35879        }
35880    }
35881}
35882impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
35883    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35884        f.write_str(self.as_str())
35885    }
35886}
35887
35888impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
35889    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35890        f.write_str(self.as_str())
35891    }
35892}
35893impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod {
35894    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35895    where
35896        S: serde::Serializer,
35897    {
35898        serializer.serialize_str(self.as_str())
35899    }
35900}
35901#[cfg(feature = "deserialize")]
35902impl<'de> serde::Deserialize<'de>
35903    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPayCaptureMethod
35904{
35905    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35906        use std::str::FromStr;
35907        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35908        Ok(Self::from_str(&s).expect("infallible"))
35909    }
35910}
35911/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
35912///
35913/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
35914/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
35915///
35916/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
35917///
35918/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
35919#[derive(Clone, Eq, PartialEq)]
35920#[non_exhaustive]
35921pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
35922    None,
35923    OffSession,
35924    /// An unrecognized value from Stripe. Should not be used as a request parameter.
35925    Unknown(String),
35926}
35927impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
35928    pub fn as_str(&self) -> &str {
35929        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
35930        match self {
35931            None => "none",
35932            OffSession => "off_session",
35933            Unknown(v) => v,
35934        }
35935    }
35936}
35937
35938impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
35939    type Err = std::convert::Infallible;
35940    fn from_str(s: &str) -> Result<Self, Self::Err> {
35941        use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*;
35942        match s {
35943            "none" => Ok(None),
35944            "off_session" => Ok(OffSession),
35945            v => {
35946                tracing::warn!(
35947                    "Unknown value '{}' for enum '{}'",
35948                    v,
35949                    "ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage"
35950                );
35951                Ok(Unknown(v.to_owned()))
35952            }
35953        }
35954    }
35955}
35956impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
35957    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35958        f.write_str(self.as_str())
35959    }
35960}
35961
35962impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
35963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35964        f.write_str(self.as_str())
35965    }
35966}
35967impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage {
35968    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
35969    where
35970        S: serde::Serializer,
35971    {
35972        serializer.serialize_str(self.as_str())
35973    }
35974}
35975#[cfg(feature = "deserialize")]
35976impl<'de> serde::Deserialize<'de>
35977    for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage
35978{
35979    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35980        use std::str::FromStr;
35981        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
35982        Ok(Self::from_str(&s).expect("infallible"))
35983    }
35984}
35985/// If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options.
35986#[derive(Clone, Debug, serde::Serialize)]
35987pub struct ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
35988    /// Controls when the funds are captured from the customer's account.
35989    ///
35990    /// 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.
35991    ///
35992    /// 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.
35993    #[serde(skip_serializing_if = "Option::is_none")]
35994    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod>,
35995}
35996impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
35997    pub fn new() -> Self {
35998        Self { capture_method: None }
35999    }
36000}
36001impl Default for ConfirmPaymentIntentPaymentMethodOptionsSamsungPay {
36002    fn default() -> Self {
36003        Self::new()
36004    }
36005}
36006/// Controls when the funds are captured from the customer's account.
36007///
36008/// 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.
36009///
36010/// 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.
36011#[derive(Clone, Eq, PartialEq)]
36012#[non_exhaustive]
36013pub enum ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
36014    Manual,
36015    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36016    Unknown(String),
36017}
36018impl ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
36019    pub fn as_str(&self) -> &str {
36020        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
36021        match self {
36022            Manual => "manual",
36023            Unknown(v) => v,
36024        }
36025    }
36026}
36027
36028impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
36029    type Err = std::convert::Infallible;
36030    fn from_str(s: &str) -> Result<Self, Self::Err> {
36031        use ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod::*;
36032        match s {
36033            "manual" => Ok(Manual),
36034            v => {
36035                tracing::warn!(
36036                    "Unknown value '{}' for enum '{}'",
36037                    v,
36038                    "ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod"
36039                );
36040                Ok(Unknown(v.to_owned()))
36041            }
36042        }
36043    }
36044}
36045impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
36046    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36047        f.write_str(self.as_str())
36048    }
36049}
36050
36051impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
36052    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36053        f.write_str(self.as_str())
36054    }
36055}
36056impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod {
36057    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36058    where
36059        S: serde::Serializer,
36060    {
36061        serializer.serialize_str(self.as_str())
36062    }
36063}
36064#[cfg(feature = "deserialize")]
36065impl<'de> serde::Deserialize<'de>
36066    for ConfirmPaymentIntentPaymentMethodOptionsSamsungPayCaptureMethod
36067{
36068    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36069        use std::str::FromStr;
36070        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36071        Ok(Self::from_str(&s).expect("infallible"))
36072    }
36073}
36074/// If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options.
36075#[derive(Clone, Debug, serde::Serialize)]
36076pub struct ConfirmPaymentIntentPaymentMethodOptionsSatispay {
36077    /// Controls when the funds are captured from the customer's account.
36078    ///
36079    /// 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.
36080    ///
36081    /// 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.
36082    #[serde(skip_serializing_if = "Option::is_none")]
36083    pub capture_method: Option<ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod>,
36084}
36085impl ConfirmPaymentIntentPaymentMethodOptionsSatispay {
36086    pub fn new() -> Self {
36087        Self { capture_method: None }
36088    }
36089}
36090impl Default for ConfirmPaymentIntentPaymentMethodOptionsSatispay {
36091    fn default() -> Self {
36092        Self::new()
36093    }
36094}
36095/// Controls when the funds are captured from the customer's account.
36096///
36097/// 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.
36098///
36099/// 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.
36100#[derive(Clone, Eq, PartialEq)]
36101#[non_exhaustive]
36102pub enum ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
36103    Manual,
36104    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36105    Unknown(String),
36106}
36107impl ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
36108    pub fn as_str(&self) -> &str {
36109        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
36110        match self {
36111            Manual => "manual",
36112            Unknown(v) => v,
36113        }
36114    }
36115}
36116
36117impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
36118    type Err = std::convert::Infallible;
36119    fn from_str(s: &str) -> Result<Self, Self::Err> {
36120        use ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod::*;
36121        match s {
36122            "manual" => Ok(Manual),
36123            v => {
36124                tracing::warn!(
36125                    "Unknown value '{}' for enum '{}'",
36126                    v,
36127                    "ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod"
36128                );
36129                Ok(Unknown(v.to_owned()))
36130            }
36131        }
36132    }
36133}
36134impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
36135    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36136        f.write_str(self.as_str())
36137    }
36138}
36139
36140impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
36141    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36142        f.write_str(self.as_str())
36143    }
36144}
36145impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod {
36146    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36147    where
36148        S: serde::Serializer,
36149    {
36150        serializer.serialize_str(self.as_str())
36151    }
36152}
36153#[cfg(feature = "deserialize")]
36154impl<'de> serde::Deserialize<'de>
36155    for ConfirmPaymentIntentPaymentMethodOptionsSatispayCaptureMethod
36156{
36157    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36158        use std::str::FromStr;
36159        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36160        Ok(Self::from_str(&s).expect("infallible"))
36161    }
36162}
36163/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options.
36164#[derive(Clone, Debug, serde::Serialize)]
36165pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
36166    /// Additional fields for Mandate creation
36167    #[serde(skip_serializing_if = "Option::is_none")]
36168    pub mandate_options: Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions>,
36169    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36170    ///
36171    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36172    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36173    ///
36174    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36175    ///
36176    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36177    ///
36178    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36179    #[serde(skip_serializing_if = "Option::is_none")]
36180    pub setup_future_usage:
36181        Option<ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage>,
36182    /// Controls when Stripe will attempt to debit the funds from the customer's account.
36183    /// The date must be a string in YYYY-MM-DD format.
36184    /// The date must be in the future and between 3 and 15 calendar days from now.
36185    #[serde(skip_serializing_if = "Option::is_none")]
36186    pub target_date: Option<String>,
36187}
36188impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
36189    pub fn new() -> Self {
36190        Self { mandate_options: None, setup_future_usage: None, target_date: None }
36191    }
36192}
36193impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebit {
36194    fn default() -> Self {
36195        Self::new()
36196    }
36197}
36198/// Additional fields for Mandate creation
36199#[derive(Clone, Debug, serde::Serialize)]
36200pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
36201    /// Prefix used to generate the Mandate reference.
36202    /// Must be at most 12 characters long.
36203    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
36204    /// Cannot begin with 'STRIPE'.
36205    #[serde(skip_serializing_if = "Option::is_none")]
36206    pub reference_prefix: Option<String>,
36207}
36208impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
36209    pub fn new() -> Self {
36210        Self { reference_prefix: None }
36211    }
36212}
36213impl Default for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {
36214    fn default() -> Self {
36215        Self::new()
36216    }
36217}
36218/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36219///
36220/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36221/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36222///
36223/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36224///
36225/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36226///
36227/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36228#[derive(Clone, Eq, PartialEq)]
36229#[non_exhaustive]
36230pub enum ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
36231    None,
36232    OffSession,
36233    OnSession,
36234    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36235    Unknown(String),
36236}
36237impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
36238    pub fn as_str(&self) -> &str {
36239        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
36240        match self {
36241            None => "none",
36242            OffSession => "off_session",
36243            OnSession => "on_session",
36244            Unknown(v) => v,
36245        }
36246    }
36247}
36248
36249impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
36250    type Err = std::convert::Infallible;
36251    fn from_str(s: &str) -> Result<Self, Self::Err> {
36252        use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*;
36253        match s {
36254            "none" => Ok(None),
36255            "off_session" => Ok(OffSession),
36256            "on_session" => Ok(OnSession),
36257            v => {
36258                tracing::warn!(
36259                    "Unknown value '{}' for enum '{}'",
36260                    v,
36261                    "ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage"
36262                );
36263                Ok(Unknown(v.to_owned()))
36264            }
36265        }
36266    }
36267}
36268impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
36269    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36270        f.write_str(self.as_str())
36271    }
36272}
36273
36274impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
36275    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36276        f.write_str(self.as_str())
36277    }
36278}
36279impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage {
36280    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36281    where
36282        S: serde::Serializer,
36283    {
36284        serializer.serialize_str(self.as_str())
36285    }
36286}
36287#[cfg(feature = "deserialize")]
36288impl<'de> serde::Deserialize<'de>
36289    for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage
36290{
36291    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36292        use std::str::FromStr;
36293        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36294        Ok(Self::from_str(&s).expect("infallible"))
36295    }
36296}
36297/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options.
36298#[derive(Clone, Debug, serde::Serialize)]
36299pub struct ConfirmPaymentIntentPaymentMethodOptionsSofort {
36300    /// Language shown to the payer on redirect.
36301    #[serde(skip_serializing_if = "Option::is_none")]
36302    pub preferred_language: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage>,
36303    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36304    ///
36305    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36306    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36307    ///
36308    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36309    ///
36310    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36311    ///
36312    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36313    #[serde(skip_serializing_if = "Option::is_none")]
36314    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage>,
36315}
36316impl ConfirmPaymentIntentPaymentMethodOptionsSofort {
36317    pub fn new() -> Self {
36318        Self { preferred_language: None, setup_future_usage: None }
36319    }
36320}
36321impl Default for ConfirmPaymentIntentPaymentMethodOptionsSofort {
36322    fn default() -> Self {
36323        Self::new()
36324    }
36325}
36326/// Language shown to the payer on redirect.
36327#[derive(Clone, Eq, PartialEq)]
36328#[non_exhaustive]
36329pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
36330    De,
36331    En,
36332    Es,
36333    Fr,
36334    It,
36335    Nl,
36336    Pl,
36337    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36338    Unknown(String),
36339}
36340impl ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
36341    pub fn as_str(&self) -> &str {
36342        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
36343        match self {
36344            De => "de",
36345            En => "en",
36346            Es => "es",
36347            Fr => "fr",
36348            It => "it",
36349            Nl => "nl",
36350            Pl => "pl",
36351            Unknown(v) => v,
36352        }
36353    }
36354}
36355
36356impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
36357    type Err = std::convert::Infallible;
36358    fn from_str(s: &str) -> Result<Self, Self::Err> {
36359        use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*;
36360        match s {
36361            "de" => Ok(De),
36362            "en" => Ok(En),
36363            "es" => Ok(Es),
36364            "fr" => Ok(Fr),
36365            "it" => Ok(It),
36366            "nl" => Ok(Nl),
36367            "pl" => Ok(Pl),
36368            v => {
36369                tracing::warn!(
36370                    "Unknown value '{}' for enum '{}'",
36371                    v,
36372                    "ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage"
36373                );
36374                Ok(Unknown(v.to_owned()))
36375            }
36376        }
36377    }
36378}
36379impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
36380    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36381        f.write_str(self.as_str())
36382    }
36383}
36384
36385impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
36386    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36387        f.write_str(self.as_str())
36388    }
36389}
36390impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage {
36391    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36392    where
36393        S: serde::Serializer,
36394    {
36395        serializer.serialize_str(self.as_str())
36396    }
36397}
36398#[cfg(feature = "deserialize")]
36399impl<'de> serde::Deserialize<'de>
36400    for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage
36401{
36402    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36403        use std::str::FromStr;
36404        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36405        Ok(Self::from_str(&s).expect("infallible"))
36406    }
36407}
36408/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36409///
36410/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36411/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36412///
36413/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36414///
36415/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36416///
36417/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36418#[derive(Clone, Eq, PartialEq)]
36419#[non_exhaustive]
36420pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
36421    None,
36422    OffSession,
36423    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36424    Unknown(String),
36425}
36426impl ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
36427    pub fn as_str(&self) -> &str {
36428        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
36429        match self {
36430            None => "none",
36431            OffSession => "off_session",
36432            Unknown(v) => v,
36433        }
36434    }
36435}
36436
36437impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
36438    type Err = std::convert::Infallible;
36439    fn from_str(s: &str) -> Result<Self, Self::Err> {
36440        use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*;
36441        match s {
36442            "none" => Ok(None),
36443            "off_session" => Ok(OffSession),
36444            v => {
36445                tracing::warn!(
36446                    "Unknown value '{}' for enum '{}'",
36447                    v,
36448                    "ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage"
36449                );
36450                Ok(Unknown(v.to_owned()))
36451            }
36452        }
36453    }
36454}
36455impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
36456    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36457        f.write_str(self.as_str())
36458    }
36459}
36460
36461impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
36462    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36463        f.write_str(self.as_str())
36464    }
36465}
36466impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage {
36467    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36468    where
36469        S: serde::Serializer,
36470    {
36471        serializer.serialize_str(self.as_str())
36472    }
36473}
36474#[cfg(feature = "deserialize")]
36475impl<'de> serde::Deserialize<'de>
36476    for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage
36477{
36478    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36479        use std::str::FromStr;
36480        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36481        Ok(Self::from_str(&s).expect("infallible"))
36482    }
36483}
36484/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options.
36485#[derive(Clone, Debug, serde::Serialize)]
36486pub struct ConfirmPaymentIntentPaymentMethodOptionsSwish {
36487    /// A reference for this payment to be displayed in the Swish app.
36488    #[serde(skip_serializing_if = "Option::is_none")]
36489    pub reference: Option<String>,
36490    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36491    ///
36492    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36493    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36494    ///
36495    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36496    ///
36497    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36498    ///
36499    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36500    #[serde(skip_serializing_if = "Option::is_none")]
36501    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage>,
36502}
36503impl ConfirmPaymentIntentPaymentMethodOptionsSwish {
36504    pub fn new() -> Self {
36505        Self { reference: None, setup_future_usage: None }
36506    }
36507}
36508impl Default for ConfirmPaymentIntentPaymentMethodOptionsSwish {
36509    fn default() -> Self {
36510        Self::new()
36511    }
36512}
36513/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36514///
36515/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36516/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36517///
36518/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36519///
36520/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36521///
36522/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36523#[derive(Clone, Eq, PartialEq)]
36524#[non_exhaustive]
36525pub enum ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
36526    None,
36527    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36528    Unknown(String),
36529}
36530impl ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
36531    pub fn as_str(&self) -> &str {
36532        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
36533        match self {
36534            None => "none",
36535            Unknown(v) => v,
36536        }
36537    }
36538}
36539
36540impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
36541    type Err = std::convert::Infallible;
36542    fn from_str(s: &str) -> Result<Self, Self::Err> {
36543        use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*;
36544        match s {
36545            "none" => Ok(None),
36546            v => {
36547                tracing::warn!(
36548                    "Unknown value '{}' for enum '{}'",
36549                    v,
36550                    "ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage"
36551                );
36552                Ok(Unknown(v.to_owned()))
36553            }
36554        }
36555    }
36556}
36557impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
36558    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36559        f.write_str(self.as_str())
36560    }
36561}
36562
36563impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
36564    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36565        f.write_str(self.as_str())
36566    }
36567}
36568impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage {
36569    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36570    where
36571        S: serde::Serializer,
36572    {
36573        serializer.serialize_str(self.as_str())
36574    }
36575}
36576#[cfg(feature = "deserialize")]
36577impl<'de> serde::Deserialize<'de>
36578    for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage
36579{
36580    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36581        use std::str::FromStr;
36582        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36583        Ok(Self::from_str(&s).expect("infallible"))
36584    }
36585}
36586/// If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options.
36587#[derive(Clone, Debug, serde::Serialize)]
36588pub struct ConfirmPaymentIntentPaymentMethodOptionsTwint {
36589    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36590    ///
36591    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36592    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36593    ///
36594    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36595    ///
36596    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36597    ///
36598    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36599    #[serde(skip_serializing_if = "Option::is_none")]
36600    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage>,
36601}
36602impl ConfirmPaymentIntentPaymentMethodOptionsTwint {
36603    pub fn new() -> Self {
36604        Self { setup_future_usage: None }
36605    }
36606}
36607impl Default for ConfirmPaymentIntentPaymentMethodOptionsTwint {
36608    fn default() -> Self {
36609        Self::new()
36610    }
36611}
36612/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36613///
36614/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36615/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36616///
36617/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36618///
36619/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36620///
36621/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36622#[derive(Clone, Eq, PartialEq)]
36623#[non_exhaustive]
36624pub enum ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
36625    None,
36626    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36627    Unknown(String),
36628}
36629impl ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
36630    pub fn as_str(&self) -> &str {
36631        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
36632        match self {
36633            None => "none",
36634            Unknown(v) => v,
36635        }
36636    }
36637}
36638
36639impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
36640    type Err = std::convert::Infallible;
36641    fn from_str(s: &str) -> Result<Self, Self::Err> {
36642        use ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage::*;
36643        match s {
36644            "none" => Ok(None),
36645            v => {
36646                tracing::warn!(
36647                    "Unknown value '{}' for enum '{}'",
36648                    v,
36649                    "ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage"
36650                );
36651                Ok(Unknown(v.to_owned()))
36652            }
36653        }
36654    }
36655}
36656impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
36657    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36658        f.write_str(self.as_str())
36659    }
36660}
36661
36662impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
36663    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36664        f.write_str(self.as_str())
36665    }
36666}
36667impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage {
36668    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36669    where
36670        S: serde::Serializer,
36671    {
36672        serializer.serialize_str(self.as_str())
36673    }
36674}
36675#[cfg(feature = "deserialize")]
36676impl<'de> serde::Deserialize<'de>
36677    for ConfirmPaymentIntentPaymentMethodOptionsTwintSetupFutureUsage
36678{
36679    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36680        use std::str::FromStr;
36681        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36682        Ok(Self::from_str(&s).expect("infallible"))
36683    }
36684}
36685/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options.
36686#[derive(Clone, Debug, serde::Serialize)]
36687pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
36688    /// Additional fields for Financial Connections Session creation
36689    #[serde(skip_serializing_if = "Option::is_none")]
36690    pub financial_connections:
36691        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
36692    /// Additional fields for Mandate creation
36693    #[serde(skip_serializing_if = "Option::is_none")]
36694    pub mandate_options:
36695        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
36696    /// Additional fields for network related functions
36697    #[serde(skip_serializing_if = "Option::is_none")]
36698    pub networks: Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks>,
36699    /// Preferred transaction settlement speed
36700    #[serde(skip_serializing_if = "Option::is_none")]
36701    pub preferred_settlement_speed:
36702        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed>,
36703    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
36704    ///
36705    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
36706    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
36707    ///
36708    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
36709    ///
36710    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
36711    ///
36712    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
36713    #[serde(skip_serializing_if = "Option::is_none")]
36714    pub setup_future_usage:
36715        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage>,
36716    /// Controls when Stripe will attempt to debit the funds from the customer's account.
36717    /// The date must be a string in YYYY-MM-DD format.
36718    /// The date must be in the future and between 3 and 15 calendar days from now.
36719    #[serde(skip_serializing_if = "Option::is_none")]
36720    pub target_date: Option<String>,
36721    /// Bank account verification method.
36722    #[serde(skip_serializing_if = "Option::is_none")]
36723    pub verification_method:
36724        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
36725}
36726impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
36727    pub fn new() -> Self {
36728        Self {
36729            financial_connections: None,
36730            mandate_options: None,
36731            networks: None,
36732            preferred_settlement_speed: None,
36733            setup_future_usage: None,
36734            target_date: None,
36735            verification_method: None,
36736        }
36737    }
36738}
36739impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount {
36740    fn default() -> Self {
36741        Self::new()
36742    }
36743}
36744/// Additional fields for Financial Connections Session creation
36745#[derive(Clone, Debug, serde::Serialize)]
36746pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
36747    /// Provide filters for the linked accounts that the customer can select for the payment method.
36748    #[serde(skip_serializing_if = "Option::is_none")]
36749    pub filters:
36750        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
36751    /// The list of permissions to request.
36752    /// If this parameter is passed, the `payment_method` permission must be included.
36753    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
36754    #[serde(skip_serializing_if = "Option::is_none")]
36755    pub permissions: Option<
36756        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
36757    >,
36758    /// List of data features that you would like to retrieve upon account creation.
36759    #[serde(skip_serializing_if = "Option::is_none")]
36760    pub prefetch: Option<
36761        Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
36762    >,
36763    /// For webview integrations only.
36764    /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
36765    #[serde(skip_serializing_if = "Option::is_none")]
36766    pub return_url: Option<String>,
36767}
36768impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
36769    pub fn new() -> Self {
36770        Self { filters: None, permissions: None, prefetch: None, return_url: None }
36771    }
36772}
36773impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
36774    fn default() -> Self {
36775        Self::new()
36776    }
36777}
36778/// Provide filters for the linked accounts that the customer can select for the payment method.
36779#[derive(Clone, Debug, serde::Serialize)]
36780pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
36781        /// The account subcategories to use to filter for selectable accounts.
36782    /// Valid subcategories are `checking` and `savings`.
36783#[serde(skip_serializing_if = "Option::is_none")]
36784pub account_subcategories: Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
36785
36786}
36787impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
36788    pub fn new() -> Self {
36789        Self { account_subcategories: None }
36790    }
36791}
36792impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
36793    fn default() -> Self {
36794        Self::new()
36795    }
36796}
36797/// The account subcategories to use to filter for selectable accounts.
36798/// Valid subcategories are `checking` and `savings`.
36799#[derive(Clone, Eq, PartialEq)]
36800#[non_exhaustive]
36801pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
36802{
36803    Checking,
36804    Savings,
36805    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36806    Unknown(String),
36807}
36808impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
36809    pub fn as_str(&self) -> &str {
36810        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
36811        match self {
36812Checking => "checking",
36813Savings => "savings",
36814Unknown(v) => v,
36815
36816        }
36817    }
36818}
36819
36820impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
36821    type Err = std::convert::Infallible;
36822    fn from_str(s: &str) -> Result<Self, Self::Err> {
36823        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
36824        match s {
36825    "checking" => Ok(Checking),
36826"savings" => Ok(Savings),
36827v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
36828
36829        }
36830    }
36831}
36832impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
36833    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36834        f.write_str(self.as_str())
36835    }
36836}
36837
36838impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
36839    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36840        f.write_str(self.as_str())
36841    }
36842}
36843impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
36844    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
36845        serializer.serialize_str(self.as_str())
36846    }
36847}
36848#[cfg(feature = "deserialize")]
36849impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
36850    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36851        use std::str::FromStr;
36852        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36853        Ok(Self::from_str(&s).expect("infallible"))
36854    }
36855}
36856/// The list of permissions to request.
36857/// If this parameter is passed, the `payment_method` permission must be included.
36858/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
36859#[derive(Clone, Eq, PartialEq)]
36860#[non_exhaustive]
36861pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
36862    Balances,
36863    Ownership,
36864    PaymentMethod,
36865    Transactions,
36866    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36867    Unknown(String),
36868}
36869impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
36870    pub fn as_str(&self) -> &str {
36871        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
36872        match self {
36873            Balances => "balances",
36874            Ownership => "ownership",
36875            PaymentMethod => "payment_method",
36876            Transactions => "transactions",
36877            Unknown(v) => v,
36878        }
36879    }
36880}
36881
36882impl std::str::FromStr
36883    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
36884{
36885    type Err = std::convert::Infallible;
36886    fn from_str(s: &str) -> Result<Self, Self::Err> {
36887        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
36888        match s {
36889            "balances" => Ok(Balances),
36890            "ownership" => Ok(Ownership),
36891            "payment_method" => Ok(PaymentMethod),
36892            "transactions" => Ok(Transactions),
36893            v => {
36894                tracing::warn!(
36895                    "Unknown value '{}' for enum '{}'",
36896                    v,
36897                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
36898                );
36899                Ok(Unknown(v.to_owned()))
36900            }
36901        }
36902    }
36903}
36904impl std::fmt::Display
36905    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
36906{
36907    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36908        f.write_str(self.as_str())
36909    }
36910}
36911
36912impl std::fmt::Debug
36913    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
36914{
36915    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36916        f.write_str(self.as_str())
36917    }
36918}
36919impl serde::Serialize
36920    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
36921{
36922    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
36923    where
36924        S: serde::Serializer,
36925    {
36926        serializer.serialize_str(self.as_str())
36927    }
36928}
36929#[cfg(feature = "deserialize")]
36930impl<'de> serde::Deserialize<'de>
36931    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
36932{
36933    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
36934        use std::str::FromStr;
36935        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
36936        Ok(Self::from_str(&s).expect("infallible"))
36937    }
36938}
36939/// List of data features that you would like to retrieve upon account creation.
36940#[derive(Clone, Eq, PartialEq)]
36941#[non_exhaustive]
36942pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
36943    Balances,
36944    Ownership,
36945    Transactions,
36946    /// An unrecognized value from Stripe. Should not be used as a request parameter.
36947    Unknown(String),
36948}
36949impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
36950    pub fn as_str(&self) -> &str {
36951        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
36952        match self {
36953            Balances => "balances",
36954            Ownership => "ownership",
36955            Transactions => "transactions",
36956            Unknown(v) => v,
36957        }
36958    }
36959}
36960
36961impl std::str::FromStr
36962    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
36963{
36964    type Err = std::convert::Infallible;
36965    fn from_str(s: &str) -> Result<Self, Self::Err> {
36966        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
36967        match s {
36968            "balances" => Ok(Balances),
36969            "ownership" => Ok(Ownership),
36970            "transactions" => Ok(Transactions),
36971            v => {
36972                tracing::warn!(
36973                    "Unknown value '{}' for enum '{}'",
36974                    v,
36975                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
36976                );
36977                Ok(Unknown(v.to_owned()))
36978            }
36979        }
36980    }
36981}
36982impl std::fmt::Display
36983    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
36984{
36985    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36986        f.write_str(self.as_str())
36987    }
36988}
36989
36990impl std::fmt::Debug
36991    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
36992{
36993    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36994        f.write_str(self.as_str())
36995    }
36996}
36997impl serde::Serialize
36998    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
36999{
37000    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37001    where
37002        S: serde::Serializer,
37003    {
37004        serializer.serialize_str(self.as_str())
37005    }
37006}
37007#[cfg(feature = "deserialize")]
37008impl<'de> serde::Deserialize<'de>
37009    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
37010{
37011    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37012        use std::str::FromStr;
37013        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37014        Ok(Self::from_str(&s).expect("infallible"))
37015    }
37016}
37017/// Additional fields for Mandate creation
37018#[derive(Clone, Debug, serde::Serialize)]
37019pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
37020    /// The method used to collect offline mandate customer acceptance.
37021    #[serde(skip_serializing_if = "Option::is_none")]
37022    pub collection_method:
37023        Option<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
37024}
37025impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
37026    pub fn new() -> Self {
37027        Self { collection_method: None }
37028    }
37029}
37030impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions {
37031    fn default() -> Self {
37032        Self::new()
37033    }
37034}
37035/// The method used to collect offline mandate customer acceptance.
37036#[derive(Clone, Eq, PartialEq)]
37037#[non_exhaustive]
37038pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
37039    Paper,
37040    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37041    Unknown(String),
37042}
37043impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
37044    pub fn as_str(&self) -> &str {
37045        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
37046        match self {
37047            Paper => "paper",
37048            Unknown(v) => v,
37049        }
37050    }
37051}
37052
37053impl std::str::FromStr
37054    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
37055{
37056    type Err = std::convert::Infallible;
37057    fn from_str(s: &str) -> Result<Self, Self::Err> {
37058        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
37059        match s {
37060            "paper" => Ok(Paper),
37061            v => {
37062                tracing::warn!(
37063                    "Unknown value '{}' for enum '{}'",
37064                    v,
37065                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
37066                );
37067                Ok(Unknown(v.to_owned()))
37068            }
37069        }
37070    }
37071}
37072impl std::fmt::Display
37073    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
37074{
37075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37076        f.write_str(self.as_str())
37077    }
37078}
37079
37080impl std::fmt::Debug
37081    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
37082{
37083    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37084        f.write_str(self.as_str())
37085    }
37086}
37087impl serde::Serialize
37088    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
37089{
37090    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37091    where
37092        S: serde::Serializer,
37093    {
37094        serializer.serialize_str(self.as_str())
37095    }
37096}
37097#[cfg(feature = "deserialize")]
37098impl<'de> serde::Deserialize<'de>
37099    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
37100{
37101    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37102        use std::str::FromStr;
37103        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37104        Ok(Self::from_str(&s).expect("infallible"))
37105    }
37106}
37107/// Additional fields for network related functions
37108#[derive(Clone, Debug, serde::Serialize)]
37109pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
37110    /// Triggers validations to run across the selected networks
37111    #[serde(skip_serializing_if = "Option::is_none")]
37112    pub requested:
37113        Option<Vec<ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
37114}
37115impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
37116    pub fn new() -> Self {
37117        Self { requested: None }
37118    }
37119}
37120impl Default for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks {
37121    fn default() -> Self {
37122        Self::new()
37123    }
37124}
37125/// Triggers validations to run across the selected networks
37126#[derive(Clone, Eq, PartialEq)]
37127#[non_exhaustive]
37128pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
37129    Ach,
37130    UsDomesticWire,
37131    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37132    Unknown(String),
37133}
37134impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
37135    pub fn as_str(&self) -> &str {
37136        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
37137        match self {
37138            Ach => "ach",
37139            UsDomesticWire => "us_domestic_wire",
37140            Unknown(v) => v,
37141        }
37142    }
37143}
37144
37145impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
37146    type Err = std::convert::Infallible;
37147    fn from_str(s: &str) -> Result<Self, Self::Err> {
37148        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
37149        match s {
37150            "ach" => Ok(Ach),
37151            "us_domestic_wire" => Ok(UsDomesticWire),
37152            v => {
37153                tracing::warn!(
37154                    "Unknown value '{}' for enum '{}'",
37155                    v,
37156                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
37157                );
37158                Ok(Unknown(v.to_owned()))
37159            }
37160        }
37161    }
37162}
37163impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
37164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37165        f.write_str(self.as_str())
37166    }
37167}
37168
37169impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
37170    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37171        f.write_str(self.as_str())
37172    }
37173}
37174impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
37175    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37176    where
37177        S: serde::Serializer,
37178    {
37179        serializer.serialize_str(self.as_str())
37180    }
37181}
37182#[cfg(feature = "deserialize")]
37183impl<'de> serde::Deserialize<'de>
37184    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested
37185{
37186    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37187        use std::str::FromStr;
37188        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37189        Ok(Self::from_str(&s).expect("infallible"))
37190    }
37191}
37192/// Preferred transaction settlement speed
37193#[derive(Clone, Eq, PartialEq)]
37194#[non_exhaustive]
37195pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
37196    Fastest,
37197    Standard,
37198    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37199    Unknown(String),
37200}
37201impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed {
37202    pub fn as_str(&self) -> &str {
37203        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
37204        match self {
37205            Fastest => "fastest",
37206            Standard => "standard",
37207            Unknown(v) => v,
37208        }
37209    }
37210}
37211
37212impl std::str::FromStr
37213    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
37214{
37215    type Err = std::convert::Infallible;
37216    fn from_str(s: &str) -> Result<Self, Self::Err> {
37217        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*;
37218        match s {
37219            "fastest" => Ok(Fastest),
37220            "standard" => Ok(Standard),
37221            v => {
37222                tracing::warn!(
37223                    "Unknown value '{}' for enum '{}'",
37224                    v,
37225                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed"
37226                );
37227                Ok(Unknown(v.to_owned()))
37228            }
37229        }
37230    }
37231}
37232impl std::fmt::Display
37233    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
37234{
37235    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37236        f.write_str(self.as_str())
37237    }
37238}
37239
37240impl std::fmt::Debug
37241    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
37242{
37243    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37244        f.write_str(self.as_str())
37245    }
37246}
37247impl serde::Serialize
37248    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
37249{
37250    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37251    where
37252        S: serde::Serializer,
37253    {
37254        serializer.serialize_str(self.as_str())
37255    }
37256}
37257#[cfg(feature = "deserialize")]
37258impl<'de> serde::Deserialize<'de>
37259    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed
37260{
37261    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37262        use std::str::FromStr;
37263        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37264        Ok(Self::from_str(&s).expect("infallible"))
37265    }
37266}
37267/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
37268///
37269/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
37270/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
37271///
37272/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
37273///
37274/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
37275///
37276/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
37277#[derive(Clone, Eq, PartialEq)]
37278#[non_exhaustive]
37279pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
37280    None,
37281    OffSession,
37282    OnSession,
37283    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37284    Unknown(String),
37285}
37286impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
37287    pub fn as_str(&self) -> &str {
37288        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
37289        match self {
37290            None => "none",
37291            OffSession => "off_session",
37292            OnSession => "on_session",
37293            Unknown(v) => v,
37294        }
37295    }
37296}
37297
37298impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
37299    type Err = std::convert::Infallible;
37300    fn from_str(s: &str) -> Result<Self, Self::Err> {
37301        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*;
37302        match s {
37303            "none" => Ok(None),
37304            "off_session" => Ok(OffSession),
37305            "on_session" => Ok(OnSession),
37306            v => {
37307                tracing::warn!(
37308                    "Unknown value '{}' for enum '{}'",
37309                    v,
37310                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage"
37311                );
37312                Ok(Unknown(v.to_owned()))
37313            }
37314        }
37315    }
37316}
37317impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
37318    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37319        f.write_str(self.as_str())
37320    }
37321}
37322
37323impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
37324    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37325        f.write_str(self.as_str())
37326    }
37327}
37328impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage {
37329    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37330    where
37331        S: serde::Serializer,
37332    {
37333        serializer.serialize_str(self.as_str())
37334    }
37335}
37336#[cfg(feature = "deserialize")]
37337impl<'de> serde::Deserialize<'de>
37338    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage
37339{
37340    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37341        use std::str::FromStr;
37342        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37343        Ok(Self::from_str(&s).expect("infallible"))
37344    }
37345}
37346/// Bank account verification method.
37347#[derive(Clone, Eq, PartialEq)]
37348#[non_exhaustive]
37349pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
37350    Automatic,
37351    Instant,
37352    Microdeposits,
37353    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37354    Unknown(String),
37355}
37356impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
37357    pub fn as_str(&self) -> &str {
37358        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
37359        match self {
37360            Automatic => "automatic",
37361            Instant => "instant",
37362            Microdeposits => "microdeposits",
37363            Unknown(v) => v,
37364        }
37365    }
37366}
37367
37368impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
37369    type Err = std::convert::Infallible;
37370    fn from_str(s: &str) -> Result<Self, Self::Err> {
37371        use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
37372        match s {
37373            "automatic" => Ok(Automatic),
37374            "instant" => Ok(Instant),
37375            "microdeposits" => Ok(Microdeposits),
37376            v => {
37377                tracing::warn!(
37378                    "Unknown value '{}' for enum '{}'",
37379                    v,
37380                    "ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
37381                );
37382                Ok(Unknown(v.to_owned()))
37383            }
37384        }
37385    }
37386}
37387impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
37388    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37389        f.write_str(self.as_str())
37390    }
37391}
37392
37393impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
37394    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37395        f.write_str(self.as_str())
37396    }
37397}
37398impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
37399    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37400    where
37401        S: serde::Serializer,
37402    {
37403        serializer.serialize_str(self.as_str())
37404    }
37405}
37406#[cfg(feature = "deserialize")]
37407impl<'de> serde::Deserialize<'de>
37408    for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod
37409{
37410    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37411        use std::str::FromStr;
37412        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37413        Ok(Self::from_str(&s).expect("infallible"))
37414    }
37415}
37416/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options.
37417#[derive(Clone, Debug, serde::Serialize)]
37418pub struct ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
37419    /// The app ID registered with WeChat Pay. Only required when client is ios or android.
37420    #[serde(skip_serializing_if = "Option::is_none")]
37421    pub app_id: Option<String>,
37422    /// The client type that the end customer will pay from
37423    #[serde(skip_serializing_if = "Option::is_none")]
37424    pub client: Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient>,
37425    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
37426    ///
37427    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
37428    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
37429    ///
37430    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
37431    ///
37432    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
37433    ///
37434    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
37435    #[serde(skip_serializing_if = "Option::is_none")]
37436    pub setup_future_usage:
37437        Option<ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage>,
37438}
37439impl ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
37440    pub fn new() -> Self {
37441        Self { app_id: None, client: None, setup_future_usage: None }
37442    }
37443}
37444impl Default for ConfirmPaymentIntentPaymentMethodOptionsWechatPay {
37445    fn default() -> Self {
37446        Self::new()
37447    }
37448}
37449/// The client type that the end customer will pay from
37450#[derive(Clone, Eq, PartialEq)]
37451#[non_exhaustive]
37452pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37453    Android,
37454    Ios,
37455    Web,
37456    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37457    Unknown(String),
37458}
37459impl ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37460    pub fn as_str(&self) -> &str {
37461        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
37462        match self {
37463            Android => "android",
37464            Ios => "ios",
37465            Web => "web",
37466            Unknown(v) => v,
37467        }
37468    }
37469}
37470
37471impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37472    type Err = std::convert::Infallible;
37473    fn from_str(s: &str) -> Result<Self, Self::Err> {
37474        use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*;
37475        match s {
37476            "android" => Ok(Android),
37477            "ios" => Ok(Ios),
37478            "web" => Ok(Web),
37479            v => {
37480                tracing::warn!(
37481                    "Unknown value '{}' for enum '{}'",
37482                    v,
37483                    "ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient"
37484                );
37485                Ok(Unknown(v.to_owned()))
37486            }
37487        }
37488    }
37489}
37490impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37491    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37492        f.write_str(self.as_str())
37493    }
37494}
37495
37496impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37497    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37498        f.write_str(self.as_str())
37499    }
37500}
37501impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37502    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37503    where
37504        S: serde::Serializer,
37505    {
37506        serializer.serialize_str(self.as_str())
37507    }
37508}
37509#[cfg(feature = "deserialize")]
37510impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient {
37511    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37512        use std::str::FromStr;
37513        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37514        Ok(Self::from_str(&s).expect("infallible"))
37515    }
37516}
37517/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
37518///
37519/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
37520/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
37521///
37522/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
37523///
37524/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
37525///
37526/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
37527#[derive(Clone, Eq, PartialEq)]
37528#[non_exhaustive]
37529pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
37530    None,
37531    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37532    Unknown(String),
37533}
37534impl ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
37535    pub fn as_str(&self) -> &str {
37536        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
37537        match self {
37538            None => "none",
37539            Unknown(v) => v,
37540        }
37541    }
37542}
37543
37544impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
37545    type Err = std::convert::Infallible;
37546    fn from_str(s: &str) -> Result<Self, Self::Err> {
37547        use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*;
37548        match s {
37549            "none" => Ok(None),
37550            v => {
37551                tracing::warn!(
37552                    "Unknown value '{}' for enum '{}'",
37553                    v,
37554                    "ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage"
37555                );
37556                Ok(Unknown(v.to_owned()))
37557            }
37558        }
37559    }
37560}
37561impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
37562    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37563        f.write_str(self.as_str())
37564    }
37565}
37566
37567impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
37568    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37569        f.write_str(self.as_str())
37570    }
37571}
37572impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage {
37573    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37574    where
37575        S: serde::Serializer,
37576    {
37577        serializer.serialize_str(self.as_str())
37578    }
37579}
37580#[cfg(feature = "deserialize")]
37581impl<'de> serde::Deserialize<'de>
37582    for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage
37583{
37584    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37585        use std::str::FromStr;
37586        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37587        Ok(Self::from_str(&s).expect("infallible"))
37588    }
37589}
37590/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options.
37591#[derive(Clone, Debug, serde::Serialize)]
37592pub struct ConfirmPaymentIntentPaymentMethodOptionsZip {
37593    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
37594    ///
37595    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
37596    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
37597    ///
37598    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
37599    ///
37600    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
37601    ///
37602    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
37603    #[serde(skip_serializing_if = "Option::is_none")]
37604    pub setup_future_usage: Option<ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage>,
37605}
37606impl ConfirmPaymentIntentPaymentMethodOptionsZip {
37607    pub fn new() -> Self {
37608        Self { setup_future_usage: None }
37609    }
37610}
37611impl Default for ConfirmPaymentIntentPaymentMethodOptionsZip {
37612    fn default() -> Self {
37613        Self::new()
37614    }
37615}
37616/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
37617///
37618/// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
37619/// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
37620///
37621/// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
37622///
37623/// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
37624///
37625/// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
37626#[derive(Clone, Eq, PartialEq)]
37627#[non_exhaustive]
37628pub enum ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37629    None,
37630    /// An unrecognized value from Stripe. Should not be used as a request parameter.
37631    Unknown(String),
37632}
37633impl ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37634    pub fn as_str(&self) -> &str {
37635        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
37636        match self {
37637            None => "none",
37638            Unknown(v) => v,
37639        }
37640    }
37641}
37642
37643impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37644    type Err = std::convert::Infallible;
37645    fn from_str(s: &str) -> Result<Self, Self::Err> {
37646        use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*;
37647        match s {
37648            "none" => Ok(None),
37649            v => {
37650                tracing::warn!(
37651                    "Unknown value '{}' for enum '{}'",
37652                    v,
37653                    "ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage"
37654                );
37655                Ok(Unknown(v.to_owned()))
37656            }
37657        }
37658    }
37659}
37660impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37662        f.write_str(self.as_str())
37663    }
37664}
37665
37666impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37667    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37668        f.write_str(self.as_str())
37669    }
37670}
37671impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37672    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
37673    where
37674        S: serde::Serializer,
37675    {
37676        serializer.serialize_str(self.as_str())
37677    }
37678}
37679#[cfg(feature = "deserialize")]
37680impl<'de> serde::Deserialize<'de> for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage {
37681    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
37682        use std::str::FromStr;
37683        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
37684        Ok(Self::from_str(&s).expect("infallible"))
37685    }
37686}
37687/// Options to configure Radar.
37688/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
37689#[derive(Clone, Debug, serde::Serialize)]
37690pub struct ConfirmPaymentIntentRadarOptions {
37691    /// 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.
37692    #[serde(skip_serializing_if = "Option::is_none")]
37693    pub session: Option<String>,
37694}
37695impl ConfirmPaymentIntentRadarOptions {
37696    pub fn new() -> Self {
37697        Self { session: None }
37698    }
37699}
37700impl Default for ConfirmPaymentIntentRadarOptions {
37701    fn default() -> Self {
37702        Self::new()
37703    }
37704}
37705/// Shipping information for this PaymentIntent.
37706#[derive(Clone, Debug, serde::Serialize)]
37707pub struct ConfirmPaymentIntentShipping {
37708    /// Shipping address.
37709    pub address: ConfirmPaymentIntentShippingAddress,
37710    /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
37711    #[serde(skip_serializing_if = "Option::is_none")]
37712    pub carrier: Option<String>,
37713    /// Recipient name.
37714    pub name: String,
37715    /// Recipient phone (including extension).
37716    #[serde(skip_serializing_if = "Option::is_none")]
37717    pub phone: Option<String>,
37718    /// The tracking number for a physical product, obtained from the delivery service.
37719    /// If multiple tracking numbers were generated for this purchase, please separate them with commas.
37720    #[serde(skip_serializing_if = "Option::is_none")]
37721    pub tracking_number: Option<String>,
37722}
37723impl ConfirmPaymentIntentShipping {
37724    pub fn new(
37725        address: impl Into<ConfirmPaymentIntentShippingAddress>,
37726        name: impl Into<String>,
37727    ) -> Self {
37728        Self {
37729            address: address.into(),
37730            carrier: None,
37731            name: name.into(),
37732            phone: None,
37733            tracking_number: None,
37734        }
37735    }
37736}
37737/// Shipping address.
37738#[derive(Clone, Debug, serde::Serialize)]
37739pub struct ConfirmPaymentIntentShippingAddress {
37740    /// City, district, suburb, town, or village.
37741    #[serde(skip_serializing_if = "Option::is_none")]
37742    pub city: Option<String>,
37743    /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
37744    #[serde(skip_serializing_if = "Option::is_none")]
37745    pub country: Option<String>,
37746    /// Address line 1, such as the street, PO Box, or company name.
37747    #[serde(skip_serializing_if = "Option::is_none")]
37748    pub line1: Option<String>,
37749    /// Address line 2, such as the apartment, suite, unit, or building.
37750    #[serde(skip_serializing_if = "Option::is_none")]
37751    pub line2: Option<String>,
37752    /// ZIP or postal code.
37753    #[serde(skip_serializing_if = "Option::is_none")]
37754    pub postal_code: Option<String>,
37755    /// State, county, province, or region.
37756    #[serde(skip_serializing_if = "Option::is_none")]
37757    pub state: Option<String>,
37758}
37759impl ConfirmPaymentIntentShippingAddress {
37760    pub fn new() -> Self {
37761        Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
37762    }
37763}
37764impl Default for ConfirmPaymentIntentShippingAddress {
37765    fn default() -> Self {
37766        Self::new()
37767    }
37768}
37769/// Confirm that your customer intends to pay with current or provided
37770/// payment method. Upon confirmation, the PaymentIntent will attempt to initiate
37771/// a payment.
37772///
37773/// If the selected payment method requires additional authentication steps, the
37774/// PaymentIntent will transition to the `requires_action` status and
37775/// suggest additional actions via `next_action`. If payment fails,
37776/// the PaymentIntent transitions to the `requires_payment_method` status or the
37777/// `canceled` status if the confirmation limit is reached. If
37778/// payment succeeds, the PaymentIntent will transition to the `succeeded`
37779/// status (or `requires_capture`, if `capture_method` is set to `manual`).
37780///
37781/// If the `confirmation_method` is `automatic`, payment may be attempted
37782/// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
37783/// and the PaymentIntent’s [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
37784/// After `next_action`s are handled by the client, no additional
37785/// confirmation is required to complete the payment.
37786///
37787/// If the `confirmation_method` is `manual`, all payment attempts must be
37788/// initiated using a secret key.
37789///
37790/// If any actions are required for the payment, the PaymentIntent will
37791/// return to the `requires_confirmation` state
37792/// after those actions are completed. Your server needs to then
37793/// explicitly re-confirm the PaymentIntent to initiate the next payment
37794/// attempt.
37795///
37796/// There is a variable upper limit on how many times a PaymentIntent can be confirmed.
37797/// After this limit is reached, any further calls to this endpoint will
37798/// transition the PaymentIntent to the `canceled` state.
37799#[derive(Clone, Debug, serde::Serialize)]
37800pub struct ConfirmPaymentIntent {
37801    inner: ConfirmPaymentIntentBuilder,
37802    intent: stripe_shared::PaymentIntentId,
37803}
37804impl ConfirmPaymentIntent {
37805    /// Construct a new `ConfirmPaymentIntent`.
37806    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
37807        Self { intent: intent.into(), inner: ConfirmPaymentIntentBuilder::new() }
37808    }
37809    /// Provides industry-specific information about the amount.
37810    pub fn amount_details(
37811        mut self,
37812        amount_details: impl Into<ConfirmPaymentIntentAmountDetails>,
37813    ) -> Self {
37814        self.inner.amount_details = Some(amount_details.into());
37815        self
37816    }
37817    /// Controls when the funds will be captured from the customer's account.
37818    pub fn capture_method(
37819        mut self,
37820        capture_method: impl Into<stripe_shared::PaymentIntentCaptureMethod>,
37821    ) -> Self {
37822        self.inner.capture_method = Some(capture_method.into());
37823        self
37824    }
37825    /// ID of the ConfirmationToken used to confirm this PaymentIntent.
37826    ///
37827    /// 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.
37828    pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
37829        self.inner.confirmation_token = Some(confirmation_token.into());
37830        self
37831    }
37832    /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`.
37833    /// 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).
37834    pub fn error_on_requires_action(mut self, error_on_requires_action: impl Into<bool>) -> Self {
37835        self.inner.error_on_requires_action = Some(error_on_requires_action.into());
37836        self
37837    }
37838    /// The list of payment method types to exclude from use with this payment.
37839    pub fn excluded_payment_method_types(
37840        mut self,
37841        excluded_payment_method_types: impl Into<
37842            Vec<stripe_shared::PaymentIntentExcludedPaymentMethodTypes>,
37843        >,
37844    ) -> Self {
37845        self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
37846        self
37847    }
37848    /// Specifies which fields in the response should be expanded.
37849    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
37850        self.inner.expand = Some(expand.into());
37851        self
37852    }
37853    /// Automations to be run during the PaymentIntent lifecycle
37854    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
37855        self.inner.hooks = Some(hooks.into());
37856        self
37857    }
37858    /// ID of the mandate that's used for this payment.
37859    pub fn mandate(mut self, mandate: impl Into<String>) -> Self {
37860        self.inner.mandate = Some(mandate.into());
37861        self
37862    }
37863    pub fn mandate_data(
37864        mut self,
37865        mandate_data: impl Into<ConfirmPaymentIntentMandateData>,
37866    ) -> Self {
37867        self.inner.mandate_data = Some(mandate_data.into());
37868        self
37869    }
37870    /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate.
37871    /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards).
37872    pub fn off_session(mut self, off_session: impl Into<ConfirmPaymentIntentOffSession>) -> Self {
37873        self.inner.off_session = Some(off_session.into());
37874        self
37875    }
37876    /// Provides industry-specific information about the charge.
37877    pub fn payment_details(
37878        mut self,
37879        payment_details: impl Into<ConfirmPaymentIntentPaymentDetails>,
37880    ) -> Self {
37881        self.inner.payment_details = Some(payment_details.into());
37882        self
37883    }
37884    /// 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.
37885    /// 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.
37886    pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
37887        self.inner.payment_method = Some(payment_method.into());
37888        self
37889    }
37890    /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
37891    /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method).
37892    /// property on the PaymentIntent.
37893    pub fn payment_method_data(
37894        mut self,
37895        payment_method_data: impl Into<ConfirmPaymentIntentPaymentMethodData>,
37896    ) -> Self {
37897        self.inner.payment_method_data = Some(payment_method_data.into());
37898        self
37899    }
37900    /// Payment method-specific configuration for this PaymentIntent.
37901    pub fn payment_method_options(
37902        mut self,
37903        payment_method_options: impl Into<ConfirmPaymentIntentPaymentMethodOptions>,
37904    ) -> Self {
37905        self.inner.payment_method_options = Some(payment_method_options.into());
37906        self
37907    }
37908    /// The list of payment method types (for example, a card) that this PaymentIntent can use.
37909    /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
37910    /// A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
37911    pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
37912        self.inner.payment_method_types = Some(payment_method_types.into());
37913        self
37914    }
37915    /// Options to configure Radar.
37916    /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
37917    pub fn radar_options(
37918        mut self,
37919        radar_options: impl Into<ConfirmPaymentIntentRadarOptions>,
37920    ) -> Self {
37921        self.inner.radar_options = Some(radar_options.into());
37922        self
37923    }
37924    /// Email address that the receipt for the resulting payment will be sent to.
37925    /// 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).
37926    pub fn receipt_email(mut self, receipt_email: impl Into<String>) -> Self {
37927        self.inner.receipt_email = Some(receipt_email.into());
37928        self
37929    }
37930    /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
37931    /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
37932    /// This parameter is only used for cards and other redirect-based payment methods.
37933    pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
37934        self.inner.return_url = Some(return_url.into());
37935        self
37936    }
37937    /// Indicates that you intend to make future payments with this PaymentIntent's payment method.
37938    ///
37939    /// If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions.
37940    /// If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
37941    ///
37942    /// If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
37943    ///
37944    /// When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
37945    ///
37946    /// If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
37947    pub fn setup_future_usage(
37948        mut self,
37949        setup_future_usage: impl Into<stripe_shared::PaymentIntentSetupFutureUsage>,
37950    ) -> Self {
37951        self.inner.setup_future_usage = Some(setup_future_usage.into());
37952        self
37953    }
37954    /// Shipping information for this PaymentIntent.
37955    pub fn shipping(mut self, shipping: impl Into<ConfirmPaymentIntentShipping>) -> Self {
37956        self.inner.shipping = Some(shipping.into());
37957        self
37958    }
37959    /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
37960    pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
37961        self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
37962        self
37963    }
37964}
37965impl ConfirmPaymentIntent {
37966    /// Send the request and return the deserialized response.
37967    pub async fn send<C: StripeClient>(
37968        &self,
37969        client: &C,
37970    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
37971        self.customize().send(client).await
37972    }
37973
37974    /// Send the request and return the deserialized response, blocking until completion.
37975    pub fn send_blocking<C: StripeBlockingClient>(
37976        &self,
37977        client: &C,
37978    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
37979        self.customize().send_blocking(client)
37980    }
37981}
37982
37983impl StripeRequest for ConfirmPaymentIntent {
37984    type Output = stripe_shared::PaymentIntent;
37985
37986    fn build(&self) -> RequestBuilder {
37987        let intent = &self.intent;
37988        RequestBuilder::new(StripeMethod::Post, format!("/payment_intents/{intent}/confirm"))
37989            .form(&self.inner)
37990    }
37991}
37992#[derive(Clone, Debug, serde::Serialize)]
37993struct IncrementAuthorizationPaymentIntentBuilder {
37994    amount: i64,
37995    #[serde(skip_serializing_if = "Option::is_none")]
37996    amount_details: Option<IncrementAuthorizationPaymentIntentAmountDetails>,
37997    #[serde(skip_serializing_if = "Option::is_none")]
37998    application_fee_amount: Option<i64>,
37999    #[serde(skip_serializing_if = "Option::is_none")]
38000    description: Option<String>,
38001    #[serde(skip_serializing_if = "Option::is_none")]
38002    expand: Option<Vec<String>>,
38003    #[serde(skip_serializing_if = "Option::is_none")]
38004    hooks: Option<AsyncWorkflowsParam>,
38005    #[serde(skip_serializing_if = "Option::is_none")]
38006    metadata: Option<std::collections::HashMap<String, String>>,
38007    #[serde(skip_serializing_if = "Option::is_none")]
38008    payment_details: Option<IncrementAuthorizationPaymentIntentPaymentDetails>,
38009    #[serde(skip_serializing_if = "Option::is_none")]
38010    statement_descriptor: Option<String>,
38011    #[serde(skip_serializing_if = "Option::is_none")]
38012    transfer_data: Option<IncrementAuthorizationPaymentIntentTransferData>,
38013}
38014impl IncrementAuthorizationPaymentIntentBuilder {
38015    fn new(amount: impl Into<i64>) -> Self {
38016        Self {
38017            amount: amount.into(),
38018            amount_details: None,
38019            application_fee_amount: None,
38020            description: None,
38021            expand: None,
38022            hooks: None,
38023            metadata: None,
38024            payment_details: None,
38025            statement_descriptor: None,
38026            transfer_data: None,
38027        }
38028    }
38029}
38030/// Provides industry-specific information about the amount.
38031#[derive(Clone, Debug, serde::Serialize)]
38032pub struct IncrementAuthorizationPaymentIntentAmountDetails {
38033    /// The total discount applied on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
38034    /// An integer greater than 0.
38035    ///
38036    /// This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field.
38037    #[serde(skip_serializing_if = "Option::is_none")]
38038    pub discount_amount: Option<i64>,
38039    /// A list of line items, each containing information about a product in the PaymentIntent.
38040    /// There is a maximum of 100 line items.
38041    #[serde(skip_serializing_if = "Option::is_none")]
38042    pub line_items: Option<Vec<IncrementAuthorizationPaymentIntentAmountDetailsLineItems>>,
38043    /// Contains information about the shipping portion of the amount.
38044    #[serde(skip_serializing_if = "Option::is_none")]
38045    pub shipping: Option<AmountDetailsShippingParam>,
38046    /// Contains information about the tax portion of the amount.
38047    #[serde(skip_serializing_if = "Option::is_none")]
38048    pub tax: Option<AmountDetailsTaxParam>,
38049}
38050impl IncrementAuthorizationPaymentIntentAmountDetails {
38051    pub fn new() -> Self {
38052        Self { discount_amount: None, line_items: None, shipping: None, tax: None }
38053    }
38054}
38055impl Default for IncrementAuthorizationPaymentIntentAmountDetails {
38056    fn default() -> Self {
38057        Self::new()
38058    }
38059}
38060/// A list of line items, each containing information about a product in the PaymentIntent.
38061/// There is a maximum of 100 line items.
38062#[derive(Clone, Debug, serde::Serialize)]
38063pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItems {
38064    /// The discount applied on this line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
38065    /// An integer greater than 0.
38066    ///
38067    /// This field is mutually exclusive with the `amount_details[discount_amount]` field.
38068    #[serde(skip_serializing_if = "Option::is_none")]
38069    pub discount_amount: Option<i64>,
38070    /// Payment method-specific information for line items.
38071    #[serde(skip_serializing_if = "Option::is_none")]
38072    pub payment_method_options:
38073        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions>,
38074    /// The product code of the line item, such as an SKU.
38075    /// Required for L3 rates.
38076    /// At most 12 characters long.
38077    #[serde(skip_serializing_if = "Option::is_none")]
38078    pub product_code: Option<String>,
38079    /// The product name of the line item. Required for L3 rates. At most 1024 characters long.
38080    ///
38081    /// For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks.
38082    /// For Paypal, this field is truncated to 127 characters.
38083    pub product_name: String,
38084    /// The quantity of items. Required for L3 rates. An integer greater than 0.
38085    pub quantity: u64,
38086    /// Contains information about the tax on the item.
38087    #[serde(skip_serializing_if = "Option::is_none")]
38088    pub tax: Option<AmountDetailsLineItemTaxParam>,
38089    /// The unit cost of the line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
38090    /// Required for L3 rates.
38091    /// An integer greater than or equal to 0.
38092    pub unit_cost: i64,
38093    /// A unit of measure for the line item, such as gallons, feet, meters, etc.
38094    #[serde(skip_serializing_if = "Option::is_none")]
38095    pub unit_of_measure: Option<String>,
38096}
38097impl IncrementAuthorizationPaymentIntentAmountDetailsLineItems {
38098    pub fn new(
38099        product_name: impl Into<String>,
38100        quantity: impl Into<u64>,
38101        unit_cost: impl Into<i64>,
38102    ) -> Self {
38103        Self {
38104            discount_amount: None,
38105            payment_method_options: None,
38106            product_code: None,
38107            product_name: product_name.into(),
38108            quantity: quantity.into(),
38109            tax: None,
38110            unit_cost: unit_cost.into(),
38111            unit_of_measure: None,
38112        }
38113    }
38114}
38115/// Payment method-specific information for line items.
38116#[derive(Clone, Debug, serde::Serialize)]
38117pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
38118    /// This sub-hash contains line item details that are specific to `card` payment method."
38119    #[serde(skip_serializing_if = "Option::is_none")]
38120    pub card:
38121        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard>,
38122    /// This sub-hash contains line item details that are specific to `card_present` payment method."
38123    #[serde(skip_serializing_if = "Option::is_none")]
38124    pub card_present: Option<
38125        IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent,
38126    >,
38127    /// This sub-hash contains line item details that are specific to `klarna` payment method."
38128    #[serde(skip_serializing_if = "Option::is_none")]
38129    pub klarna: Option<PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam>,
38130    /// This sub-hash contains line item details that are specific to `paypal` payment method."
38131    #[serde(skip_serializing_if = "Option::is_none")]
38132    pub paypal:
38133        Option<IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal>,
38134}
38135impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
38136    pub fn new() -> Self {
38137        Self { card: None, card_present: None, klarna: None, paypal: None }
38138    }
38139}
38140impl Default for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptions {
38141    fn default() -> Self {
38142        Self::new()
38143    }
38144}
38145/// This sub-hash contains line item details that are specific to `card` payment method."
38146#[derive(Clone, Debug, serde::Serialize)]
38147pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
38148    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
38149    #[serde(skip_serializing_if = "Option::is_none")]
38150    pub commodity_code: Option<String>,
38151}
38152impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
38153    pub fn new() -> Self {
38154        Self { commodity_code: None }
38155    }
38156}
38157impl Default for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCard {
38158    fn default() -> Self {
38159        Self::new()
38160    }
38161}
38162/// This sub-hash contains line item details that are specific to `card_present` payment method."
38163#[derive(Clone, Debug, serde::Serialize)]
38164pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent
38165{
38166    /// Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc.
38167    #[serde(skip_serializing_if = "Option::is_none")]
38168    pub commodity_code: Option<String>,
38169}
38170impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent {
38171    pub fn new() -> Self {
38172        Self { commodity_code: None }
38173    }
38174}
38175impl Default
38176    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsCardPresent
38177{
38178    fn default() -> Self {
38179        Self::new()
38180    }
38181}
38182/// This sub-hash contains line item details that are specific to `paypal` payment method."
38183#[derive(Clone, Debug, serde::Serialize)]
38184pub struct IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
38185    /// Type of the line item.
38186    #[serde(skip_serializing_if = "Option::is_none")]
38187    pub category: Option<
38188        IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory,
38189    >,
38190    /// Description of the line item.
38191    #[serde(skip_serializing_if = "Option::is_none")]
38192    pub description: Option<String>,
38193    /// The Stripe account ID of the connected account that sells the item.
38194    #[serde(skip_serializing_if = "Option::is_none")]
38195    pub sold_by: Option<String>,
38196}
38197impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal {
38198    pub fn new() -> Self {
38199        Self { category: None, description: None, sold_by: None }
38200    }
38201}
38202impl Default
38203    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypal
38204{
38205    fn default() -> Self {
38206        Self::new()
38207    }
38208}
38209/// Type of the line item.
38210#[derive(Clone, Eq, PartialEq)]
38211#[non_exhaustive]
38212pub enum IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
38213{
38214    DigitalGoods,
38215    Donation,
38216    PhysicalGoods,
38217    /// An unrecognized value from Stripe. Should not be used as a request parameter.
38218    Unknown(String),
38219}
38220impl IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory {
38221    pub fn as_str(&self) -> &str {
38222        use IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
38223        match self {
38224            DigitalGoods => "digital_goods",
38225            Donation => "donation",
38226            PhysicalGoods => "physical_goods",
38227            Unknown(v) => v,
38228        }
38229    }
38230}
38231
38232impl std::str::FromStr
38233    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
38234{
38235    type Err = std::convert::Infallible;
38236    fn from_str(s: &str) -> Result<Self, Self::Err> {
38237        use IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory::*;
38238        match s {
38239            "digital_goods" => Ok(DigitalGoods),
38240            "donation" => Ok(Donation),
38241            "physical_goods" => Ok(PhysicalGoods),
38242            v => {
38243                tracing::warn!(
38244                    "Unknown value '{}' for enum '{}'",
38245                    v,
38246                    "IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory"
38247                );
38248                Ok(Unknown(v.to_owned()))
38249            }
38250        }
38251    }
38252}
38253impl std::fmt::Display
38254    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
38255{
38256    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
38257        f.write_str(self.as_str())
38258    }
38259}
38260
38261impl std::fmt::Debug
38262    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
38263{
38264    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
38265        f.write_str(self.as_str())
38266    }
38267}
38268impl serde::Serialize
38269    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
38270{
38271    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
38272    where
38273        S: serde::Serializer,
38274    {
38275        serializer.serialize_str(self.as_str())
38276    }
38277}
38278#[cfg(feature = "deserialize")]
38279impl<'de> serde::Deserialize<'de>
38280    for IncrementAuthorizationPaymentIntentAmountDetailsLineItemsPaymentMethodOptionsPaypalCategory
38281{
38282    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
38283        use std::str::FromStr;
38284        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
38285        Ok(Self::from_str(&s).expect("infallible"))
38286    }
38287}
38288/// Provides industry-specific information about the charge.
38289#[derive(Clone, Debug, serde::Serialize)]
38290pub struct IncrementAuthorizationPaymentIntentPaymentDetails {
38291    /// A unique value to identify the customer. This field is available only for card payments.
38292    ///
38293    /// This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
38294    #[serde(skip_serializing_if = "Option::is_none")]
38295    pub customer_reference: Option<String>,
38296    /// A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates.
38297    ///
38298    /// 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`.
38299    ///
38300    /// For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks.
38301    /// For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app.
38302    #[serde(skip_serializing_if = "Option::is_none")]
38303    pub order_reference: Option<String>,
38304}
38305impl IncrementAuthorizationPaymentIntentPaymentDetails {
38306    pub fn new() -> Self {
38307        Self { customer_reference: None, order_reference: None }
38308    }
38309}
38310impl Default for IncrementAuthorizationPaymentIntentPaymentDetails {
38311    fn default() -> Self {
38312        Self::new()
38313    }
38314}
38315/// The parameters used to automatically create a transfer after the payment is captured.
38316/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
38317#[derive(Copy, Clone, Debug, serde::Serialize)]
38318pub struct IncrementAuthorizationPaymentIntentTransferData {
38319    /// The amount that will be transferred automatically when a charge succeeds.
38320    #[serde(skip_serializing_if = "Option::is_none")]
38321    pub amount: Option<i64>,
38322}
38323impl IncrementAuthorizationPaymentIntentTransferData {
38324    pub fn new() -> Self {
38325        Self { amount: None }
38326    }
38327}
38328impl Default for IncrementAuthorizationPaymentIntentTransferData {
38329    fn default() -> Self {
38330        Self::new()
38331    }
38332}
38333/// Perform an incremental authorization on an eligible
38334/// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
38335/// PaymentIntent’s status must be `requires_capture` and
38336/// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported).
38337/// must be `true`.
38338///
38339/// Incremental authorizations attempt to increase the authorized amount on
38340/// your customer’s card to the new, higher `amount` provided. Similar to the
38341/// initial authorization, incremental authorizations can be declined. A
38342/// single PaymentIntent can call this endpoint multiple times to further
38343/// increase the authorized amount.
38344///
38345/// If the incremental authorization succeeds, the PaymentIntent object
38346/// returns with the updated
38347/// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
38348/// If the incremental authorization fails, a
38349/// [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
38350/// fields on the PaymentIntent or Charge update. The PaymentIntent
38351/// object remains capturable for the previously authorized amount.
38352///
38353/// Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
38354/// After it’s captured, a PaymentIntent can no longer be incremented.
38355///
38356/// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
38357#[derive(Clone, Debug, serde::Serialize)]
38358pub struct IncrementAuthorizationPaymentIntent {
38359    inner: IncrementAuthorizationPaymentIntentBuilder,
38360    intent: stripe_shared::PaymentIntentId,
38361}
38362impl IncrementAuthorizationPaymentIntent {
38363    /// Construct a new `IncrementAuthorizationPaymentIntent`.
38364    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>, amount: impl Into<i64>) -> Self {
38365        Self {
38366            intent: intent.into(),
38367            inner: IncrementAuthorizationPaymentIntentBuilder::new(amount.into()),
38368        }
38369    }
38370    /// Provides industry-specific information about the amount.
38371    pub fn amount_details(
38372        mut self,
38373        amount_details: impl Into<IncrementAuthorizationPaymentIntentAmountDetails>,
38374    ) -> Self {
38375        self.inner.amount_details = Some(amount_details.into());
38376        self
38377    }
38378    /// 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.
38379    /// The amount of the application fee collected will be capped at the total amount captured.
38380    /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
38381    pub fn application_fee_amount(mut self, application_fee_amount: impl Into<i64>) -> Self {
38382        self.inner.application_fee_amount = Some(application_fee_amount.into());
38383        self
38384    }
38385    /// An arbitrary string attached to the object. Often useful for displaying to users.
38386    pub fn description(mut self, description: impl Into<String>) -> Self {
38387        self.inner.description = Some(description.into());
38388        self
38389    }
38390    /// Specifies which fields in the response should be expanded.
38391    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
38392        self.inner.expand = Some(expand.into());
38393        self
38394    }
38395    /// Automations to be run during the PaymentIntent lifecycle
38396    pub fn hooks(mut self, hooks: impl Into<AsyncWorkflowsParam>) -> Self {
38397        self.inner.hooks = Some(hooks.into());
38398        self
38399    }
38400    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
38401    /// This can be useful for storing additional information about the object in a structured format.
38402    /// Individual keys can be unset by posting an empty value to them.
38403    /// All keys can be unset by posting an empty value to `metadata`.
38404    pub fn metadata(
38405        mut self,
38406        metadata: impl Into<std::collections::HashMap<String, String>>,
38407    ) -> Self {
38408        self.inner.metadata = Some(metadata.into());
38409        self
38410    }
38411    /// Provides industry-specific information about the charge.
38412    pub fn payment_details(
38413        mut self,
38414        payment_details: impl Into<IncrementAuthorizationPaymentIntentPaymentDetails>,
38415    ) -> Self {
38416        self.inner.payment_details = Some(payment_details.into());
38417        self
38418    }
38419    /// Text that appears on the customer's statement as the statement descriptor for a non-card or card charge.
38420    /// This value overrides the account's default statement descriptor.
38421    /// For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
38422    pub fn statement_descriptor(mut self, statement_descriptor: impl Into<String>) -> Self {
38423        self.inner.statement_descriptor = Some(statement_descriptor.into());
38424        self
38425    }
38426    /// The parameters used to automatically create a transfer after the payment is captured.
38427    /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
38428    pub fn transfer_data(
38429        mut self,
38430        transfer_data: impl Into<IncrementAuthorizationPaymentIntentTransferData>,
38431    ) -> Self {
38432        self.inner.transfer_data = Some(transfer_data.into());
38433        self
38434    }
38435}
38436impl IncrementAuthorizationPaymentIntent {
38437    /// Send the request and return the deserialized response.
38438    pub async fn send<C: StripeClient>(
38439        &self,
38440        client: &C,
38441    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
38442        self.customize().send(client).await
38443    }
38444
38445    /// Send the request and return the deserialized response, blocking until completion.
38446    pub fn send_blocking<C: StripeBlockingClient>(
38447        &self,
38448        client: &C,
38449    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
38450        self.customize().send_blocking(client)
38451    }
38452}
38453
38454impl StripeRequest for IncrementAuthorizationPaymentIntent {
38455    type Output = stripe_shared::PaymentIntent;
38456
38457    fn build(&self) -> RequestBuilder {
38458        let intent = &self.intent;
38459        RequestBuilder::new(
38460            StripeMethod::Post,
38461            format!("/payment_intents/{intent}/increment_authorization"),
38462        )
38463        .form(&self.inner)
38464    }
38465}
38466#[derive(Clone, Debug, serde::Serialize)]
38467struct VerifyMicrodepositsPaymentIntentBuilder {
38468    #[serde(skip_serializing_if = "Option::is_none")]
38469    amounts: Option<Vec<i64>>,
38470    #[serde(skip_serializing_if = "Option::is_none")]
38471    descriptor_code: Option<String>,
38472    #[serde(skip_serializing_if = "Option::is_none")]
38473    expand: Option<Vec<String>>,
38474}
38475impl VerifyMicrodepositsPaymentIntentBuilder {
38476    fn new() -> Self {
38477        Self { amounts: None, descriptor_code: None, expand: None }
38478    }
38479}
38480/// Verifies microdeposits on a PaymentIntent object.
38481#[derive(Clone, Debug, serde::Serialize)]
38482pub struct VerifyMicrodepositsPaymentIntent {
38483    inner: VerifyMicrodepositsPaymentIntentBuilder,
38484    intent: stripe_shared::PaymentIntentId,
38485}
38486impl VerifyMicrodepositsPaymentIntent {
38487    /// Construct a new `VerifyMicrodepositsPaymentIntent`.
38488    pub fn new(intent: impl Into<stripe_shared::PaymentIntentId>) -> Self {
38489        Self { intent: intent.into(), inner: VerifyMicrodepositsPaymentIntentBuilder::new() }
38490    }
38491    /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
38492    pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
38493        self.inner.amounts = Some(amounts.into());
38494        self
38495    }
38496    /// A six-character code starting with SM present in the microdeposit sent to the bank account.
38497    pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
38498        self.inner.descriptor_code = Some(descriptor_code.into());
38499        self
38500    }
38501    /// Specifies which fields in the response should be expanded.
38502    pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
38503        self.inner.expand = Some(expand.into());
38504        self
38505    }
38506}
38507impl VerifyMicrodepositsPaymentIntent {
38508    /// Send the request and return the deserialized response.
38509    pub async fn send<C: StripeClient>(
38510        &self,
38511        client: &C,
38512    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
38513        self.customize().send(client).await
38514    }
38515
38516    /// Send the request and return the deserialized response, blocking until completion.
38517    pub fn send_blocking<C: StripeBlockingClient>(
38518        &self,
38519        client: &C,
38520    ) -> Result<<Self as StripeRequest>::Output, C::Err> {
38521        self.customize().send_blocking(client)
38522    }
38523}
38524
38525impl StripeRequest for VerifyMicrodepositsPaymentIntent {
38526    type Output = stripe_shared::PaymentIntent;
38527
38528    fn build(&self) -> RequestBuilder {
38529        let intent = &self.intent;
38530        RequestBuilder::new(
38531            StripeMethod::Post,
38532            format!("/payment_intents/{intent}/verify_microdeposits"),
38533        )
38534        .form(&self.inner)
38535    }
38536}
38537
38538#[derive(Clone, Debug, serde::Serialize)]
38539pub struct PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
38540    /// URL to an image for the product. Max length, 4096 characters.
38541    #[serde(skip_serializing_if = "Option::is_none")]
38542    pub image_url: Option<String>,
38543    /// URL to the product page. Max length, 4096 characters.
38544    #[serde(skip_serializing_if = "Option::is_none")]
38545    pub product_url: Option<String>,
38546    /// Unique reference for this line item to correlate it with your system’s internal records.
38547    /// The field is displayed in the Klarna Consumer App if passed.
38548    #[serde(skip_serializing_if = "Option::is_none")]
38549    pub reference: Option<String>,
38550    /// Reference for the subscription this line item is for.
38551    #[serde(skip_serializing_if = "Option::is_none")]
38552    pub subscription_reference: Option<String>,
38553}
38554impl PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
38555    pub fn new() -> Self {
38556        Self { image_url: None, product_url: None, reference: None, subscription_reference: None }
38557    }
38558}
38559impl Default for PaymentIntentAmountDetailsLineItemPaymentMethodOptionsParam {
38560    fn default() -> Self {
38561        Self::new()
38562    }
38563}
38564#[derive(Copy, Clone, Debug, serde::Serialize)]
38565pub struct AmountDetailsLineItemTaxParam {
38566    /// The total amount of tax on a single line item represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
38567    /// Required for L3 rates.
38568    /// An integer greater than or equal to 0.
38569    ///
38570    /// This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field.
38571    pub total_tax_amount: i64,
38572}
38573impl AmountDetailsLineItemTaxParam {
38574    pub fn new(total_tax_amount: impl Into<i64>) -> Self {
38575        Self { total_tax_amount: total_tax_amount.into() }
38576    }
38577}
38578#[derive(Clone, Debug, serde::Serialize)]
38579pub struct AmountDetailsShippingParam {
38580    /// If a physical good is being shipped, the cost of shipping represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
38581    /// An integer greater than or equal to 0.
38582    #[serde(skip_serializing_if = "Option::is_none")]
38583    pub amount: Option<i64>,
38584    /// If a physical good is being shipped, the postal code of where it is being shipped from.
38585    /// At most 10 alphanumeric characters long, hyphens are allowed.
38586    #[serde(skip_serializing_if = "Option::is_none")]
38587    pub from_postal_code: Option<String>,
38588    /// If a physical good is being shipped, the postal code of where it is being shipped to.
38589    /// At most 10 alphanumeric characters long, hyphens are allowed.
38590    #[serde(skip_serializing_if = "Option::is_none")]
38591    pub to_postal_code: Option<String>,
38592}
38593impl AmountDetailsShippingParam {
38594    pub fn new() -> Self {
38595        Self { amount: None, from_postal_code: None, to_postal_code: None }
38596    }
38597}
38598impl Default for AmountDetailsShippingParam {
38599    fn default() -> Self {
38600        Self::new()
38601    }
38602}
38603#[derive(Copy, Clone, Debug, serde::Serialize)]
38604pub struct AmountDetailsTaxParam {
38605    /// The total amount of tax on the transaction represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
38606    /// Required for L2 rates.
38607    /// An integer greater than or equal to 0.
38608    ///
38609    /// This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field.
38610    pub total_tax_amount: i64,
38611}
38612impl AmountDetailsTaxParam {
38613    pub fn new(total_tax_amount: impl Into<i64>) -> Self {
38614        Self { total_tax_amount: total_tax_amount.into() }
38615    }
38616}
38617#[derive(Clone, Debug, serde::Serialize)]
38618pub struct AsyncWorkflowsInputsTaxParam {
38619    /// The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id
38620    pub calculation: String,
38621}
38622impl AsyncWorkflowsInputsTaxParam {
38623    pub fn new(calculation: impl Into<String>) -> Self {
38624        Self { calculation: calculation.into() }
38625    }
38626}
38627#[derive(Clone, Debug, serde::Serialize)]
38628pub struct OnlineParam {
38629    /// The IP address from which the Mandate was accepted by the customer.
38630    pub ip_address: String,
38631    /// The user agent of the browser from which the Mandate was accepted by the customer.
38632    pub user_agent: String,
38633}
38634impl OnlineParam {
38635    pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
38636        Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
38637    }
38638}
38639#[derive(Clone, Debug, serde::Serialize)]
38640pub struct PaymentMethodParam {
38641    /// Customer's bank account number.
38642    pub account_number: String,
38643    /// Institution number of the customer's bank.
38644    pub institution_number: String,
38645    /// Transit number of the customer's bank.
38646    pub transit_number: String,
38647}
38648impl PaymentMethodParam {
38649    pub fn new(
38650        account_number: impl Into<String>,
38651        institution_number: impl Into<String>,
38652        transit_number: impl Into<String>,
38653    ) -> Self {
38654        Self {
38655            account_number: account_number.into(),
38656            institution_number: institution_number.into(),
38657            transit_number: transit_number.into(),
38658        }
38659    }
38660}
38661#[derive(Copy, Clone, Debug, serde::Serialize)]
38662pub struct DateOfBirth {
38663    /// The day of birth, between 1 and 31.
38664    pub day: i64,
38665    /// The month of birth, between 1 and 12.
38666    pub month: i64,
38667    /// The four-digit year of birth.
38668    pub year: i64,
38669}
38670impl DateOfBirth {
38671    pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
38672        Self { day: day.into(), month: month.into(), year: year.into() }
38673    }
38674}
38675#[derive(Clone, Debug, serde::Serialize)]
38676pub struct PaymentMethodOptionsMandateOptionsParam {
38677    /// Prefix used to generate the Mandate reference.
38678    /// Must be at most 12 characters long.
38679    /// Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'.
38680    /// Cannot begin with 'DDIC' or 'STRIPE'.
38681    #[serde(skip_serializing_if = "Option::is_none")]
38682    pub reference_prefix: Option<String>,
38683}
38684impl PaymentMethodOptionsMandateOptionsParam {
38685    pub fn new() -> Self {
38686        Self { reference_prefix: None }
38687    }
38688}
38689impl Default for PaymentMethodOptionsMandateOptionsParam {
38690    fn default() -> Self {
38691        Self::new()
38692    }
38693}
38694#[derive(Clone, Debug, serde::Serialize)]
38695pub struct EuBankTransferParams {
38696    /// The desired country code of the bank account information.
38697    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
38698    pub country: String,
38699}
38700impl EuBankTransferParams {
38701    pub fn new(country: impl Into<String>) -> Self {
38702        Self { country: country.into() }
38703    }
38704}
38705#[derive(Clone, Debug, serde::Serialize)]
38706pub struct SubscriptionNextBillingParam {
38707    /// The amount of the next charge for the subscription.
38708    pub amount: i64,
38709    /// The date of the next charge for the subscription in YYYY-MM-DD format.
38710    pub date: String,
38711}
38712impl SubscriptionNextBillingParam {
38713    pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
38714        Self { amount: amount.into(), date: date.into() }
38715    }
38716}
38717#[derive(Clone, Debug, serde::Serialize)]
38718pub struct AsyncWorkflowsInputsParam {
38719    /// Tax arguments for automations
38720    #[serde(skip_serializing_if = "Option::is_none")]
38721    pub tax: Option<AsyncWorkflowsInputsTaxParam>,
38722}
38723impl AsyncWorkflowsInputsParam {
38724    pub fn new() -> Self {
38725        Self { tax: None }
38726    }
38727}
38728impl Default for AsyncWorkflowsInputsParam {
38729    fn default() -> Self {
38730        Self::new()
38731    }
38732}
38733#[derive(Clone, Debug, serde::Serialize)]
38734pub struct AsyncWorkflowsParam {
38735    /// Arguments passed in automations
38736    #[serde(skip_serializing_if = "Option::is_none")]
38737    pub inputs: Option<AsyncWorkflowsInputsParam>,
38738}
38739impl AsyncWorkflowsParam {
38740    pub fn new() -> Self {
38741        Self { inputs: None }
38742    }
38743}
38744impl Default for AsyncWorkflowsParam {
38745    fn default() -> Self {
38746        Self::new()
38747    }
38748}