stripe/resources/generated/
payment_method.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::client::{Client, Response};
6use crate::ids::{CustomerId, PaymentMethodId};
7use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp};
8use crate::resources::{
9    Address, BillingDetails, Charge, Customer, PaymentMethodCardPresentNetworks, RadarRadarOptions,
10    SetupAttempt,
11};
12use serde::{Deserialize, Serialize};
13
14/// The resource representing a Stripe "PaymentMethod".
15///
16/// For more details see <https://stripe.com/docs/api/payment_methods/object>
17#[derive(Clone, Debug, Default, Deserialize, Serialize)]
18pub struct PaymentMethod {
19    /// Unique identifier for the object.
20    pub id: PaymentMethodId,
21
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub acss_debit: Option<PaymentMethodAcssDebit>,
24
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub affirm: Option<PaymentMethodAffirm>,
27
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub afterpay_clearpay: Option<PaymentMethodAfterpayClearpay>,
30
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub alipay: Option<PaymentFlowsPrivatePaymentMethodsAlipay>,
33
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub au_becs_debit: Option<PaymentMethodAuBecsDebit>,
36
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub bacs_debit: Option<PaymentMethodBacsDebit>,
39
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub bancontact: Option<PaymentMethodBancontact>,
42
43    pub billing_details: BillingDetails,
44
45    #[serde(skip_serializing_if = "Option::is_none")]
46    pub blik: Option<PaymentMethodBlik>,
47
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub boleto: Option<PaymentMethodBoleto>,
50
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub card: Option<CardDetails>,
53
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub card_present: Option<CardPresent>,
56
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub cashapp: Option<PaymentMethodCashapp>,
59
60    /// Time at which the object was created.
61    ///
62    /// Measured in seconds since the Unix epoch.
63    pub created: Timestamp,
64
65    /// The ID of the Customer to which this PaymentMethod is saved.
66    ///
67    /// This will not be set when the PaymentMethod has not been saved to a Customer.
68    pub customer: Option<Expandable<Customer>>,
69
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub customer_balance: Option<PaymentMethodCustomerBalance>,
72
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub eps: Option<PaymentMethodEps>,
75
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub fpx: Option<PaymentMethodFpx>,
78
79    #[serde(skip_serializing_if = "Option::is_none")]
80    pub giropay: Option<PaymentMethodGiropay>,
81
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub grabpay: Option<PaymentMethodGrabpay>,
84
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub ideal: Option<PaymentMethodIdeal>,
87
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub interac_present: Option<PaymentMethodInteracPresent>,
90
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub klarna: Option<PaymentMethodKlarna>,
93
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub konbini: Option<PaymentMethodKonbini>,
96
97    #[serde(skip_serializing_if = "Option::is_none")]
98    pub link: Option<PaymentMethodLink>,
99
100    /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
101    pub livemode: bool,
102
103    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
104    ///
105    /// This can be useful for storing additional information about the object in a structured format.
106    pub metadata: Option<Metadata>,
107
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub oxxo: Option<PaymentMethodOxxo>,
110
111    #[serde(skip_serializing_if = "Option::is_none")]
112    pub p24: Option<PaymentMethodP24>,
113
114    #[serde(skip_serializing_if = "Option::is_none")]
115    pub paynow: Option<PaymentMethodPaynow>,
116
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub paypal: Option<PaymentMethodPaypal>,
119
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub pix: Option<PaymentMethodPix>,
122
123    #[serde(skip_serializing_if = "Option::is_none")]
124    pub promptpay: Option<PaymentMethodPromptpay>,
125
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub radar_options: Option<RadarRadarOptions>,
128
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub revolut_pay: Option<PaymentMethodRevolutPay>,
131
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub sepa_debit: Option<PaymentMethodSepaDebit>,
134
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub sofort: Option<PaymentMethodSofort>,
137
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub swish: Option<PaymentMethodSwish>,
140
141    /// The type of the PaymentMethod.
142    ///
143    /// An additional hash is included on the PaymentMethod with a name matching this value.
144    /// It contains additional information specific to the PaymentMethod type.
145    #[serde(rename = "type")]
146    pub type_: PaymentMethodType,
147
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub us_bank_account: Option<PaymentMethodUsBankAccount>,
150
151    #[serde(skip_serializing_if = "Option::is_none")]
152    pub wechat_pay: Option<PaymentMethodWechatPay>,
153
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub zip: Option<PaymentMethodZip>,
156}
157
158impl PaymentMethod {
159    /// Returns a list of PaymentMethods for Treasury flows.
160    ///
161    /// If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead.
162    pub fn list(client: &Client, params: &ListPaymentMethods<'_>) -> Response<List<PaymentMethod>> {
163        client.get_query("/payment_methods", params)
164    }
165
166    /// Creates a PaymentMethod object.
167    ///
168    /// Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js.  Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents](https://stripe.com/docs/payments/accept-a-payment) API to accept a payment immediately or the [SetupIntent](https://stripe.com/docs/payments/save-and-reuse) API to collect payment method details ahead of a future payment.
169    pub fn create(client: &Client, params: CreatePaymentMethod<'_>) -> Response<PaymentMethod> {
170        #[allow(clippy::needless_borrows_for_generic_args)]
171        client.post_form("/payment_methods", &params)
172    }
173
174    /// Retrieves a PaymentMethod object attached to the StripeAccount.
175    ///
176    /// To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer).
177    pub fn retrieve(
178        client: &Client,
179        id: &PaymentMethodId,
180        expand: &[&str],
181    ) -> Response<PaymentMethod> {
182        client.get_query(&format!("/payment_methods/{}", id), Expand { expand })
183    }
184
185    /// Updates a PaymentMethod object.
186    ///
187    /// A PaymentMethod must be attached a customer to be updated.
188    pub fn update(
189        client: &Client,
190        id: &PaymentMethodId,
191        params: UpdatePaymentMethod<'_>,
192    ) -> Response<PaymentMethod> {
193        #[allow(clippy::needless_borrows_for_generic_args)]
194        client.post_form(&format!("/payment_methods/{}", id), &params)
195    }
196}
197
198impl Object for PaymentMethod {
199    type Id = PaymentMethodId;
200    fn id(&self) -> Self::Id {
201        self.id.clone()
202    }
203    fn object(&self) -> &'static str {
204        "payment_method"
205    }
206}
207
208#[derive(Clone, Debug, Default, Deserialize, Serialize)]
209pub struct PaymentFlowsPrivatePaymentMethodsAlipay {}
210
211#[derive(Clone, Debug, Default, Deserialize, Serialize)]
212pub struct PaymentMethodAcssDebit {
213    /// Name of the bank associated with the bank account.
214    pub bank_name: Option<String>,
215
216    /// Uniquely identifies this particular bank account.
217    ///
218    /// You can use this attribute to check whether two bank accounts are the same.
219    pub fingerprint: Option<String>,
220
221    /// Institution number of the bank account.
222    pub institution_number: Option<String>,
223
224    /// Last four digits of the bank account number.
225    pub last4: Option<String>,
226
227    /// Transit number of the bank account.
228    pub transit_number: Option<String>,
229}
230
231#[derive(Clone, Debug, Default, Deserialize, Serialize)]
232pub struct PaymentMethodAffirm {}
233
234#[derive(Clone, Debug, Default, Deserialize, Serialize)]
235pub struct PaymentMethodAfterpayClearpay {}
236
237#[derive(Clone, Debug, Default, Deserialize, Serialize)]
238pub struct PaymentMethodAuBecsDebit {
239    /// Six-digit number identifying bank and branch associated with this bank account.
240    pub bsb_number: Option<String>,
241
242    /// Uniquely identifies this particular bank account.
243    ///
244    /// You can use this attribute to check whether two bank accounts are the same.
245    pub fingerprint: Option<String>,
246
247    /// Last four digits of the bank account number.
248    pub last4: Option<String>,
249}
250
251#[derive(Clone, Debug, Default, Deserialize, Serialize)]
252pub struct PaymentMethodBacsDebit {
253    /// Uniquely identifies this particular bank account.
254    ///
255    /// You can use this attribute to check whether two bank accounts are the same.
256    pub fingerprint: Option<String>,
257
258    /// Last four digits of the bank account number.
259    pub last4: Option<String>,
260
261    /// Sort code of the bank account.
262    ///
263    /// (e.g., `10-20-30`).
264    pub sort_code: Option<String>,
265}
266
267#[derive(Clone, Debug, Default, Deserialize, Serialize)]
268pub struct PaymentMethodBancontact {}
269
270#[derive(Clone, Debug, Default, Deserialize, Serialize)]
271pub struct PaymentMethodBlik {}
272
273#[derive(Clone, Debug, Default, Deserialize, Serialize)]
274pub struct PaymentMethodBoleto {
275    /// Uniquely identifies the customer tax id (CNPJ or CPF).
276    pub tax_id: String,
277}
278
279#[derive(Clone, Debug, Default, Deserialize, Serialize)]
280pub struct CardDetails {
281    /// Card brand.
282    ///
283    /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
284    pub brand: String,
285
286    /// Checks on Card address and CVC if provided.
287    pub checks: Option<PaymentMethodCardChecks>,
288
289    /// Two-letter ISO code representing the country of the card.
290    ///
291    /// You could use this attribute to get a sense of the international breakdown of cards you've collected.
292    pub country: Option<String>,
293
294    /// A high-level description of the type of cards issued in this range.
295    ///
296    /// (For internal use only and not typically available in standard API requests.).
297    #[serde(skip_serializing_if = "Option::is_none")]
298    pub description: Option<String>,
299
300    /// Two-digit number representing the card's expiration month.
301    pub exp_month: i64,
302
303    /// Four-digit number representing the card's expiration year.
304    pub exp_year: i64,
305
306    /// Uniquely identifies this particular card number.
307    ///
308    /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
309    /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.  *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*.
310    #[serde(skip_serializing_if = "Option::is_none")]
311    pub fingerprint: Option<String>,
312
313    /// Card funding type.
314    ///
315    /// Can be `credit`, `debit`, `prepaid`, or `unknown`.
316    pub funding: String,
317
318    /// Issuer identification number of the card.
319    ///
320    /// (For internal use only and not typically available in standard API requests.).
321    #[serde(skip_serializing_if = "Option::is_none")]
322    pub iin: Option<String>,
323
324    /// The name of the card's issuing bank.
325    ///
326    /// (For internal use only and not typically available in standard API requests.).
327    #[serde(skip_serializing_if = "Option::is_none")]
328    pub issuer: Option<String>,
329
330    /// The last four digits of the card.
331    pub last4: String,
332
333    /// Contains information about card networks that can be used to process the payment.
334    pub networks: Option<Networks>,
335
336    /// Contains details on how this Card may be used for 3D Secure authentication.
337    pub three_d_secure_usage: Option<ThreeDSecureUsage>,
338
339    /// If this Card is part of a card wallet, this contains the details of the card wallet.
340    pub wallet: Option<WalletDetails>,
341}
342
343#[derive(Clone, Debug, Default, Deserialize, Serialize)]
344pub struct Networks {
345    /// All available networks for the card.
346    pub available: Vec<String>,
347
348    /// The preferred network for co-branded cards.
349    ///
350    /// Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
351    pub preferred: Option<String>,
352}
353
354#[derive(Clone, Debug, Default, Deserialize, Serialize)]
355pub struct PaymentMethodCardChecks {
356    /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
357    pub address_line1_check: Option<String>,
358
359    /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
360    pub address_postal_code_check: Option<String>,
361
362    /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
363    pub cvc_check: Option<String>,
364}
365
366#[derive(Clone, Debug, Default, Deserialize, Serialize)]
367pub struct CardPresent {
368    /// Card brand.
369    ///
370    /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
371    pub brand: Option<String>,
372
373    /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format.
374    ///
375    /// May include alphanumeric characters, special characters and first/last name separator (`/`).
376    /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card.
377    /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.
378    pub cardholder_name: Option<String>,
379
380    /// Two-letter ISO code representing the country of the card.
381    ///
382    /// You could use this attribute to get a sense of the international breakdown of cards you've collected.
383    pub country: Option<String>,
384
385    /// A high-level description of the type of cards issued in this range.
386    ///
387    /// (For internal use only and not typically available in standard API requests.).
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub description: Option<String>,
390
391    /// Two-digit number representing the card's expiration month.
392    pub exp_month: i64,
393
394    /// Four-digit number representing the card's expiration year.
395    pub exp_year: i64,
396
397    /// Uniquely identifies this particular card number.
398    ///
399    /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
400    /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.  *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*.
401    pub fingerprint: Option<String>,
402
403    /// Card funding type.
404    ///
405    /// Can be `credit`, `debit`, `prepaid`, or `unknown`.
406    pub funding: Option<String>,
407
408    /// Issuer identification number of the card.
409    ///
410    /// (For internal use only and not typically available in standard API requests.).
411    #[serde(skip_serializing_if = "Option::is_none")]
412    pub iin: Option<String>,
413
414    /// The name of the card's issuing bank.
415    ///
416    /// (For internal use only and not typically available in standard API requests.).
417    #[serde(skip_serializing_if = "Option::is_none")]
418    pub issuer: Option<String>,
419
420    /// The last four digits of the card.
421    pub last4: Option<String>,
422
423    /// Contains information about card networks that can be used to process the payment.
424    pub networks: Option<PaymentMethodCardPresentNetworks>,
425
426    /// How card details were read in this transaction.
427    pub read_method: Option<CardPresentReadMethod>,
428}
429
430#[derive(Clone, Debug, Default, Deserialize, Serialize)]
431pub struct WalletDetails {
432    #[serde(skip_serializing_if = "Option::is_none")]
433    pub amex_express_checkout: Option<WalletAmexExpressCheckout>,
434
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub apple_pay: Option<WalletApplePay>,
437
438    /// (For tokenized numbers only.) The last four digits of the device account number.
439    pub dynamic_last4: Option<String>,
440
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub google_pay: Option<WalletGooglePay>,
443
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub link: Option<PaymentMethodCardWalletLink>,
446
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub masterpass: Option<WalletMasterpass>,
449
450    #[serde(skip_serializing_if = "Option::is_none")]
451    pub samsung_pay: Option<WalletSamsungPay>,
452
453    /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`.
454    ///
455    /// An additional hash is included on the Wallet subhash with a name matching this value.
456    /// It contains additional information specific to the card wallet type.
457    #[serde(rename = "type")]
458    pub type_: WalletDetailsType,
459
460    #[serde(skip_serializing_if = "Option::is_none")]
461    pub visa_checkout: Option<WalletVisaCheckout>,
462}
463
464#[derive(Clone, Debug, Default, Deserialize, Serialize)]
465pub struct WalletAmexExpressCheckout {}
466
467#[derive(Clone, Debug, Default, Deserialize, Serialize)]
468pub struct WalletApplePay {}
469
470#[derive(Clone, Debug, Default, Deserialize, Serialize)]
471pub struct WalletGooglePay {}
472
473#[derive(Clone, Debug, Default, Deserialize, Serialize)]
474pub struct PaymentMethodCardWalletLink {}
475
476#[derive(Clone, Debug, Default, Deserialize, Serialize)]
477pub struct WalletMasterpass {
478    /// Owner's verified billing address.
479    ///
480    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
481    /// They cannot be set or mutated.
482    pub billing_address: Option<Address>,
483
484    /// Owner's verified email.
485    ///
486    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
487    /// They cannot be set or mutated.
488    pub email: Option<String>,
489
490    /// Owner's verified full name.
491    ///
492    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
493    /// They cannot be set or mutated.
494    pub name: Option<String>,
495
496    /// Owner's verified shipping address.
497    ///
498    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
499    /// They cannot be set or mutated.
500    pub shipping_address: Option<Address>,
501}
502
503#[derive(Clone, Debug, Default, Deserialize, Serialize)]
504pub struct WalletSamsungPay {}
505
506#[derive(Clone, Debug, Default, Deserialize, Serialize)]
507pub struct WalletVisaCheckout {
508    /// Owner's verified billing address.
509    ///
510    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
511    /// They cannot be set or mutated.
512    pub billing_address: Option<Address>,
513
514    /// Owner's verified email.
515    ///
516    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
517    /// They cannot be set or mutated.
518    pub email: Option<String>,
519
520    /// Owner's verified full name.
521    ///
522    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
523    /// They cannot be set or mutated.
524    pub name: Option<String>,
525
526    /// Owner's verified shipping address.
527    ///
528    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
529    /// They cannot be set or mutated.
530    pub shipping_address: Option<Address>,
531}
532
533#[derive(Clone, Debug, Default, Deserialize, Serialize)]
534pub struct PaymentMethodCashapp {
535    /// A unique and immutable identifier assigned by Cash App to every buyer.
536    pub buyer_id: Option<String>,
537
538    /// A public identifier for buyers using Cash App.
539    pub cashtag: Option<String>,
540}
541
542#[derive(Clone, Debug, Default, Deserialize, Serialize)]
543pub struct PaymentMethodCustomerBalance {}
544
545#[derive(Clone, Debug, Default, Deserialize, Serialize)]
546pub struct PaymentMethodEps {
547    /// The customer's bank.
548    ///
549    /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
550    pub bank: Option<PaymentMethodEpsBank>,
551}
552
553#[derive(Clone, Debug, Default, Deserialize, Serialize)]
554pub struct PaymentMethodFpx {
555    /// Account holder type, if provided.
556    ///
557    /// Can be one of `individual` or `company`.
558    pub account_holder_type: Option<PaymentMethodFpxAccountHolderType>,
559
560    /// The customer's bank, if provided.
561    ///
562    /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.
563    pub bank: PaymentMethodFpxBank,
564}
565
566#[derive(Clone, Debug, Default, Deserialize, Serialize)]
567pub struct PaymentMethodGiropay {}
568
569#[derive(Clone, Debug, Default, Deserialize, Serialize)]
570pub struct PaymentMethodGrabpay {}
571
572#[derive(Clone, Debug, Default, Deserialize, Serialize)]
573pub struct PaymentMethodIdeal {
574    /// The customer's bank, if provided.
575    ///
576    /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
577    pub bank: Option<PaymentMethodIdealBank>,
578
579    /// The Bank Identifier Code of the customer's bank, if the bank was provided.
580    pub bic: Option<PaymentMethodIdealBic>,
581}
582
583#[derive(Clone, Debug, Default, Deserialize, Serialize)]
584pub struct PaymentMethodInteracPresent {
585    /// Card brand.
586    ///
587    /// Can be `interac`, `mastercard` or `visa`.
588    pub brand: Option<String>,
589
590    /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format.
591    ///
592    /// May include alphanumeric characters, special characters and first/last name separator (`/`).
593    /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card.
594    /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.
595    pub cardholder_name: Option<String>,
596
597    /// Two-letter ISO code representing the country of the card.
598    ///
599    /// You could use this attribute to get a sense of the international breakdown of cards you've collected.
600    pub country: Option<String>,
601
602    /// A high-level description of the type of cards issued in this range.
603    ///
604    /// (For internal use only and not typically available in standard API requests.).
605    #[serde(skip_serializing_if = "Option::is_none")]
606    pub description: Option<String>,
607
608    /// Two-digit number representing the card's expiration month.
609    pub exp_month: i64,
610
611    /// Four-digit number representing the card's expiration year.
612    pub exp_year: i64,
613
614    /// Uniquely identifies this particular card number.
615    ///
616    /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
617    /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.  *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*.
618    pub fingerprint: Option<String>,
619
620    /// Card funding type.
621    ///
622    /// Can be `credit`, `debit`, `prepaid`, or `unknown`.
623    pub funding: Option<String>,
624
625    /// Issuer identification number of the card.
626    ///
627    /// (For internal use only and not typically available in standard API requests.).
628    #[serde(skip_serializing_if = "Option::is_none")]
629    pub iin: Option<String>,
630
631    /// The name of the card's issuing bank.
632    ///
633    /// (For internal use only and not typically available in standard API requests.).
634    #[serde(skip_serializing_if = "Option::is_none")]
635    pub issuer: Option<String>,
636
637    /// The last four digits of the card.
638    pub last4: Option<String>,
639
640    /// Contains information about card networks that can be used to process the payment.
641    pub networks: Option<PaymentMethodCardPresentNetworks>,
642
643    /// EMV tag 5F2D.
644    ///
645    /// Preferred languages specified by the integrated circuit chip.
646    pub preferred_locales: Option<Vec<String>>,
647
648    /// How card details were read in this transaction.
649    pub read_method: Option<PaymentMethodInteracPresentReadMethod>,
650}
651
652#[derive(Clone, Debug, Default, Deserialize, Serialize)]
653pub struct PaymentMethodKlarna {
654    /// The customer's date of birth, if provided.
655    pub dob: Option<PaymentFlowsPrivatePaymentMethodsKlarnaDob>,
656}
657
658#[derive(Clone, Debug, Default, Deserialize, Serialize)]
659pub struct PaymentFlowsPrivatePaymentMethodsKlarnaDob {
660    /// The day of birth, between 1 and 31.
661    pub day: Option<i64>,
662
663    /// The month of birth, between 1 and 12.
664    pub month: Option<i64>,
665
666    /// The four-digit year of birth.
667    pub year: Option<i64>,
668}
669
670#[derive(Clone, Debug, Default, Deserialize, Serialize)]
671pub struct PaymentMethodKonbini {}
672
673#[derive(Clone, Debug, Default, Deserialize, Serialize)]
674pub struct PaymentMethodLink {
675    /// Account owner's email address.
676    pub email: Option<String>,
677
678    /// [Deprecated] This is a legacy parameter that no longer has any function.
679    #[serde(skip_serializing_if = "Option::is_none")]
680    pub persistent_token: Option<String>,
681}
682
683#[derive(Clone, Debug, Default, Deserialize, Serialize)]
684pub struct PaymentMethodOxxo {}
685
686#[derive(Clone, Debug, Default, Deserialize, Serialize)]
687pub struct PaymentMethodP24 {
688    /// The customer's bank, if provided.
689    pub bank: Option<PaymentMethodP24Bank>,
690}
691
692#[derive(Clone, Debug, Default, Deserialize, Serialize)]
693pub struct PaymentMethodPaynow {}
694
695#[derive(Clone, Debug, Default, Deserialize, Serialize)]
696pub struct PaymentMethodPaypal {
697    /// Owner's email.
698    ///
699    /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement.
700    /// They cannot be set or mutated.
701    pub payer_email: Option<String>,
702
703    /// PayPal account PayerID.
704    ///
705    /// This identifier uniquely identifies the PayPal customer.
706    pub payer_id: Option<String>,
707}
708
709#[derive(Clone, Debug, Default, Deserialize, Serialize)]
710pub struct PaymentMethodPix {}
711
712#[derive(Clone, Debug, Default, Deserialize, Serialize)]
713pub struct PaymentMethodPromptpay {}
714
715#[derive(Clone, Debug, Default, Deserialize, Serialize)]
716pub struct PaymentMethodRevolutPay {}
717
718#[derive(Clone, Debug, Default, Deserialize, Serialize)]
719pub struct PaymentMethodSepaDebit {
720    /// Bank code of bank associated with the bank account.
721    pub bank_code: Option<String>,
722
723    /// Branch code of bank associated with the bank account.
724    pub branch_code: Option<String>,
725
726    /// Two-letter ISO code representing the country the bank account is located in.
727    pub country: Option<String>,
728
729    /// Uniquely identifies this particular bank account.
730    ///
731    /// You can use this attribute to check whether two bank accounts are the same.
732    pub fingerprint: Option<String>,
733
734    /// Information about the object that generated this PaymentMethod.
735    pub generated_from: Option<SepaDebitGeneratedFrom>,
736
737    /// Last four characters of the IBAN.
738    pub last4: Option<String>,
739}
740
741#[derive(Clone, Debug, Default, Deserialize, Serialize)]
742pub struct PaymentMethodSofort {
743    /// Two-letter ISO code representing the country the bank account is located in.
744    pub country: Option<String>,
745}
746
747#[derive(Clone, Debug, Default, Deserialize, Serialize)]
748pub struct PaymentMethodSwish {}
749
750#[derive(Clone, Debug, Default, Deserialize, Serialize)]
751pub struct PaymentMethodUsBankAccount {
752    /// Account holder type: individual or company.
753    pub account_holder_type: Option<PaymentMethodUsBankAccountAccountHolderType>,
754
755    /// Account type: checkings or savings.
756    ///
757    /// Defaults to checking if omitted.
758    pub account_type: Option<PaymentMethodUsBankAccountAccountType>,
759
760    /// The name of the bank.
761    pub bank_name: Option<String>,
762
763    /// The ID of the Financial Connections Account used to create the payment method.
764    pub financial_connections_account: Option<String>,
765
766    /// Uniquely identifies this particular bank account.
767    ///
768    /// You can use this attribute to check whether two bank accounts are the same.
769    pub fingerprint: Option<String>,
770
771    /// Last four digits of the bank account number.
772    pub last4: Option<String>,
773
774    /// Contains information about US bank account networks that can be used.
775    pub networks: Option<UsBankAccountNetworks>,
776
777    /// Routing number of the bank account.
778    pub routing_number: Option<String>,
779
780    /// Contains information about the future reusability of this PaymentMethod.
781    pub status_details: Option<PaymentMethodUsBankAccountStatusDetails>,
782}
783
784#[derive(Clone, Debug, Default, Deserialize, Serialize)]
785pub struct PaymentMethodUsBankAccountStatusDetails {
786    #[serde(skip_serializing_if = "Option::is_none")]
787    pub blocked: Option<PaymentMethodUsBankAccountBlocked>,
788}
789
790#[derive(Clone, Debug, Default, Deserialize, Serialize)]
791pub struct PaymentMethodUsBankAccountBlocked {
792    /// The ACH network code that resulted in this block.
793    pub network_code: Option<PaymentMethodUsBankAccountBlockedNetworkCode>,
794
795    /// The reason why this PaymentMethod's fingerprint has been blocked.
796    pub reason: Option<PaymentMethodUsBankAccountBlockedReason>,
797}
798
799#[derive(Clone, Debug, Default, Deserialize, Serialize)]
800pub struct PaymentMethodWechatPay {}
801
802#[derive(Clone, Debug, Default, Deserialize, Serialize)]
803pub struct PaymentMethodZip {}
804
805#[derive(Clone, Debug, Default, Deserialize, Serialize)]
806pub struct SepaDebitGeneratedFrom {
807    /// The ID of the Charge that generated this PaymentMethod, if any.
808    pub charge: Option<Expandable<Charge>>,
809
810    /// The ID of the SetupAttempt that generated this PaymentMethod, if any.
811    pub setup_attempt: Option<Expandable<SetupAttempt>>,
812}
813
814#[derive(Clone, Debug, Default, Deserialize, Serialize)]
815pub struct ThreeDSecureUsage {
816    /// Whether 3D Secure is supported on this card.
817    pub supported: bool,
818}
819
820#[derive(Clone, Debug, Default, Deserialize, Serialize)]
821pub struct UsBankAccountNetworks {
822    /// The preferred network.
823    pub preferred: Option<String>,
824
825    /// All supported networks.
826    pub supported: Vec<UsBankAccountNetworksSupported>,
827}
828
829/// The parameters for `PaymentMethod::create`.
830#[derive(Clone, Debug, Serialize, Default)]
831pub struct CreatePaymentMethod<'a> {
832    /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
833    #[serde(skip_serializing_if = "Option::is_none")]
834    pub acss_debit: Option<CreatePaymentMethodAcssDebit>,
835
836    /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
837    #[serde(skip_serializing_if = "Option::is_none")]
838    pub affirm: Option<CreatePaymentMethodAffirm>,
839
840    /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.
841    #[serde(skip_serializing_if = "Option::is_none")]
842    pub afterpay_clearpay: Option<CreatePaymentMethodAfterpayClearpay>,
843
844    /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
845    #[serde(skip_serializing_if = "Option::is_none")]
846    pub alipay: Option<CreatePaymentMethodAlipay>,
847
848    /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
849    #[serde(skip_serializing_if = "Option::is_none")]
850    pub au_becs_debit: Option<CreatePaymentMethodAuBecsDebit>,
851
852    /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.
853    #[serde(skip_serializing_if = "Option::is_none")]
854    pub bacs_debit: Option<CreatePaymentMethodBacsDebit>,
855
856    /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
857    #[serde(skip_serializing_if = "Option::is_none")]
858    pub bancontact: Option<CreatePaymentMethodBancontact>,
859
860    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
861    #[serde(skip_serializing_if = "Option::is_none")]
862    pub billing_details: Option<BillingDetails>,
863
864    /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
865    #[serde(skip_serializing_if = "Option::is_none")]
866    pub blik: Option<CreatePaymentMethodBlik>,
867
868    /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
869    #[serde(skip_serializing_if = "Option::is_none")]
870    pub boleto: Option<CreatePaymentMethodBoleto>,
871
872    /// If this is a `card` PaymentMethod, this hash contains the user's card details.
873    ///
874    /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`.
875    /// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance).
876    /// We strongly recommend using Stripe.js instead of interacting with this API directly.
877    #[serde(skip_serializing_if = "Option::is_none")]
878    pub card: Option<CreatePaymentMethodCardUnion>,
879
880    /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
881    #[serde(skip_serializing_if = "Option::is_none")]
882    pub cashapp: Option<CreatePaymentMethodCashapp>,
883
884    /// The `Customer` to whom the original PaymentMethod is attached.
885    #[serde(skip_serializing_if = "Option::is_none")]
886    pub customer: Option<CustomerId>,
887
888    /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
889    #[serde(skip_serializing_if = "Option::is_none")]
890    pub customer_balance: Option<CreatePaymentMethodCustomerBalance>,
891
892    /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
893    #[serde(skip_serializing_if = "Option::is_none")]
894    pub eps: Option<CreatePaymentMethodEps>,
895
896    /// Specifies which fields in the response should be expanded.
897    #[serde(skip_serializing_if = "Expand::is_empty")]
898    pub expand: &'a [&'a str],
899
900    /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.
901    #[serde(skip_serializing_if = "Option::is_none")]
902    pub fpx: Option<CreatePaymentMethodFpx>,
903
904    /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
905    #[serde(skip_serializing_if = "Option::is_none")]
906    pub giropay: Option<CreatePaymentMethodGiropay>,
907
908    /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
909    #[serde(skip_serializing_if = "Option::is_none")]
910    pub grabpay: Option<CreatePaymentMethodGrabpay>,
911
912    /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
913    #[serde(skip_serializing_if = "Option::is_none")]
914    pub ideal: Option<CreatePaymentMethodIdeal>,
915
916    /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
917    #[serde(skip_serializing_if = "Option::is_none")]
918    pub interac_present: Option<CreatePaymentMethodInteracPresent>,
919
920    /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
921    #[serde(skip_serializing_if = "Option::is_none")]
922    pub klarna: Option<CreatePaymentMethodKlarna>,
923
924    /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.
925    #[serde(skip_serializing_if = "Option::is_none")]
926    pub konbini: Option<CreatePaymentMethodKonbini>,
927
928    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
929    #[serde(skip_serializing_if = "Option::is_none")]
930    pub link: Option<CreatePaymentMethodLink>,
931
932    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
933    ///
934    /// This can be useful for storing additional information about the object in a structured format.
935    /// Individual keys can be unset by posting an empty value to them.
936    /// All keys can be unset by posting an empty value to `metadata`.
937    #[serde(skip_serializing_if = "Option::is_none")]
938    pub metadata: Option<Metadata>,
939
940    /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
941    #[serde(skip_serializing_if = "Option::is_none")]
942    pub oxxo: Option<CreatePaymentMethodOxxo>,
943
944    /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
945    #[serde(skip_serializing_if = "Option::is_none")]
946    pub p24: Option<CreatePaymentMethodP24>,
947
948    /// The PaymentMethod to share.
949    #[serde(skip_serializing_if = "Option::is_none")]
950    pub payment_method: Option<PaymentMethodId>,
951
952    /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.
953    #[serde(skip_serializing_if = "Option::is_none")]
954    pub paynow: Option<CreatePaymentMethodPaynow>,
955
956    /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub paypal: Option<CreatePaymentMethodPaypal>,
959
960    /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
961    #[serde(skip_serializing_if = "Option::is_none")]
962    pub pix: Option<CreatePaymentMethodPix>,
963
964    /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
965    #[serde(skip_serializing_if = "Option::is_none")]
966    pub promptpay: Option<CreatePaymentMethodPromptpay>,
967
968    /// Options to configure Radar.
969    ///
970    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
971    #[serde(skip_serializing_if = "Option::is_none")]
972    pub radar_options: Option<CreatePaymentMethodRadarOptions>,
973
974    /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
975    #[serde(skip_serializing_if = "Option::is_none")]
976    pub revolut_pay: Option<CreatePaymentMethodRevolutPay>,
977
978    /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
979    #[serde(skip_serializing_if = "Option::is_none")]
980    pub sepa_debit: Option<CreatePaymentMethodSepaDebit>,
981
982    /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
983    #[serde(skip_serializing_if = "Option::is_none")]
984    pub sofort: Option<CreatePaymentMethodSofort>,
985
986    /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
987    #[serde(skip_serializing_if = "Option::is_none")]
988    pub swish: Option<CreatePaymentMethodSwish>,
989
990    /// The type of the PaymentMethod.
991    ///
992    /// An additional hash is included on the PaymentMethod with a name matching this value.
993    /// It contains additional information specific to the PaymentMethod type.
994    #[serde(rename = "type")]
995    #[serde(skip_serializing_if = "Option::is_none")]
996    pub type_: Option<PaymentMethodTypeFilter>,
997
998    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
999    #[serde(skip_serializing_if = "Option::is_none")]
1000    pub us_bank_account: Option<CreatePaymentMethodUsBankAccount>,
1001
1002    /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.
1003    #[serde(skip_serializing_if = "Option::is_none")]
1004    pub wechat_pay: Option<CreatePaymentMethodWechatPay>,
1005
1006    /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method.
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub zip: Option<CreatePaymentMethodZip>,
1009}
1010
1011impl<'a> CreatePaymentMethod<'a> {
1012    pub fn new() -> Self {
1013        CreatePaymentMethod {
1014            acss_debit: Default::default(),
1015            affirm: Default::default(),
1016            afterpay_clearpay: Default::default(),
1017            alipay: Default::default(),
1018            au_becs_debit: Default::default(),
1019            bacs_debit: Default::default(),
1020            bancontact: Default::default(),
1021            billing_details: Default::default(),
1022            blik: Default::default(),
1023            boleto: Default::default(),
1024            card: Default::default(),
1025            cashapp: Default::default(),
1026            customer: Default::default(),
1027            customer_balance: Default::default(),
1028            eps: Default::default(),
1029            expand: Default::default(),
1030            fpx: Default::default(),
1031            giropay: Default::default(),
1032            grabpay: Default::default(),
1033            ideal: Default::default(),
1034            interac_present: Default::default(),
1035            klarna: Default::default(),
1036            konbini: Default::default(),
1037            link: Default::default(),
1038            metadata: Default::default(),
1039            oxxo: Default::default(),
1040            p24: Default::default(),
1041            payment_method: Default::default(),
1042            paynow: Default::default(),
1043            paypal: Default::default(),
1044            pix: Default::default(),
1045            promptpay: Default::default(),
1046            radar_options: Default::default(),
1047            revolut_pay: Default::default(),
1048            sepa_debit: Default::default(),
1049            sofort: Default::default(),
1050            swish: Default::default(),
1051            type_: Default::default(),
1052            us_bank_account: Default::default(),
1053            wechat_pay: Default::default(),
1054            zip: Default::default(),
1055        }
1056    }
1057}
1058
1059/// The parameters for `PaymentMethod::list`.
1060#[derive(Clone, Debug, Serialize, Default)]
1061pub struct ListPaymentMethods<'a> {
1062    /// The ID of the customer whose PaymentMethods will be retrieved.
1063    #[serde(skip_serializing_if = "Option::is_none")]
1064    pub customer: Option<CustomerId>,
1065
1066    /// A cursor for use in pagination.
1067    ///
1068    /// `ending_before` is an object ID that defines your place in the list.
1069    /// 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.
1070    #[serde(skip_serializing_if = "Option::is_none")]
1071    pub ending_before: Option<PaymentMethodId>,
1072
1073    /// Specifies which fields in the response should be expanded.
1074    #[serde(skip_serializing_if = "Expand::is_empty")]
1075    pub expand: &'a [&'a str],
1076
1077    /// A limit on the number of objects to be returned.
1078    ///
1079    /// Limit can range between 1 and 100, and the default is 10.
1080    #[serde(skip_serializing_if = "Option::is_none")]
1081    pub limit: Option<u64>,
1082
1083    /// A cursor for use in pagination.
1084    ///
1085    /// `starting_after` is an object ID that defines your place in the list.
1086    /// 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.
1087    #[serde(skip_serializing_if = "Option::is_none")]
1088    pub starting_after: Option<PaymentMethodId>,
1089
1090    /// An optional filter on the list, based on the object `type` field.
1091    ///
1092    /// Without the filter, the list includes all current and future payment method types.
1093    /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request.
1094    #[serde(rename = "type")]
1095    #[serde(skip_serializing_if = "Option::is_none")]
1096    pub type_: Option<PaymentMethodTypeFilter>,
1097}
1098
1099impl<'a> ListPaymentMethods<'a> {
1100    pub fn new() -> Self {
1101        ListPaymentMethods {
1102            customer: Default::default(),
1103            ending_before: Default::default(),
1104            expand: Default::default(),
1105            limit: Default::default(),
1106            starting_after: Default::default(),
1107            type_: Default::default(),
1108        }
1109    }
1110}
1111impl Paginable for ListPaymentMethods<'_> {
1112    type O = PaymentMethod;
1113    fn set_last(&mut self, item: Self::O) {
1114        self.starting_after = Some(item.id());
1115    }
1116}
1117/// The parameters for `PaymentMethod::update`.
1118#[derive(Clone, Debug, Serialize, Default)]
1119pub struct UpdatePaymentMethod<'a> {
1120    /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
1121    #[serde(skip_serializing_if = "Option::is_none")]
1122    pub billing_details: Option<BillingDetails>,
1123
1124    /// If this is a `card` PaymentMethod, this hash contains the user's card details.
1125    #[serde(skip_serializing_if = "Option::is_none")]
1126    pub card: Option<UpdateApiParam>,
1127
1128    /// Specifies which fields in the response should be expanded.
1129    #[serde(skip_serializing_if = "Expand::is_empty")]
1130    pub expand: &'a [&'a str],
1131
1132    /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
1133    #[serde(skip_serializing_if = "Option::is_none")]
1134    pub link: Option<UpdatePaymentMethodLink>,
1135
1136    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1137    ///
1138    /// This can be useful for storing additional information about the object in a structured format.
1139    /// Individual keys can be unset by posting an empty value to them.
1140    /// All keys can be unset by posting an empty value to `metadata`.
1141    #[serde(skip_serializing_if = "Option::is_none")]
1142    pub metadata: Option<Metadata>,
1143
1144    /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.
1145    #[serde(skip_serializing_if = "Option::is_none")]
1146    pub us_bank_account: Option<UpdatePaymentMethodUsBankAccount>,
1147}
1148
1149impl<'a> UpdatePaymentMethod<'a> {
1150    pub fn new() -> Self {
1151        UpdatePaymentMethod {
1152            billing_details: Default::default(),
1153            card: Default::default(),
1154            expand: Default::default(),
1155            link: Default::default(),
1156            metadata: Default::default(),
1157            us_bank_account: Default::default(),
1158        }
1159    }
1160}
1161
1162#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1163pub struct CreatePaymentMethodAcssDebit {
1164    /// Customer's bank account number.
1165    pub account_number: String,
1166
1167    /// Institution number of the customer's bank.
1168    pub institution_number: String,
1169
1170    /// Transit number of the customer's bank.
1171    pub transit_number: String,
1172}
1173
1174#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1175pub struct CreatePaymentMethodAffirm {}
1176
1177#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1178pub struct CreatePaymentMethodAfterpayClearpay {}
1179
1180#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1181pub struct CreatePaymentMethodAlipay {}
1182
1183#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1184pub struct CreatePaymentMethodAuBecsDebit {
1185    /// The account number for the bank account.
1186    pub account_number: String,
1187
1188    /// Bank-State-Branch number of the bank account.
1189    pub bsb_number: String,
1190}
1191
1192#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1193pub struct CreatePaymentMethodBacsDebit {
1194    /// Account number of the bank account that the funds will be debited from.
1195    #[serde(skip_serializing_if = "Option::is_none")]
1196    pub account_number: Option<String>,
1197
1198    /// Sort code of the bank account.
1199    ///
1200    /// (e.g., `10-20-30`).
1201    #[serde(skip_serializing_if = "Option::is_none")]
1202    pub sort_code: Option<String>,
1203}
1204
1205#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1206pub struct CreatePaymentMethodBancontact {}
1207
1208#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1209pub struct CreatePaymentMethodBlik {}
1210
1211#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1212pub struct CreatePaymentMethodBoleto {
1213    /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers).
1214    pub tax_id: String,
1215}
1216
1217#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1218pub struct CreatePaymentMethodCashapp {}
1219
1220#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1221pub struct CreatePaymentMethodCustomerBalance {}
1222
1223#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1224pub struct CreatePaymentMethodEps {
1225    /// The customer's bank.
1226    #[serde(skip_serializing_if = "Option::is_none")]
1227    pub bank: Option<CreatePaymentMethodEpsBank>,
1228}
1229
1230#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1231pub struct CreatePaymentMethodFpx {
1232    /// Account holder type for FPX transaction.
1233    #[serde(skip_serializing_if = "Option::is_none")]
1234    pub account_holder_type: Option<CreatePaymentMethodFpxAccountHolderType>,
1235
1236    /// The customer's bank.
1237    pub bank: CreatePaymentMethodFpxBank,
1238}
1239
1240#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1241pub struct CreatePaymentMethodGiropay {}
1242
1243#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1244pub struct CreatePaymentMethodGrabpay {}
1245
1246#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1247pub struct CreatePaymentMethodIdeal {
1248    /// The customer's bank.
1249    #[serde(skip_serializing_if = "Option::is_none")]
1250    pub bank: Option<CreatePaymentMethodIdealBank>,
1251}
1252
1253#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1254pub struct CreatePaymentMethodInteracPresent {}
1255
1256#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1257pub struct CreatePaymentMethodKlarna {
1258    /// Customer's date of birth.
1259    #[serde(skip_serializing_if = "Option::is_none")]
1260    pub dob: Option<CreatePaymentMethodKlarnaDob>,
1261}
1262
1263#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1264pub struct CreatePaymentMethodKonbini {}
1265
1266#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1267pub struct CreatePaymentMethodLink {}
1268
1269#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1270pub struct CreatePaymentMethodOxxo {}
1271
1272#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1273pub struct CreatePaymentMethodP24 {
1274    /// The customer's bank.
1275    #[serde(skip_serializing_if = "Option::is_none")]
1276    pub bank: Option<CreatePaymentMethodP24Bank>,
1277}
1278
1279#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1280pub struct CreatePaymentMethodPaynow {}
1281
1282#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1283pub struct CreatePaymentMethodPaypal {}
1284
1285#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1286pub struct CreatePaymentMethodPix {}
1287
1288#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1289pub struct CreatePaymentMethodPromptpay {}
1290
1291#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1292pub struct CreatePaymentMethodRadarOptions {
1293    /// 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.
1294    #[serde(skip_serializing_if = "Option::is_none")]
1295    pub session: Option<String>,
1296}
1297
1298#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1299pub struct CreatePaymentMethodRevolutPay {}
1300
1301#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1302pub struct CreatePaymentMethodSepaDebit {
1303    /// IBAN of the bank account.
1304    pub iban: String,
1305}
1306
1307#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1308pub struct CreatePaymentMethodSofort {
1309    /// Two-letter ISO code representing the country the bank account is located in.
1310    pub country: CreatePaymentMethodSofortCountry,
1311}
1312
1313#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1314pub struct CreatePaymentMethodSwish {}
1315
1316#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1317pub struct CreatePaymentMethodUsBankAccount {
1318    /// Account holder type: individual or company.
1319    #[serde(skip_serializing_if = "Option::is_none")]
1320    pub account_holder_type: Option<CreatePaymentMethodUsBankAccountAccountHolderType>,
1321
1322    /// Account number of the bank account.
1323    #[serde(skip_serializing_if = "Option::is_none")]
1324    pub account_number: Option<String>,
1325
1326    /// Account type: checkings or savings.
1327    ///
1328    /// Defaults to checking if omitted.
1329    #[serde(skip_serializing_if = "Option::is_none")]
1330    pub account_type: Option<CreatePaymentMethodUsBankAccountAccountType>,
1331
1332    /// The ID of a Financial Connections Account to use as a payment method.
1333    #[serde(skip_serializing_if = "Option::is_none")]
1334    pub financial_connections_account: Option<String>,
1335
1336    /// Routing number of the bank account.
1337    #[serde(skip_serializing_if = "Option::is_none")]
1338    pub routing_number: Option<String>,
1339}
1340
1341#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1342pub struct CreatePaymentMethodWechatPay {}
1343
1344#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1345pub struct CreatePaymentMethodZip {}
1346
1347#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1348pub struct UpdatePaymentMethodLink {}
1349
1350#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1351pub struct UpdatePaymentMethodUsBankAccount {
1352    /// Bank account holder type.
1353    #[serde(skip_serializing_if = "Option::is_none")]
1354    pub account_holder_type: Option<UpdatePaymentMethodUsBankAccountAccountHolderType>,
1355
1356    /// Bank account type.
1357    #[serde(skip_serializing_if = "Option::is_none")]
1358    pub account_type: Option<UpdatePaymentMethodUsBankAccountAccountType>,
1359}
1360
1361#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1362pub struct CreatePaymentMethodKlarnaDob {
1363    /// The day of birth, between 1 and 31.
1364    pub day: i64,
1365
1366    /// The month of birth, between 1 and 12.
1367    pub month: i64,
1368
1369    /// The four-digit year of birth.
1370    pub year: i64,
1371}
1372
1373/// An enum representing the possible values of an `CardPresent`'s `read_method` field.
1374#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1375#[serde(rename_all = "snake_case")]
1376pub enum CardPresentReadMethod {
1377    ContactEmv,
1378    ContactlessEmv,
1379    ContactlessMagstripeMode,
1380    MagneticStripeFallback,
1381    MagneticStripeTrack2,
1382}
1383
1384impl CardPresentReadMethod {
1385    pub fn as_str(self) -> &'static str {
1386        match self {
1387            CardPresentReadMethod::ContactEmv => "contact_emv",
1388            CardPresentReadMethod::ContactlessEmv => "contactless_emv",
1389            CardPresentReadMethod::ContactlessMagstripeMode => "contactless_magstripe_mode",
1390            CardPresentReadMethod::MagneticStripeFallback => "magnetic_stripe_fallback",
1391            CardPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2",
1392        }
1393    }
1394}
1395
1396impl AsRef<str> for CardPresentReadMethod {
1397    fn as_ref(&self) -> &str {
1398        self.as_str()
1399    }
1400}
1401
1402impl std::fmt::Display for CardPresentReadMethod {
1403    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1404        self.as_str().fmt(f)
1405    }
1406}
1407impl std::default::Default for CardPresentReadMethod {
1408    fn default() -> Self {
1409        Self::ContactEmv
1410    }
1411}
1412
1413/// An enum representing the possible values of an `CreatePaymentMethodEps`'s `bank` field.
1414#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1415#[serde(rename_all = "snake_case")]
1416pub enum CreatePaymentMethodEpsBank {
1417    ArzteUndApothekerBank,
1418    AustrianAnadiBankAg,
1419    BankAustria,
1420    BankhausCarlSpangler,
1421    BankhausSchelhammerUndSchatteraAg,
1422    BawagPskAg,
1423    BksBankAg,
1424    BrullKallmusBankAg,
1425    BtvVierLanderBank,
1426    CapitalBankGraweGruppeAg,
1427    DeutscheBankAg,
1428    Dolomitenbank,
1429    EasybankAg,
1430    ErsteBankUndSparkassen,
1431    HypoAlpeadriabankInternationalAg,
1432    HypoBankBurgenlandAktiengesellschaft,
1433    HypoNoeLbFurNiederosterreichUWien,
1434    HypoOberosterreichSalzburgSteiermark,
1435    HypoTirolBankAg,
1436    HypoVorarlbergBankAg,
1437    MarchfelderBank,
1438    OberbankAg,
1439    RaiffeisenBankengruppeOsterreich,
1440    SchoellerbankAg,
1441    SpardaBankWien,
1442    VolksbankGruppe,
1443    VolkskreditbankAg,
1444    VrBankBraunau,
1445}
1446
1447impl CreatePaymentMethodEpsBank {
1448    pub fn as_str(self) -> &'static str {
1449        match self {
1450            CreatePaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1451            CreatePaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1452            CreatePaymentMethodEpsBank::BankAustria => "bank_austria",
1453            CreatePaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler",
1454            CreatePaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => {
1455                "bankhaus_schelhammer_und_schattera_ag"
1456            }
1457            CreatePaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag",
1458            CreatePaymentMethodEpsBank::BksBankAg => "bks_bank_ag",
1459            CreatePaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag",
1460            CreatePaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank",
1461            CreatePaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1462            CreatePaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag",
1463            CreatePaymentMethodEpsBank::Dolomitenbank => "dolomitenbank",
1464            CreatePaymentMethodEpsBank::EasybankAg => "easybank_ag",
1465            CreatePaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1466            CreatePaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => {
1467                "hypo_alpeadriabank_international_ag"
1468            }
1469            CreatePaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => {
1470                "hypo_bank_burgenland_aktiengesellschaft"
1471            }
1472            CreatePaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => {
1473                "hypo_noe_lb_fur_niederosterreich_u_wien"
1474            }
1475            CreatePaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => {
1476                "hypo_oberosterreich_salzburg_steiermark"
1477            }
1478            CreatePaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag",
1479            CreatePaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1480            CreatePaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank",
1481            CreatePaymentMethodEpsBank::OberbankAg => "oberbank_ag",
1482            CreatePaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => {
1483                "raiffeisen_bankengruppe_osterreich"
1484            }
1485            CreatePaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag",
1486            CreatePaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien",
1487            CreatePaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe",
1488            CreatePaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag",
1489            CreatePaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau",
1490        }
1491    }
1492}
1493
1494impl AsRef<str> for CreatePaymentMethodEpsBank {
1495    fn as_ref(&self) -> &str {
1496        self.as_str()
1497    }
1498}
1499
1500impl std::fmt::Display for CreatePaymentMethodEpsBank {
1501    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1502        self.as_str().fmt(f)
1503    }
1504}
1505impl std::default::Default for CreatePaymentMethodEpsBank {
1506    fn default() -> Self {
1507        Self::ArzteUndApothekerBank
1508    }
1509}
1510
1511/// An enum representing the possible values of an `CreatePaymentMethodFpx`'s `account_holder_type` field.
1512#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1513#[serde(rename_all = "snake_case")]
1514pub enum CreatePaymentMethodFpxAccountHolderType {
1515    Company,
1516    Individual,
1517}
1518
1519impl CreatePaymentMethodFpxAccountHolderType {
1520    pub fn as_str(self) -> &'static str {
1521        match self {
1522            CreatePaymentMethodFpxAccountHolderType::Company => "company",
1523            CreatePaymentMethodFpxAccountHolderType::Individual => "individual",
1524        }
1525    }
1526}
1527
1528impl AsRef<str> for CreatePaymentMethodFpxAccountHolderType {
1529    fn as_ref(&self) -> &str {
1530        self.as_str()
1531    }
1532}
1533
1534impl std::fmt::Display for CreatePaymentMethodFpxAccountHolderType {
1535    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1536        self.as_str().fmt(f)
1537    }
1538}
1539impl std::default::Default for CreatePaymentMethodFpxAccountHolderType {
1540    fn default() -> Self {
1541        Self::Company
1542    }
1543}
1544
1545/// An enum representing the possible values of an `CreatePaymentMethodFpx`'s `bank` field.
1546#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1547#[serde(rename_all = "snake_case")]
1548pub enum CreatePaymentMethodFpxBank {
1549    AffinBank,
1550    Agrobank,
1551    AllianceBank,
1552    Ambank,
1553    BankIslam,
1554    BankMuamalat,
1555    BankOfChina,
1556    BankRakyat,
1557    Bsn,
1558    Cimb,
1559    DeutscheBank,
1560    HongLeongBank,
1561    Hsbc,
1562    Kfh,
1563    Maybank2e,
1564    Maybank2u,
1565    Ocbc,
1566    PbEnterprise,
1567    PublicBank,
1568    Rhb,
1569    StandardChartered,
1570    Uob,
1571}
1572
1573impl CreatePaymentMethodFpxBank {
1574    pub fn as_str(self) -> &'static str {
1575        match self {
1576            CreatePaymentMethodFpxBank::AffinBank => "affin_bank",
1577            CreatePaymentMethodFpxBank::Agrobank => "agrobank",
1578            CreatePaymentMethodFpxBank::AllianceBank => "alliance_bank",
1579            CreatePaymentMethodFpxBank::Ambank => "ambank",
1580            CreatePaymentMethodFpxBank::BankIslam => "bank_islam",
1581            CreatePaymentMethodFpxBank::BankMuamalat => "bank_muamalat",
1582            CreatePaymentMethodFpxBank::BankOfChina => "bank_of_china",
1583            CreatePaymentMethodFpxBank::BankRakyat => "bank_rakyat",
1584            CreatePaymentMethodFpxBank::Bsn => "bsn",
1585            CreatePaymentMethodFpxBank::Cimb => "cimb",
1586            CreatePaymentMethodFpxBank::DeutscheBank => "deutsche_bank",
1587            CreatePaymentMethodFpxBank::HongLeongBank => "hong_leong_bank",
1588            CreatePaymentMethodFpxBank::Hsbc => "hsbc",
1589            CreatePaymentMethodFpxBank::Kfh => "kfh",
1590            CreatePaymentMethodFpxBank::Maybank2e => "maybank2e",
1591            CreatePaymentMethodFpxBank::Maybank2u => "maybank2u",
1592            CreatePaymentMethodFpxBank::Ocbc => "ocbc",
1593            CreatePaymentMethodFpxBank::PbEnterprise => "pb_enterprise",
1594            CreatePaymentMethodFpxBank::PublicBank => "public_bank",
1595            CreatePaymentMethodFpxBank::Rhb => "rhb",
1596            CreatePaymentMethodFpxBank::StandardChartered => "standard_chartered",
1597            CreatePaymentMethodFpxBank::Uob => "uob",
1598        }
1599    }
1600}
1601
1602impl AsRef<str> for CreatePaymentMethodFpxBank {
1603    fn as_ref(&self) -> &str {
1604        self.as_str()
1605    }
1606}
1607
1608impl std::fmt::Display for CreatePaymentMethodFpxBank {
1609    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1610        self.as_str().fmt(f)
1611    }
1612}
1613impl std::default::Default for CreatePaymentMethodFpxBank {
1614    fn default() -> Self {
1615        Self::AffinBank
1616    }
1617}
1618
1619/// An enum representing the possible values of an `CreatePaymentMethodIdeal`'s `bank` field.
1620#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1621#[serde(rename_all = "snake_case")]
1622pub enum CreatePaymentMethodIdealBank {
1623    AbnAmro,
1624    AsnBank,
1625    Bunq,
1626    Handelsbanken,
1627    Ing,
1628    Knab,
1629    Moneyou,
1630    N26,
1631    Nn,
1632    Rabobank,
1633    Regiobank,
1634    Revolut,
1635    SnsBank,
1636    TriodosBank,
1637    VanLanschot,
1638    Yoursafe,
1639}
1640
1641impl CreatePaymentMethodIdealBank {
1642    pub fn as_str(self) -> &'static str {
1643        match self {
1644            CreatePaymentMethodIdealBank::AbnAmro => "abn_amro",
1645            CreatePaymentMethodIdealBank::AsnBank => "asn_bank",
1646            CreatePaymentMethodIdealBank::Bunq => "bunq",
1647            CreatePaymentMethodIdealBank::Handelsbanken => "handelsbanken",
1648            CreatePaymentMethodIdealBank::Ing => "ing",
1649            CreatePaymentMethodIdealBank::Knab => "knab",
1650            CreatePaymentMethodIdealBank::Moneyou => "moneyou",
1651            CreatePaymentMethodIdealBank::N26 => "n26",
1652            CreatePaymentMethodIdealBank::Nn => "nn",
1653            CreatePaymentMethodIdealBank::Rabobank => "rabobank",
1654            CreatePaymentMethodIdealBank::Regiobank => "regiobank",
1655            CreatePaymentMethodIdealBank::Revolut => "revolut",
1656            CreatePaymentMethodIdealBank::SnsBank => "sns_bank",
1657            CreatePaymentMethodIdealBank::TriodosBank => "triodos_bank",
1658            CreatePaymentMethodIdealBank::VanLanschot => "van_lanschot",
1659            CreatePaymentMethodIdealBank::Yoursafe => "yoursafe",
1660        }
1661    }
1662}
1663
1664impl AsRef<str> for CreatePaymentMethodIdealBank {
1665    fn as_ref(&self) -> &str {
1666        self.as_str()
1667    }
1668}
1669
1670impl std::fmt::Display for CreatePaymentMethodIdealBank {
1671    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1672        self.as_str().fmt(f)
1673    }
1674}
1675impl std::default::Default for CreatePaymentMethodIdealBank {
1676    fn default() -> Self {
1677        Self::AbnAmro
1678    }
1679}
1680
1681/// An enum representing the possible values of an `CreatePaymentMethodP24`'s `bank` field.
1682#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1683#[serde(rename_all = "snake_case")]
1684pub enum CreatePaymentMethodP24Bank {
1685    AliorBank,
1686    BankMillennium,
1687    BankNowyBfgSa,
1688    BankPekaoSa,
1689    BankiSpbdzielcze,
1690    Blik,
1691    BnpParibas,
1692    Boz,
1693    CitiHandlowy,
1694    CreditAgricole,
1695    Envelobank,
1696    EtransferPocztowy24,
1697    GetinBank,
1698    Ideabank,
1699    Ing,
1700    Inteligo,
1701    MbankMtransfer,
1702    NestPrzelew,
1703    NoblePay,
1704    PbacZIpko,
1705    PlusBank,
1706    SantanderPrzelew24,
1707    TmobileUsbugiBankowe,
1708    ToyotaBank,
1709    Velobank,
1710    VolkswagenBank,
1711}
1712
1713impl CreatePaymentMethodP24Bank {
1714    pub fn as_str(self) -> &'static str {
1715        match self {
1716            CreatePaymentMethodP24Bank::AliorBank => "alior_bank",
1717            CreatePaymentMethodP24Bank::BankMillennium => "bank_millennium",
1718            CreatePaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa",
1719            CreatePaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa",
1720            CreatePaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze",
1721            CreatePaymentMethodP24Bank::Blik => "blik",
1722            CreatePaymentMethodP24Bank::BnpParibas => "bnp_paribas",
1723            CreatePaymentMethodP24Bank::Boz => "boz",
1724            CreatePaymentMethodP24Bank::CitiHandlowy => "citi_handlowy",
1725            CreatePaymentMethodP24Bank::CreditAgricole => "credit_agricole",
1726            CreatePaymentMethodP24Bank::Envelobank => "envelobank",
1727            CreatePaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24",
1728            CreatePaymentMethodP24Bank::GetinBank => "getin_bank",
1729            CreatePaymentMethodP24Bank::Ideabank => "ideabank",
1730            CreatePaymentMethodP24Bank::Ing => "ing",
1731            CreatePaymentMethodP24Bank::Inteligo => "inteligo",
1732            CreatePaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer",
1733            CreatePaymentMethodP24Bank::NestPrzelew => "nest_przelew",
1734            CreatePaymentMethodP24Bank::NoblePay => "noble_pay",
1735            CreatePaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko",
1736            CreatePaymentMethodP24Bank::PlusBank => "plus_bank",
1737            CreatePaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24",
1738            CreatePaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
1739            CreatePaymentMethodP24Bank::ToyotaBank => "toyota_bank",
1740            CreatePaymentMethodP24Bank::Velobank => "velobank",
1741            CreatePaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank",
1742        }
1743    }
1744}
1745
1746impl AsRef<str> for CreatePaymentMethodP24Bank {
1747    fn as_ref(&self) -> &str {
1748        self.as_str()
1749    }
1750}
1751
1752impl std::fmt::Display for CreatePaymentMethodP24Bank {
1753    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1754        self.as_str().fmt(f)
1755    }
1756}
1757impl std::default::Default for CreatePaymentMethodP24Bank {
1758    fn default() -> Self {
1759        Self::AliorBank
1760    }
1761}
1762
1763/// An enum representing the possible values of an `CreatePaymentMethodSofort`'s `country` field.
1764#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1765#[serde(rename_all = "snake_case")]
1766pub enum CreatePaymentMethodSofortCountry {
1767    #[serde(rename = "AT")]
1768    At,
1769    #[serde(rename = "BE")]
1770    Be,
1771    #[serde(rename = "DE")]
1772    De,
1773    #[serde(rename = "ES")]
1774    Es,
1775    #[serde(rename = "IT")]
1776    It,
1777    #[serde(rename = "NL")]
1778    Nl,
1779}
1780
1781impl CreatePaymentMethodSofortCountry {
1782    pub fn as_str(self) -> &'static str {
1783        match self {
1784            CreatePaymentMethodSofortCountry::At => "AT",
1785            CreatePaymentMethodSofortCountry::Be => "BE",
1786            CreatePaymentMethodSofortCountry::De => "DE",
1787            CreatePaymentMethodSofortCountry::Es => "ES",
1788            CreatePaymentMethodSofortCountry::It => "IT",
1789            CreatePaymentMethodSofortCountry::Nl => "NL",
1790        }
1791    }
1792}
1793
1794impl AsRef<str> for CreatePaymentMethodSofortCountry {
1795    fn as_ref(&self) -> &str {
1796        self.as_str()
1797    }
1798}
1799
1800impl std::fmt::Display for CreatePaymentMethodSofortCountry {
1801    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1802        self.as_str().fmt(f)
1803    }
1804}
1805impl std::default::Default for CreatePaymentMethodSofortCountry {
1806    fn default() -> Self {
1807        Self::At
1808    }
1809}
1810
1811/// An enum representing the possible values of an `CreatePaymentMethodUsBankAccount`'s `account_holder_type` field.
1812#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1813#[serde(rename_all = "snake_case")]
1814pub enum CreatePaymentMethodUsBankAccountAccountHolderType {
1815    Company,
1816    Individual,
1817}
1818
1819impl CreatePaymentMethodUsBankAccountAccountHolderType {
1820    pub fn as_str(self) -> &'static str {
1821        match self {
1822            CreatePaymentMethodUsBankAccountAccountHolderType::Company => "company",
1823            CreatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual",
1824        }
1825    }
1826}
1827
1828impl AsRef<str> for CreatePaymentMethodUsBankAccountAccountHolderType {
1829    fn as_ref(&self) -> &str {
1830        self.as_str()
1831    }
1832}
1833
1834impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountHolderType {
1835    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1836        self.as_str().fmt(f)
1837    }
1838}
1839impl std::default::Default for CreatePaymentMethodUsBankAccountAccountHolderType {
1840    fn default() -> Self {
1841        Self::Company
1842    }
1843}
1844
1845/// An enum representing the possible values of an `CreatePaymentMethodUsBankAccount`'s `account_type` field.
1846#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1847#[serde(rename_all = "snake_case")]
1848pub enum CreatePaymentMethodUsBankAccountAccountType {
1849    Checking,
1850    Savings,
1851}
1852
1853impl CreatePaymentMethodUsBankAccountAccountType {
1854    pub fn as_str(self) -> &'static str {
1855        match self {
1856            CreatePaymentMethodUsBankAccountAccountType::Checking => "checking",
1857            CreatePaymentMethodUsBankAccountAccountType::Savings => "savings",
1858        }
1859    }
1860}
1861
1862impl AsRef<str> for CreatePaymentMethodUsBankAccountAccountType {
1863    fn as_ref(&self) -> &str {
1864        self.as_str()
1865    }
1866}
1867
1868impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType {
1869    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1870        self.as_str().fmt(f)
1871    }
1872}
1873impl std::default::Default for CreatePaymentMethodUsBankAccountAccountType {
1874    fn default() -> Self {
1875        Self::Checking
1876    }
1877}
1878
1879/// An enum representing the possible values of an `PaymentMethodEps`'s `bank` field.
1880#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1881#[serde(rename_all = "snake_case")]
1882pub enum PaymentMethodEpsBank {
1883    ArzteUndApothekerBank,
1884    AustrianAnadiBankAg,
1885    BankAustria,
1886    BankhausCarlSpangler,
1887    BankhausSchelhammerUndSchatteraAg,
1888    BawagPskAg,
1889    BksBankAg,
1890    BrullKallmusBankAg,
1891    BtvVierLanderBank,
1892    CapitalBankGraweGruppeAg,
1893    DeutscheBankAg,
1894    Dolomitenbank,
1895    EasybankAg,
1896    ErsteBankUndSparkassen,
1897    HypoAlpeadriabankInternationalAg,
1898    HypoBankBurgenlandAktiengesellschaft,
1899    HypoNoeLbFurNiederosterreichUWien,
1900    HypoOberosterreichSalzburgSteiermark,
1901    HypoTirolBankAg,
1902    HypoVorarlbergBankAg,
1903    MarchfelderBank,
1904    OberbankAg,
1905    RaiffeisenBankengruppeOsterreich,
1906    SchoellerbankAg,
1907    SpardaBankWien,
1908    VolksbankGruppe,
1909    VolkskreditbankAg,
1910    VrBankBraunau,
1911}
1912
1913impl PaymentMethodEpsBank {
1914    pub fn as_str(self) -> &'static str {
1915        match self {
1916            PaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank",
1917            PaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag",
1918            PaymentMethodEpsBank::BankAustria => "bank_austria",
1919            PaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler",
1920            PaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => {
1921                "bankhaus_schelhammer_und_schattera_ag"
1922            }
1923            PaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag",
1924            PaymentMethodEpsBank::BksBankAg => "bks_bank_ag",
1925            PaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag",
1926            PaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank",
1927            PaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
1928            PaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag",
1929            PaymentMethodEpsBank::Dolomitenbank => "dolomitenbank",
1930            PaymentMethodEpsBank::EasybankAg => "easybank_ag",
1931            PaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
1932            PaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => {
1933                "hypo_alpeadriabank_international_ag"
1934            }
1935            PaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => {
1936                "hypo_bank_burgenland_aktiengesellschaft"
1937            }
1938            PaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => {
1939                "hypo_noe_lb_fur_niederosterreich_u_wien"
1940            }
1941            PaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => {
1942                "hypo_oberosterreich_salzburg_steiermark"
1943            }
1944            PaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag",
1945            PaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
1946            PaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank",
1947            PaymentMethodEpsBank::OberbankAg => "oberbank_ag",
1948            PaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => {
1949                "raiffeisen_bankengruppe_osterreich"
1950            }
1951            PaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag",
1952            PaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien",
1953            PaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe",
1954            PaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag",
1955            PaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau",
1956        }
1957    }
1958}
1959
1960impl AsRef<str> for PaymentMethodEpsBank {
1961    fn as_ref(&self) -> &str {
1962        self.as_str()
1963    }
1964}
1965
1966impl std::fmt::Display for PaymentMethodEpsBank {
1967    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1968        self.as_str().fmt(f)
1969    }
1970}
1971impl std::default::Default for PaymentMethodEpsBank {
1972    fn default() -> Self {
1973        Self::ArzteUndApothekerBank
1974    }
1975}
1976
1977/// An enum representing the possible values of an `PaymentMethodFpx`'s `account_holder_type` field.
1978#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1979#[serde(rename_all = "snake_case")]
1980pub enum PaymentMethodFpxAccountHolderType {
1981    Company,
1982    Individual,
1983}
1984
1985impl PaymentMethodFpxAccountHolderType {
1986    pub fn as_str(self) -> &'static str {
1987        match self {
1988            PaymentMethodFpxAccountHolderType::Company => "company",
1989            PaymentMethodFpxAccountHolderType::Individual => "individual",
1990        }
1991    }
1992}
1993
1994impl AsRef<str> for PaymentMethodFpxAccountHolderType {
1995    fn as_ref(&self) -> &str {
1996        self.as_str()
1997    }
1998}
1999
2000impl std::fmt::Display for PaymentMethodFpxAccountHolderType {
2001    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2002        self.as_str().fmt(f)
2003    }
2004}
2005impl std::default::Default for PaymentMethodFpxAccountHolderType {
2006    fn default() -> Self {
2007        Self::Company
2008    }
2009}
2010
2011/// An enum representing the possible values of an `PaymentMethodFpx`'s `bank` field.
2012#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2013#[serde(rename_all = "snake_case")]
2014pub enum PaymentMethodFpxBank {
2015    AffinBank,
2016    Agrobank,
2017    AllianceBank,
2018    Ambank,
2019    BankIslam,
2020    BankMuamalat,
2021    BankOfChina,
2022    BankRakyat,
2023    Bsn,
2024    Cimb,
2025    DeutscheBank,
2026    HongLeongBank,
2027    Hsbc,
2028    Kfh,
2029    Maybank2e,
2030    Maybank2u,
2031    Ocbc,
2032    PbEnterprise,
2033    PublicBank,
2034    Rhb,
2035    StandardChartered,
2036    Uob,
2037}
2038
2039impl PaymentMethodFpxBank {
2040    pub fn as_str(self) -> &'static str {
2041        match self {
2042            PaymentMethodFpxBank::AffinBank => "affin_bank",
2043            PaymentMethodFpxBank::Agrobank => "agrobank",
2044            PaymentMethodFpxBank::AllianceBank => "alliance_bank",
2045            PaymentMethodFpxBank::Ambank => "ambank",
2046            PaymentMethodFpxBank::BankIslam => "bank_islam",
2047            PaymentMethodFpxBank::BankMuamalat => "bank_muamalat",
2048            PaymentMethodFpxBank::BankOfChina => "bank_of_china",
2049            PaymentMethodFpxBank::BankRakyat => "bank_rakyat",
2050            PaymentMethodFpxBank::Bsn => "bsn",
2051            PaymentMethodFpxBank::Cimb => "cimb",
2052            PaymentMethodFpxBank::DeutscheBank => "deutsche_bank",
2053            PaymentMethodFpxBank::HongLeongBank => "hong_leong_bank",
2054            PaymentMethodFpxBank::Hsbc => "hsbc",
2055            PaymentMethodFpxBank::Kfh => "kfh",
2056            PaymentMethodFpxBank::Maybank2e => "maybank2e",
2057            PaymentMethodFpxBank::Maybank2u => "maybank2u",
2058            PaymentMethodFpxBank::Ocbc => "ocbc",
2059            PaymentMethodFpxBank::PbEnterprise => "pb_enterprise",
2060            PaymentMethodFpxBank::PublicBank => "public_bank",
2061            PaymentMethodFpxBank::Rhb => "rhb",
2062            PaymentMethodFpxBank::StandardChartered => "standard_chartered",
2063            PaymentMethodFpxBank::Uob => "uob",
2064        }
2065    }
2066}
2067
2068impl AsRef<str> for PaymentMethodFpxBank {
2069    fn as_ref(&self) -> &str {
2070        self.as_str()
2071    }
2072}
2073
2074impl std::fmt::Display for PaymentMethodFpxBank {
2075    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2076        self.as_str().fmt(f)
2077    }
2078}
2079impl std::default::Default for PaymentMethodFpxBank {
2080    fn default() -> Self {
2081        Self::AffinBank
2082    }
2083}
2084
2085/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bank` field.
2086#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2087#[serde(rename_all = "snake_case")]
2088pub enum PaymentMethodIdealBank {
2089    AbnAmro,
2090    AsnBank,
2091    Bunq,
2092    Handelsbanken,
2093    Ing,
2094    Knab,
2095    Moneyou,
2096    N26,
2097    Nn,
2098    Rabobank,
2099    Regiobank,
2100    Revolut,
2101    SnsBank,
2102    TriodosBank,
2103    VanLanschot,
2104    Yoursafe,
2105}
2106
2107impl PaymentMethodIdealBank {
2108    pub fn as_str(self) -> &'static str {
2109        match self {
2110            PaymentMethodIdealBank::AbnAmro => "abn_amro",
2111            PaymentMethodIdealBank::AsnBank => "asn_bank",
2112            PaymentMethodIdealBank::Bunq => "bunq",
2113            PaymentMethodIdealBank::Handelsbanken => "handelsbanken",
2114            PaymentMethodIdealBank::Ing => "ing",
2115            PaymentMethodIdealBank::Knab => "knab",
2116            PaymentMethodIdealBank::Moneyou => "moneyou",
2117            PaymentMethodIdealBank::N26 => "n26",
2118            PaymentMethodIdealBank::Nn => "nn",
2119            PaymentMethodIdealBank::Rabobank => "rabobank",
2120            PaymentMethodIdealBank::Regiobank => "regiobank",
2121            PaymentMethodIdealBank::Revolut => "revolut",
2122            PaymentMethodIdealBank::SnsBank => "sns_bank",
2123            PaymentMethodIdealBank::TriodosBank => "triodos_bank",
2124            PaymentMethodIdealBank::VanLanschot => "van_lanschot",
2125            PaymentMethodIdealBank::Yoursafe => "yoursafe",
2126        }
2127    }
2128}
2129
2130impl AsRef<str> for PaymentMethodIdealBank {
2131    fn as_ref(&self) -> &str {
2132        self.as_str()
2133    }
2134}
2135
2136impl std::fmt::Display for PaymentMethodIdealBank {
2137    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2138        self.as_str().fmt(f)
2139    }
2140}
2141impl std::default::Default for PaymentMethodIdealBank {
2142    fn default() -> Self {
2143        Self::AbnAmro
2144    }
2145}
2146
2147/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bic` field.
2148#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2149#[serde(rename_all = "snake_case")]
2150pub enum PaymentMethodIdealBic {
2151    #[serde(rename = "ABNANL2A")]
2152    Abnanl2a,
2153    #[serde(rename = "ASNBNL21")]
2154    Asnbnl21,
2155    #[serde(rename = "BITSNL2A")]
2156    Bitsnl2a,
2157    #[serde(rename = "BUNQNL2A")]
2158    Bunqnl2a,
2159    #[serde(rename = "FVLBNL22")]
2160    Fvlbnl22,
2161    #[serde(rename = "HANDNL2A")]
2162    Handnl2a,
2163    #[serde(rename = "INGBNL2A")]
2164    Ingbnl2a,
2165    #[serde(rename = "KNABNL2H")]
2166    Knabnl2h,
2167    #[serde(rename = "MOYONL21")]
2168    Moyonl21,
2169    #[serde(rename = "NNBANL2G")]
2170    Nnbanl2g,
2171    #[serde(rename = "NTSBDEB1")]
2172    Ntsbdeb1,
2173    #[serde(rename = "RABONL2U")]
2174    Rabonl2u,
2175    #[serde(rename = "RBRBNL21")]
2176    Rbrbnl21,
2177    #[serde(rename = "REVOIE23")]
2178    Revoie23,
2179    #[serde(rename = "REVOLT21")]
2180    Revolt21,
2181    #[serde(rename = "SNSBNL2A")]
2182    Snsbnl2a,
2183    #[serde(rename = "TRIONL2U")]
2184    Trionl2u,
2185}
2186
2187impl PaymentMethodIdealBic {
2188    pub fn as_str(self) -> &'static str {
2189        match self {
2190            PaymentMethodIdealBic::Abnanl2a => "ABNANL2A",
2191            PaymentMethodIdealBic::Asnbnl21 => "ASNBNL21",
2192            PaymentMethodIdealBic::Bitsnl2a => "BITSNL2A",
2193            PaymentMethodIdealBic::Bunqnl2a => "BUNQNL2A",
2194            PaymentMethodIdealBic::Fvlbnl22 => "FVLBNL22",
2195            PaymentMethodIdealBic::Handnl2a => "HANDNL2A",
2196            PaymentMethodIdealBic::Ingbnl2a => "INGBNL2A",
2197            PaymentMethodIdealBic::Knabnl2h => "KNABNL2H",
2198            PaymentMethodIdealBic::Moyonl21 => "MOYONL21",
2199            PaymentMethodIdealBic::Nnbanl2g => "NNBANL2G",
2200            PaymentMethodIdealBic::Ntsbdeb1 => "NTSBDEB1",
2201            PaymentMethodIdealBic::Rabonl2u => "RABONL2U",
2202            PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21",
2203            PaymentMethodIdealBic::Revoie23 => "REVOIE23",
2204            PaymentMethodIdealBic::Revolt21 => "REVOLT21",
2205            PaymentMethodIdealBic::Snsbnl2a => "SNSBNL2A",
2206            PaymentMethodIdealBic::Trionl2u => "TRIONL2U",
2207        }
2208    }
2209}
2210
2211impl AsRef<str> for PaymentMethodIdealBic {
2212    fn as_ref(&self) -> &str {
2213        self.as_str()
2214    }
2215}
2216
2217impl std::fmt::Display for PaymentMethodIdealBic {
2218    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2219        self.as_str().fmt(f)
2220    }
2221}
2222impl std::default::Default for PaymentMethodIdealBic {
2223    fn default() -> Self {
2224        Self::Abnanl2a
2225    }
2226}
2227
2228/// An enum representing the possible values of an `PaymentMethodInteracPresent`'s `read_method` field.
2229#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2230#[serde(rename_all = "snake_case")]
2231pub enum PaymentMethodInteracPresentReadMethod {
2232    ContactEmv,
2233    ContactlessEmv,
2234    ContactlessMagstripeMode,
2235    MagneticStripeFallback,
2236    MagneticStripeTrack2,
2237}
2238
2239impl PaymentMethodInteracPresentReadMethod {
2240    pub fn as_str(self) -> &'static str {
2241        match self {
2242            PaymentMethodInteracPresentReadMethod::ContactEmv => "contact_emv",
2243            PaymentMethodInteracPresentReadMethod::ContactlessEmv => "contactless_emv",
2244            PaymentMethodInteracPresentReadMethod::ContactlessMagstripeMode => {
2245                "contactless_magstripe_mode"
2246            }
2247            PaymentMethodInteracPresentReadMethod::MagneticStripeFallback => {
2248                "magnetic_stripe_fallback"
2249            }
2250            PaymentMethodInteracPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2",
2251        }
2252    }
2253}
2254
2255impl AsRef<str> for PaymentMethodInteracPresentReadMethod {
2256    fn as_ref(&self) -> &str {
2257        self.as_str()
2258    }
2259}
2260
2261impl std::fmt::Display for PaymentMethodInteracPresentReadMethod {
2262    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2263        self.as_str().fmt(f)
2264    }
2265}
2266impl std::default::Default for PaymentMethodInteracPresentReadMethod {
2267    fn default() -> Self {
2268        Self::ContactEmv
2269    }
2270}
2271
2272/// An enum representing the possible values of an `PaymentMethodP24`'s `bank` field.
2273#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2274#[serde(rename_all = "snake_case")]
2275pub enum PaymentMethodP24Bank {
2276    AliorBank,
2277    BankMillennium,
2278    BankNowyBfgSa,
2279    BankPekaoSa,
2280    BankiSpbdzielcze,
2281    Blik,
2282    BnpParibas,
2283    Boz,
2284    CitiHandlowy,
2285    CreditAgricole,
2286    Envelobank,
2287    EtransferPocztowy24,
2288    GetinBank,
2289    Ideabank,
2290    Ing,
2291    Inteligo,
2292    MbankMtransfer,
2293    NestPrzelew,
2294    NoblePay,
2295    PbacZIpko,
2296    PlusBank,
2297    SantanderPrzelew24,
2298    TmobileUsbugiBankowe,
2299    ToyotaBank,
2300    Velobank,
2301    VolkswagenBank,
2302}
2303
2304impl PaymentMethodP24Bank {
2305    pub fn as_str(self) -> &'static str {
2306        match self {
2307            PaymentMethodP24Bank::AliorBank => "alior_bank",
2308            PaymentMethodP24Bank::BankMillennium => "bank_millennium",
2309            PaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa",
2310            PaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa",
2311            PaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze",
2312            PaymentMethodP24Bank::Blik => "blik",
2313            PaymentMethodP24Bank::BnpParibas => "bnp_paribas",
2314            PaymentMethodP24Bank::Boz => "boz",
2315            PaymentMethodP24Bank::CitiHandlowy => "citi_handlowy",
2316            PaymentMethodP24Bank::CreditAgricole => "credit_agricole",
2317            PaymentMethodP24Bank::Envelobank => "envelobank",
2318            PaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24",
2319            PaymentMethodP24Bank::GetinBank => "getin_bank",
2320            PaymentMethodP24Bank::Ideabank => "ideabank",
2321            PaymentMethodP24Bank::Ing => "ing",
2322            PaymentMethodP24Bank::Inteligo => "inteligo",
2323            PaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer",
2324            PaymentMethodP24Bank::NestPrzelew => "nest_przelew",
2325            PaymentMethodP24Bank::NoblePay => "noble_pay",
2326            PaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko",
2327            PaymentMethodP24Bank::PlusBank => "plus_bank",
2328            PaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24",
2329            PaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
2330            PaymentMethodP24Bank::ToyotaBank => "toyota_bank",
2331            PaymentMethodP24Bank::Velobank => "velobank",
2332            PaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank",
2333        }
2334    }
2335}
2336
2337impl AsRef<str> for PaymentMethodP24Bank {
2338    fn as_ref(&self) -> &str {
2339        self.as_str()
2340    }
2341}
2342
2343impl std::fmt::Display for PaymentMethodP24Bank {
2344    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2345        self.as_str().fmt(f)
2346    }
2347}
2348impl std::default::Default for PaymentMethodP24Bank {
2349    fn default() -> Self {
2350        Self::AliorBank
2351    }
2352}
2353
2354/// An enum representing the possible values of an `PaymentMethod`'s `type` field.
2355#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2356#[serde(rename_all = "snake_case")]
2357pub enum PaymentMethodType {
2358    AcssDebit,
2359    Affirm,
2360    AfterpayClearpay,
2361    Alipay,
2362    AuBecsDebit,
2363    BacsDebit,
2364    Bancontact,
2365    Blik,
2366    Boleto,
2367    Card,
2368    CardPresent,
2369    Cashapp,
2370    CustomerBalance,
2371    Eps,
2372    Fpx,
2373    Giropay,
2374    Grabpay,
2375    Ideal,
2376    InteracPresent,
2377    Klarna,
2378    Konbini,
2379    Link,
2380    Oxxo,
2381    P24,
2382    Paynow,
2383    Paypal,
2384    Pix,
2385    Promptpay,
2386    RevolutPay,
2387    SepaDebit,
2388    Sofort,
2389    Swish,
2390    UsBankAccount,
2391    WechatPay,
2392    Zip,
2393}
2394
2395impl PaymentMethodType {
2396    pub fn as_str(self) -> &'static str {
2397        match self {
2398            PaymentMethodType::AcssDebit => "acss_debit",
2399            PaymentMethodType::Affirm => "affirm",
2400            PaymentMethodType::AfterpayClearpay => "afterpay_clearpay",
2401            PaymentMethodType::Alipay => "alipay",
2402            PaymentMethodType::AuBecsDebit => "au_becs_debit",
2403            PaymentMethodType::BacsDebit => "bacs_debit",
2404            PaymentMethodType::Bancontact => "bancontact",
2405            PaymentMethodType::Blik => "blik",
2406            PaymentMethodType::Boleto => "boleto",
2407            PaymentMethodType::Card => "card",
2408            PaymentMethodType::CardPresent => "card_present",
2409            PaymentMethodType::Cashapp => "cashapp",
2410            PaymentMethodType::CustomerBalance => "customer_balance",
2411            PaymentMethodType::Eps => "eps",
2412            PaymentMethodType::Fpx => "fpx",
2413            PaymentMethodType::Giropay => "giropay",
2414            PaymentMethodType::Grabpay => "grabpay",
2415            PaymentMethodType::Ideal => "ideal",
2416            PaymentMethodType::InteracPresent => "interac_present",
2417            PaymentMethodType::Klarna => "klarna",
2418            PaymentMethodType::Konbini => "konbini",
2419            PaymentMethodType::Link => "link",
2420            PaymentMethodType::Oxxo => "oxxo",
2421            PaymentMethodType::P24 => "p24",
2422            PaymentMethodType::Paynow => "paynow",
2423            PaymentMethodType::Paypal => "paypal",
2424            PaymentMethodType::Pix => "pix",
2425            PaymentMethodType::Promptpay => "promptpay",
2426            PaymentMethodType::RevolutPay => "revolut_pay",
2427            PaymentMethodType::SepaDebit => "sepa_debit",
2428            PaymentMethodType::Sofort => "sofort",
2429            PaymentMethodType::Swish => "swish",
2430            PaymentMethodType::UsBankAccount => "us_bank_account",
2431            PaymentMethodType::WechatPay => "wechat_pay",
2432            PaymentMethodType::Zip => "zip",
2433        }
2434    }
2435}
2436
2437impl AsRef<str> for PaymentMethodType {
2438    fn as_ref(&self) -> &str {
2439        self.as_str()
2440    }
2441}
2442
2443impl std::fmt::Display for PaymentMethodType {
2444    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2445        self.as_str().fmt(f)
2446    }
2447}
2448impl std::default::Default for PaymentMethodType {
2449    fn default() -> Self {
2450        Self::AcssDebit
2451    }
2452}
2453
2454/// An enum representing the possible values of an `ListPaymentMethods`'s `type_` field.
2455#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2456#[serde(rename_all = "snake_case")]
2457pub enum PaymentMethodTypeFilter {
2458    AcssDebit,
2459    Affirm,
2460    AfterpayClearpay,
2461    Alipay,
2462    AuBecsDebit,
2463    BacsDebit,
2464    Bancontact,
2465    Blik,
2466    Boleto,
2467    Card,
2468    Cashapp,
2469    CustomerBalance,
2470    Eps,
2471    Fpx,
2472    Giropay,
2473    Grabpay,
2474    Ideal,
2475    Klarna,
2476    Konbini,
2477    Link,
2478    Oxxo,
2479    P24,
2480    Paynow,
2481    Paypal,
2482    Pix,
2483    Promptpay,
2484    RevolutPay,
2485    SepaDebit,
2486    Sofort,
2487    Swish,
2488    UsBankAccount,
2489    WechatPay,
2490    Zip,
2491}
2492
2493impl PaymentMethodTypeFilter {
2494    pub fn as_str(self) -> &'static str {
2495        match self {
2496            PaymentMethodTypeFilter::AcssDebit => "acss_debit",
2497            PaymentMethodTypeFilter::Affirm => "affirm",
2498            PaymentMethodTypeFilter::AfterpayClearpay => "afterpay_clearpay",
2499            PaymentMethodTypeFilter::Alipay => "alipay",
2500            PaymentMethodTypeFilter::AuBecsDebit => "au_becs_debit",
2501            PaymentMethodTypeFilter::BacsDebit => "bacs_debit",
2502            PaymentMethodTypeFilter::Bancontact => "bancontact",
2503            PaymentMethodTypeFilter::Blik => "blik",
2504            PaymentMethodTypeFilter::Boleto => "boleto",
2505            PaymentMethodTypeFilter::Card => "card",
2506            PaymentMethodTypeFilter::Cashapp => "cashapp",
2507            PaymentMethodTypeFilter::CustomerBalance => "customer_balance",
2508            PaymentMethodTypeFilter::Eps => "eps",
2509            PaymentMethodTypeFilter::Fpx => "fpx",
2510            PaymentMethodTypeFilter::Giropay => "giropay",
2511            PaymentMethodTypeFilter::Grabpay => "grabpay",
2512            PaymentMethodTypeFilter::Ideal => "ideal",
2513            PaymentMethodTypeFilter::Klarna => "klarna",
2514            PaymentMethodTypeFilter::Konbini => "konbini",
2515            PaymentMethodTypeFilter::Link => "link",
2516            PaymentMethodTypeFilter::Oxxo => "oxxo",
2517            PaymentMethodTypeFilter::P24 => "p24",
2518            PaymentMethodTypeFilter::Paynow => "paynow",
2519            PaymentMethodTypeFilter::Paypal => "paypal",
2520            PaymentMethodTypeFilter::Pix => "pix",
2521            PaymentMethodTypeFilter::Promptpay => "promptpay",
2522            PaymentMethodTypeFilter::RevolutPay => "revolut_pay",
2523            PaymentMethodTypeFilter::SepaDebit => "sepa_debit",
2524            PaymentMethodTypeFilter::Sofort => "sofort",
2525            PaymentMethodTypeFilter::Swish => "swish",
2526            PaymentMethodTypeFilter::UsBankAccount => "us_bank_account",
2527            PaymentMethodTypeFilter::WechatPay => "wechat_pay",
2528            PaymentMethodTypeFilter::Zip => "zip",
2529        }
2530    }
2531}
2532
2533impl AsRef<str> for PaymentMethodTypeFilter {
2534    fn as_ref(&self) -> &str {
2535        self.as_str()
2536    }
2537}
2538
2539impl std::fmt::Display for PaymentMethodTypeFilter {
2540    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2541        self.as_str().fmt(f)
2542    }
2543}
2544impl std::default::Default for PaymentMethodTypeFilter {
2545    fn default() -> Self {
2546        Self::AcssDebit
2547    }
2548}
2549
2550/// An enum representing the possible values of an `PaymentMethodUsBankAccount`'s `account_holder_type` field.
2551#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2552#[serde(rename_all = "snake_case")]
2553pub enum PaymentMethodUsBankAccountAccountHolderType {
2554    Company,
2555    Individual,
2556}
2557
2558impl PaymentMethodUsBankAccountAccountHolderType {
2559    pub fn as_str(self) -> &'static str {
2560        match self {
2561            PaymentMethodUsBankAccountAccountHolderType::Company => "company",
2562            PaymentMethodUsBankAccountAccountHolderType::Individual => "individual",
2563        }
2564    }
2565}
2566
2567impl AsRef<str> for PaymentMethodUsBankAccountAccountHolderType {
2568    fn as_ref(&self) -> &str {
2569        self.as_str()
2570    }
2571}
2572
2573impl std::fmt::Display for PaymentMethodUsBankAccountAccountHolderType {
2574    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2575        self.as_str().fmt(f)
2576    }
2577}
2578impl std::default::Default for PaymentMethodUsBankAccountAccountHolderType {
2579    fn default() -> Self {
2580        Self::Company
2581    }
2582}
2583
2584/// An enum representing the possible values of an `PaymentMethodUsBankAccount`'s `account_type` field.
2585#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2586#[serde(rename_all = "snake_case")]
2587pub enum PaymentMethodUsBankAccountAccountType {
2588    Checking,
2589    Savings,
2590}
2591
2592impl PaymentMethodUsBankAccountAccountType {
2593    pub fn as_str(self) -> &'static str {
2594        match self {
2595            PaymentMethodUsBankAccountAccountType::Checking => "checking",
2596            PaymentMethodUsBankAccountAccountType::Savings => "savings",
2597        }
2598    }
2599}
2600
2601impl AsRef<str> for PaymentMethodUsBankAccountAccountType {
2602    fn as_ref(&self) -> &str {
2603        self.as_str()
2604    }
2605}
2606
2607impl std::fmt::Display for PaymentMethodUsBankAccountAccountType {
2608    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2609        self.as_str().fmt(f)
2610    }
2611}
2612impl std::default::Default for PaymentMethodUsBankAccountAccountType {
2613    fn default() -> Self {
2614        Self::Checking
2615    }
2616}
2617
2618/// An enum representing the possible values of an `PaymentMethodUsBankAccountBlocked`'s `network_code` field.
2619#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2620#[serde(rename_all = "snake_case")]
2621pub enum PaymentMethodUsBankAccountBlockedNetworkCode {
2622    #[serde(rename = "R02")]
2623    R02,
2624    #[serde(rename = "R03")]
2625    R03,
2626    #[serde(rename = "R04")]
2627    R04,
2628    #[serde(rename = "R05")]
2629    R05,
2630    #[serde(rename = "R07")]
2631    R07,
2632    #[serde(rename = "R08")]
2633    R08,
2634    #[serde(rename = "R10")]
2635    R10,
2636    #[serde(rename = "R11")]
2637    R11,
2638    #[serde(rename = "R16")]
2639    R16,
2640    #[serde(rename = "R20")]
2641    R20,
2642    #[serde(rename = "R29")]
2643    R29,
2644    #[serde(rename = "R31")]
2645    R31,
2646}
2647
2648impl PaymentMethodUsBankAccountBlockedNetworkCode {
2649    pub fn as_str(self) -> &'static str {
2650        match self {
2651            PaymentMethodUsBankAccountBlockedNetworkCode::R02 => "R02",
2652            PaymentMethodUsBankAccountBlockedNetworkCode::R03 => "R03",
2653            PaymentMethodUsBankAccountBlockedNetworkCode::R04 => "R04",
2654            PaymentMethodUsBankAccountBlockedNetworkCode::R05 => "R05",
2655            PaymentMethodUsBankAccountBlockedNetworkCode::R07 => "R07",
2656            PaymentMethodUsBankAccountBlockedNetworkCode::R08 => "R08",
2657            PaymentMethodUsBankAccountBlockedNetworkCode::R10 => "R10",
2658            PaymentMethodUsBankAccountBlockedNetworkCode::R11 => "R11",
2659            PaymentMethodUsBankAccountBlockedNetworkCode::R16 => "R16",
2660            PaymentMethodUsBankAccountBlockedNetworkCode::R20 => "R20",
2661            PaymentMethodUsBankAccountBlockedNetworkCode::R29 => "R29",
2662            PaymentMethodUsBankAccountBlockedNetworkCode::R31 => "R31",
2663        }
2664    }
2665}
2666
2667impl AsRef<str> for PaymentMethodUsBankAccountBlockedNetworkCode {
2668    fn as_ref(&self) -> &str {
2669        self.as_str()
2670    }
2671}
2672
2673impl std::fmt::Display for PaymentMethodUsBankAccountBlockedNetworkCode {
2674    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2675        self.as_str().fmt(f)
2676    }
2677}
2678impl std::default::Default for PaymentMethodUsBankAccountBlockedNetworkCode {
2679    fn default() -> Self {
2680        Self::R02
2681    }
2682}
2683
2684/// An enum representing the possible values of an `PaymentMethodUsBankAccountBlocked`'s `reason` field.
2685#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2686#[serde(rename_all = "snake_case")]
2687pub enum PaymentMethodUsBankAccountBlockedReason {
2688    BankAccountClosed,
2689    BankAccountFrozen,
2690    BankAccountInvalidDetails,
2691    BankAccountRestricted,
2692    BankAccountUnusable,
2693    DebitNotAuthorized,
2694}
2695
2696impl PaymentMethodUsBankAccountBlockedReason {
2697    pub fn as_str(self) -> &'static str {
2698        match self {
2699            PaymentMethodUsBankAccountBlockedReason::BankAccountClosed => "bank_account_closed",
2700            PaymentMethodUsBankAccountBlockedReason::BankAccountFrozen => "bank_account_frozen",
2701            PaymentMethodUsBankAccountBlockedReason::BankAccountInvalidDetails => {
2702                "bank_account_invalid_details"
2703            }
2704            PaymentMethodUsBankAccountBlockedReason::BankAccountRestricted => {
2705                "bank_account_restricted"
2706            }
2707            PaymentMethodUsBankAccountBlockedReason::BankAccountUnusable => "bank_account_unusable",
2708            PaymentMethodUsBankAccountBlockedReason::DebitNotAuthorized => "debit_not_authorized",
2709        }
2710    }
2711}
2712
2713impl AsRef<str> for PaymentMethodUsBankAccountBlockedReason {
2714    fn as_ref(&self) -> &str {
2715        self.as_str()
2716    }
2717}
2718
2719impl std::fmt::Display for PaymentMethodUsBankAccountBlockedReason {
2720    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2721        self.as_str().fmt(f)
2722    }
2723}
2724impl std::default::Default for PaymentMethodUsBankAccountBlockedReason {
2725    fn default() -> Self {
2726        Self::BankAccountClosed
2727    }
2728}
2729
2730/// An enum representing the possible values of an `UpdatePaymentMethodUsBankAccount`'s `account_holder_type` field.
2731#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2732#[serde(rename_all = "snake_case")]
2733pub enum UpdatePaymentMethodUsBankAccountAccountHolderType {
2734    Company,
2735    Individual,
2736}
2737
2738impl UpdatePaymentMethodUsBankAccountAccountHolderType {
2739    pub fn as_str(self) -> &'static str {
2740        match self {
2741            UpdatePaymentMethodUsBankAccountAccountHolderType::Company => "company",
2742            UpdatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual",
2743        }
2744    }
2745}
2746
2747impl AsRef<str> for UpdatePaymentMethodUsBankAccountAccountHolderType {
2748    fn as_ref(&self) -> &str {
2749        self.as_str()
2750    }
2751}
2752
2753impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountHolderType {
2754    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2755        self.as_str().fmt(f)
2756    }
2757}
2758impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountHolderType {
2759    fn default() -> Self {
2760        Self::Company
2761    }
2762}
2763
2764/// An enum representing the possible values of an `UpdatePaymentMethodUsBankAccount`'s `account_type` field.
2765#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2766#[serde(rename_all = "snake_case")]
2767pub enum UpdatePaymentMethodUsBankAccountAccountType {
2768    Checking,
2769    Savings,
2770}
2771
2772impl UpdatePaymentMethodUsBankAccountAccountType {
2773    pub fn as_str(self) -> &'static str {
2774        match self {
2775            UpdatePaymentMethodUsBankAccountAccountType::Checking => "checking",
2776            UpdatePaymentMethodUsBankAccountAccountType::Savings => "savings",
2777        }
2778    }
2779}
2780
2781impl AsRef<str> for UpdatePaymentMethodUsBankAccountAccountType {
2782    fn as_ref(&self) -> &str {
2783        self.as_str()
2784    }
2785}
2786
2787impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountType {
2788    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2789        self.as_str().fmt(f)
2790    }
2791}
2792impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountType {
2793    fn default() -> Self {
2794        Self::Checking
2795    }
2796}
2797
2798/// An enum representing the possible values of an `UsBankAccountNetworks`'s `supported` field.
2799#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2800#[serde(rename_all = "snake_case")]
2801pub enum UsBankAccountNetworksSupported {
2802    Ach,
2803    UsDomesticWire,
2804}
2805
2806impl UsBankAccountNetworksSupported {
2807    pub fn as_str(self) -> &'static str {
2808        match self {
2809            UsBankAccountNetworksSupported::Ach => "ach",
2810            UsBankAccountNetworksSupported::UsDomesticWire => "us_domestic_wire",
2811        }
2812    }
2813}
2814
2815impl AsRef<str> for UsBankAccountNetworksSupported {
2816    fn as_ref(&self) -> &str {
2817        self.as_str()
2818    }
2819}
2820
2821impl std::fmt::Display for UsBankAccountNetworksSupported {
2822    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2823        self.as_str().fmt(f)
2824    }
2825}
2826impl std::default::Default for UsBankAccountNetworksSupported {
2827    fn default() -> Self {
2828        Self::Ach
2829    }
2830}
2831
2832/// An enum representing the possible values of an `WalletDetails`'s `type` field.
2833#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2834#[serde(rename_all = "snake_case")]
2835pub enum WalletDetailsType {
2836    AmexExpressCheckout,
2837    ApplePay,
2838    GooglePay,
2839    Link,
2840    Masterpass,
2841    SamsungPay,
2842    VisaCheckout,
2843}
2844
2845impl WalletDetailsType {
2846    pub fn as_str(self) -> &'static str {
2847        match self {
2848            WalletDetailsType::AmexExpressCheckout => "amex_express_checkout",
2849            WalletDetailsType::ApplePay => "apple_pay",
2850            WalletDetailsType::GooglePay => "google_pay",
2851            WalletDetailsType::Link => "link",
2852            WalletDetailsType::Masterpass => "masterpass",
2853            WalletDetailsType::SamsungPay => "samsung_pay",
2854            WalletDetailsType::VisaCheckout => "visa_checkout",
2855        }
2856    }
2857}
2858
2859impl AsRef<str> for WalletDetailsType {
2860    fn as_ref(&self) -> &str {
2861        self.as_str()
2862    }
2863}
2864
2865impl std::fmt::Display for WalletDetailsType {
2866    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2867        self.as_str().fmt(f)
2868    }
2869}
2870impl std::default::Default for WalletDetailsType {
2871    fn default() -> Self {
2872        Self::AmexExpressCheckout
2873    }
2874}
2875
2876/// If this is a `card` PaymentMethod, this hash contains the user's card details.
2877///
2878/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`.
2879/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance).
2880/// We strongly recommend using Stripe.js instead of interacting with this API directly.
2881#[derive(Clone, Debug, Deserialize, Serialize)]
2882#[serde(untagged, rename_all = "snake_case")]
2883pub enum CreatePaymentMethodCardUnion {
2884    CardDetailsParams(CardDetailsParams),
2885    TokenParams(TokenParams),
2886}
2887
2888#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2889pub struct CardDetailsParams {
2890    /// The card's CVC.
2891    ///
2892    /// It is highly recommended to always include this value.
2893    #[serde(skip_serializing_if = "Option::is_none")]
2894    pub cvc: Option<String>,
2895    /// Two-digit number representing the card's expiration month.
2896    pub exp_month: i32,
2897    /// Four-digit number representing the card's expiration year.
2898    pub exp_year: i32,
2899    /// The card number, as a string without any separators.
2900    pub number: String,
2901}
2902
2903#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2904pub struct TokenParams {
2905    /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}.
2906    pub token: String,
2907}
2908
2909/// If this is a `card` PaymentMethod, this hash contains the user's card details.
2910#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2911pub struct UpdateApiParam {
2912    /// Two-digit number representing the card's expiration month.
2913    #[serde(skip_serializing_if = "Option::is_none")]
2914    pub exp_month: Option<i32>,
2915    /// Four-digit number representing the card's expiration year.
2916    #[serde(skip_serializing_if = "Option::is_none")]
2917    pub exp_year: Option<i32>,
2918}