stripe/resources/generated/
charge.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::client::{Client, Response};
6use crate::ids::{ChargeId, CustomerId, PaymentIntentId};
7use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp};
8use crate::resources::{
9    Account, Address, Application, ApplicationFee, BalanceTransaction, BillingDetails,
10    ChargeSourceParams, Currency, Customer, Invoice, Mandate, PaymentIntent, PaymentMethod,
11    PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodDetailsCardWalletApplePay,
12    PaymentMethodDetailsCardWalletGooglePay, PaymentSource, RadarRadarOptions, Refund, Review,
13    Shipping, Transfer,
14};
15use serde::{Deserialize, Serialize};
16
17/// The resource representing a Stripe "Charge".
18///
19/// For more details see <https://stripe.com/docs/api/charges/object>
20#[derive(Clone, Debug, Default, Deserialize, Serialize)]
21pub struct Charge {
22    /// Unique identifier for the object.
23    pub id: ChargeId,
24
25    /// Amount intended to be collected by this payment.
26    ///
27    /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
28    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
29    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
30    pub amount: i64,
31
32    /// Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made).
33    pub amount_captured: i64,
34
35    /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued).
36    pub amount_refunded: i64,
37
38    /// ID of the Connect application that created the charge.
39    pub application: Option<Expandable<Application>>,
40
41    /// The application fee (if any) for the charge.
42    ///
43    /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details.
44    pub application_fee: Option<Expandable<ApplicationFee>>,
45
46    /// The amount of the application fee (if any) requested for the charge.
47    ///
48    /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details.
49    pub application_fee_amount: Option<i64>,
50
51    /// Authorization code on the charge.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub authorization_code: Option<String>,
54
55    /// ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).
56    pub balance_transaction: Option<Expandable<BalanceTransaction>>,
57
58    pub billing_details: BillingDetails,
59
60    /// The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements.
61    ///
62    /// Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
63    pub calculated_statement_descriptor: Option<String>,
64
65    /// If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.
66    pub captured: bool,
67
68    /// Time at which the object was created.
69    ///
70    /// Measured in seconds since the Unix epoch.
71    pub created: Timestamp,
72
73    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
74    ///
75    /// Must be a [supported currency](https://stripe.com/docs/currencies).
76    pub currency: Currency,
77
78    /// ID of the customer this charge is for if one exists.
79    pub customer: Option<Expandable<Customer>>,
80
81    /// An arbitrary string attached to the object.
82    ///
83    /// Often useful for displaying to users.
84    pub description: Option<String>,
85
86    /// Whether the charge has been disputed.
87    pub disputed: bool,
88
89    /// ID of the balance transaction that describes the reversal of the balance on your account due to payment failure.
90    pub failure_balance_transaction: Option<Expandable<BalanceTransaction>>,
91
92    /// Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes).
93    pub failure_code: Option<String>,
94
95    /// Message to user further explaining reason for charge failure if available.
96    pub failure_message: Option<String>,
97
98    /// Information on fraud assessments for the charge.
99    pub fraud_details: Option<FraudDetails>,
100
101    /// ID of the invoice this charge is for if one exists.
102    pub invoice: Option<Expandable<Invoice>>,
103
104    #[serde(skip_serializing_if = "Option::is_none")]
105    pub level3: Option<Level3>,
106
107    /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
108    pub livemode: bool,
109
110    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
111    ///
112    /// This can be useful for storing additional information about the object in a structured format.
113    pub metadata: Metadata,
114
115    /// The account (if any) the charge was made on behalf of without triggering an automatic transfer.
116    ///
117    /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
118    pub on_behalf_of: Option<Expandable<Account>>,
119
120    /// Details about whether the payment was accepted, and why.
121    ///
122    /// See [understanding declines](https://stripe.com/docs/declines) for details.
123    pub outcome: Option<ChargeOutcome>,
124
125    /// `true` if the charge succeeded, or was successfully authorized for later capture.
126    pub paid: bool,
127
128    /// ID of the PaymentIntent associated with this charge, if one exists.
129    pub payment_intent: Option<Expandable<PaymentIntent>>,
130
131    /// ID of the payment method used in this charge.
132    pub payment_method: Option<String>,
133
134    /// Details about the payment method at the time of the transaction.
135    pub payment_method_details: Option<PaymentMethodDetails>,
136
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub radar_options: Option<RadarRadarOptions>,
139
140    /// This is the email address that the receipt for this charge was sent to.
141    pub receipt_email: Option<String>,
142
143    /// This is the transaction number that appears on email receipts sent for this charge.
144    ///
145    /// This attribute will be `null` until a receipt has been sent.
146    pub receipt_number: Option<String>,
147
148    /// This is the URL to view the receipt for this charge.
149    ///
150    /// The receipt is kept up-to-date to the latest state of the charge, including any refunds.
151    /// If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.
152    pub receipt_url: Option<String>,
153
154    /// Whether the charge has been fully refunded.
155    ///
156    /// If the charge is only partially refunded, this attribute will still be false.
157    pub refunded: bool,
158
159    /// A list of refunds that have been applied to the charge.
160    pub refunds: Option<List<Refund>>,
161
162    /// ID of the review associated with this charge if one exists.
163    pub review: Option<Expandable<Review>>,
164
165    /// Shipping information for the charge.
166    pub shipping: Option<Shipping>,
167
168    /// This is a legacy field that will be removed in the future.
169    ///
170    /// It contains the Source, Card, or BankAccount object used for the charge.
171    /// For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead.
172    pub source: Option<PaymentSource>,
173
174    /// The transfer ID which created this charge.
175    ///
176    /// Only present if the charge came from another Stripe account.
177    /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details.
178    pub source_transfer: Option<Expandable<Transfer>>,
179
180    /// For card charges, use `statement_descriptor_suffix` instead.
181    ///
182    /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements.
183    /// Must contain at least one letter, maximum 22 characters.
184    pub statement_descriptor: Option<String>,
185
186    /// Provides information about the charge that customers see on their statements.
187    ///
188    /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor.
189    /// Maximum 22 characters for the concatenated descriptor.
190    pub statement_descriptor_suffix: Option<String>,
191
192    /// The status of the payment is either `succeeded`, `pending`, or `failed`.
193    pub status: ChargeStatus,
194
195    /// ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter).
196    #[serde(skip_serializing_if = "Option::is_none")]
197    pub transfer: Option<Expandable<Transfer>>,
198
199    /// An optional dictionary including the account to automatically transfer to as part of a destination charge.
200    ///
201    /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details.
202    pub transfer_data: Option<TransferData>,
203
204    /// A string that identifies this transaction as part of a group.
205    ///
206    /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details.
207    pub transfer_group: Option<String>,
208}
209
210impl Charge {
211    /// Returns a list of charges you’ve previously created.
212    ///
213    /// The charges are returned in sorted order, with the most recent charges appearing first.
214    pub fn list(client: &Client, params: &ListCharges<'_>) -> Response<List<Charge>> {
215        client.get_query("/charges", params)
216    }
217
218    /// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents)
219    /// to initiate a new payment instead.
220    ///
221    /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment.
222    pub fn create(client: &Client, params: CreateCharge<'_>) -> Response<Charge> {
223        #[allow(clippy::needless_borrows_for_generic_args)]
224        client.post_form("/charges", &params)
225    }
226
227    /// Retrieves the details of a charge that has previously been created.
228    ///
229    /// Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information.
230    /// The same information is returned when creating or refunding the charge.
231    pub fn retrieve(client: &Client, id: &ChargeId, expand: &[&str]) -> Response<Charge> {
232        client.get_query(&format!("/charges/{}", id), Expand { expand })
233    }
234
235    /// Updates the specified charge by setting the values of the parameters passed.
236    ///
237    /// Any parameters not provided will be left unchanged.
238    pub fn update(client: &Client, id: &ChargeId, params: UpdateCharge<'_>) -> Response<Charge> {
239        #[allow(clippy::needless_borrows_for_generic_args)]
240        client.post_form(&format!("/charges/{}", id), &params)
241    }
242}
243
244impl Object for Charge {
245    type Id = ChargeId;
246    fn id(&self) -> Self::Id {
247        self.id.clone()
248    }
249    fn object(&self) -> &'static str {
250        "charge"
251    }
252}
253
254#[derive(Clone, Debug, Default, Deserialize, Serialize)]
255pub struct FraudDetails {
256    /// Assessments from Stripe.
257    ///
258    /// If set, the value is `fraudulent`.
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub stripe_report: Option<String>,
261
262    /// Assessments reported by you.
263    ///
264    /// If set, possible values of are `safe` and `fraudulent`.
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub user_report: Option<String>,
267}
268
269#[derive(Clone, Debug, Default, Deserialize, Serialize)]
270pub struct ChargeOutcome {
271    /// Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`.
272    ///
273    /// The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement.
274    pub network_status: Option<String>,
275
276    /// An enumerated value providing a more detailed explanation of the outcome's `type`.
277    ///
278    /// Charges blocked by Radar's default block rule have the value `highest_risk_level`.
279    /// Charges placed in review by Radar's default review rule have the value `elevated_risk_level`.
280    /// Charges authorized, blocked, or placed in review by custom rules have the value `rule`.
281    /// See [understanding declines](https://stripe.com/docs/declines) for more details.
282    pub reason: Option<String>,
283
284    /// Stripe Radar's evaluation of the riskiness of the payment.
285    ///
286    /// Possible values for evaluated payments are `normal`, `elevated`, `highest`.
287    /// For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`.
288    /// In the event of an error in the evaluation, this field will have the value `unknown`.
289    /// This field is only available with Radar.
290    #[serde(skip_serializing_if = "Option::is_none")]
291    pub risk_level: Option<String>,
292
293    /// Stripe Radar's evaluation of the riskiness of the payment.
294    ///
295    /// Possible values for evaluated payments are between 0 and 100.
296    /// For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present.
297    /// This field is only available with Radar for Fraud Teams.
298    #[serde(skip_serializing_if = "Option::is_none")]
299    pub risk_score: Option<i64>,
300
301    /// The ID of the Radar rule that matched the payment, if applicable.
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub rule: Option<Expandable<Rule>>,
304
305    /// A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer.
306    pub seller_message: Option<String>,
307
308    /// Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`.
309    ///
310    /// See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details.
311    #[serde(rename = "type")]
312    pub type_: String,
313}
314
315#[derive(Clone, Debug, Default, Deserialize, Serialize)]
316pub struct TransferData {
317    /// The amount transferred to the destination account, if specified.
318    ///
319    /// By default, the entire charge amount is transferred to the destination account.
320    pub amount: Option<i64>,
321
322    /// ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request.
323    pub destination: Expandable<Account>,
324}
325
326#[derive(Clone, Debug, Default, Deserialize, Serialize)]
327pub struct Level3 {
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub customer_reference: Option<String>,
330
331    pub line_items: Vec<Level3LineItems>,
332
333    pub merchant_reference: String,
334
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub shipping_address_zip: Option<String>,
337
338    #[serde(skip_serializing_if = "Option::is_none")]
339    pub shipping_amount: Option<i64>,
340
341    #[serde(skip_serializing_if = "Option::is_none")]
342    pub shipping_from_zip: Option<String>,
343}
344
345#[derive(Clone, Debug, Default, Deserialize, Serialize)]
346pub struct Level3LineItems {
347    pub discount_amount: Option<i64>,
348
349    pub product_code: String,
350
351    pub product_description: String,
352
353    pub quantity: Option<u64>,
354
355    pub tax_amount: Option<i64>,
356
357    pub unit_cost: Option<i64>,
358}
359
360#[derive(Clone, Debug, Default, Deserialize, Serialize)]
361pub struct PaymentMethodDetails {
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub ach_credit_transfer: Option<PaymentMethodDetailsAchCreditTransfer>,
364
365    #[serde(skip_serializing_if = "Option::is_none")]
366    pub ach_debit: Option<PaymentMethodDetailsAchDebit>,
367
368    #[serde(skip_serializing_if = "Option::is_none")]
369    pub acss_debit: Option<PaymentMethodDetailsAcssDebit>,
370
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub affirm: Option<PaymentMethodDetailsAffirm>,
373
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub afterpay_clearpay: Option<PaymentMethodDetailsAfterpayClearpay>,
376
377    #[serde(skip_serializing_if = "Option::is_none")]
378    pub alipay: Option<PaymentFlowsPrivatePaymentMethodsAlipayDetails>,
379
380    #[serde(skip_serializing_if = "Option::is_none")]
381    pub au_becs_debit: Option<PaymentMethodDetailsAuBecsDebit>,
382
383    #[serde(skip_serializing_if = "Option::is_none")]
384    pub bacs_debit: Option<PaymentMethodDetailsBacsDebit>,
385
386    #[serde(skip_serializing_if = "Option::is_none")]
387    pub bancontact: Option<PaymentMethodDetailsBancontact>,
388
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub blik: Option<PaymentMethodDetailsBlik>,
391
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub boleto: Option<PaymentMethodDetailsBoleto>,
394
395    #[serde(skip_serializing_if = "Option::is_none")]
396    pub card: Option<PaymentMethodDetailsCard>,
397
398    #[serde(skip_serializing_if = "Option::is_none")]
399    pub card_present: Option<PaymentMethodDetailsCardPresent>,
400
401    #[serde(skip_serializing_if = "Option::is_none")]
402    pub cashapp: Option<PaymentMethodDetailsCashapp>,
403
404    #[serde(skip_serializing_if = "Option::is_none")]
405    pub customer_balance: Option<PaymentMethodDetailsCustomerBalance>,
406
407    #[serde(skip_serializing_if = "Option::is_none")]
408    pub eps: Option<PaymentMethodDetailsEps>,
409
410    #[serde(skip_serializing_if = "Option::is_none")]
411    pub fpx: Option<PaymentMethodDetailsFpx>,
412
413    #[serde(skip_serializing_if = "Option::is_none")]
414    pub giropay: Option<PaymentMethodDetailsGiropay>,
415
416    #[serde(skip_serializing_if = "Option::is_none")]
417    pub grabpay: Option<PaymentMethodDetailsGrabpay>,
418
419    #[serde(skip_serializing_if = "Option::is_none")]
420    pub ideal: Option<PaymentMethodDetailsIdeal>,
421
422    #[serde(skip_serializing_if = "Option::is_none")]
423    pub interac_present: Option<PaymentMethodDetailsInteracPresent>,
424
425    #[serde(skip_serializing_if = "Option::is_none")]
426    pub klarna: Option<PaymentMethodDetailsKlarna>,
427
428    #[serde(skip_serializing_if = "Option::is_none")]
429    pub konbini: Option<PaymentMethodDetailsKonbini>,
430
431    #[serde(skip_serializing_if = "Option::is_none")]
432    pub link: Option<PaymentMethodDetailsLink>,
433
434    #[serde(skip_serializing_if = "Option::is_none")]
435    pub multibanco: Option<PaymentMethodDetailsMultibanco>,
436
437    #[serde(skip_serializing_if = "Option::is_none")]
438    pub oxxo: Option<PaymentMethodDetailsOxxo>,
439
440    #[serde(skip_serializing_if = "Option::is_none")]
441    pub p24: Option<PaymentMethodDetailsP24>,
442
443    #[serde(skip_serializing_if = "Option::is_none")]
444    pub paynow: Option<PaymentMethodDetailsPaynow>,
445
446    #[serde(skip_serializing_if = "Option::is_none")]
447    pub paypal: Option<PaymentMethodDetailsPaypal>,
448
449    #[serde(skip_serializing_if = "Option::is_none")]
450    pub pix: Option<PaymentMethodDetailsPix>,
451
452    #[serde(skip_serializing_if = "Option::is_none")]
453    pub promptpay: Option<PaymentMethodDetailsPromptpay>,
454
455    #[serde(skip_serializing_if = "Option::is_none")]
456    pub revolut_pay: Option<PaymentMethodDetailsRevolutPay>,
457
458    #[serde(skip_serializing_if = "Option::is_none")]
459    pub sepa_credit_transfer: Option<PaymentMethodDetailsSepaCreditTransfer>,
460
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub sepa_debit: Option<PaymentMethodDetailsSepaDebit>,
463
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub sofort: Option<PaymentMethodDetailsSofort>,
466
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub stripe_account: Option<PaymentMethodDetailsStripeAccount>,
469
470    #[serde(skip_serializing_if = "Option::is_none")]
471    pub swish: Option<PaymentMethodDetailsSwish>,
472
473    /// The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`.
474    /// An additional hash is included on `payment_method_details` with a name matching this value.
475    /// It contains information specific to the payment method.
476    #[serde(rename = "type")]
477    pub type_: String,
478
479    #[serde(skip_serializing_if = "Option::is_none")]
480    pub us_bank_account: Option<PaymentMethodDetailsUsBankAccount>,
481
482    #[serde(skip_serializing_if = "Option::is_none")]
483    pub wechat: Option<PaymentMethodDetailsWechat>,
484
485    #[serde(skip_serializing_if = "Option::is_none")]
486    pub wechat_pay: Option<PaymentMethodDetailsWechatPay>,
487
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub zip: Option<PaymentMethodDetailsZip>,
490}
491
492#[derive(Clone, Debug, Default, Deserialize, Serialize)]
493pub struct PaymentFlowsPrivatePaymentMethodsAlipayDetails {
494    /// Uniquely identifies this particular Alipay account.
495    ///
496    /// You can use this attribute to check whether two Alipay accounts are the same.
497    #[serde(skip_serializing_if = "Option::is_none")]
498    pub buyer_id: Option<String>,
499
500    /// Uniquely identifies this particular Alipay account.
501    ///
502    /// You can use this attribute to check whether two Alipay accounts are the same.
503    pub fingerprint: Option<String>,
504
505    /// Transaction ID of this particular Alipay transaction.
506    pub transaction_id: Option<String>,
507}
508
509#[derive(Clone, Debug, Default, Deserialize, Serialize)]
510pub struct PaymentMethodDetailsAchCreditTransfer {
511    /// Account number to transfer funds to.
512    pub account_number: Option<String>,
513
514    /// Name of the bank associated with the routing number.
515    pub bank_name: Option<String>,
516
517    /// Routing transit number for the bank account to transfer funds to.
518    pub routing_number: Option<String>,
519
520    /// SWIFT code of the bank associated with the routing number.
521    pub swift_code: Option<String>,
522}
523
524#[derive(Clone, Debug, Default, Deserialize, Serialize)]
525pub struct PaymentMethodDetailsAchDebit {
526    /// Type of entity that holds the account.
527    ///
528    /// This can be either `individual` or `company`.
529    pub account_holder_type: Option<PaymentMethodDetailsAchDebitAccountHolderType>,
530
531    /// Name of the bank associated with the bank account.
532    pub bank_name: Option<String>,
533
534    /// Two-letter ISO code representing the country the bank account is located in.
535    pub country: Option<String>,
536
537    /// Uniquely identifies this particular bank account.
538    ///
539    /// You can use this attribute to check whether two bank accounts are the same.
540    pub fingerprint: Option<String>,
541
542    /// Last four digits of the bank account number.
543    pub last4: Option<String>,
544
545    /// Routing transit number of the bank account.
546    pub routing_number: Option<String>,
547}
548
549#[derive(Clone, Debug, Default, Deserialize, Serialize)]
550pub struct PaymentMethodDetailsAcssDebit {
551    /// Name of the bank associated with the bank account.
552    pub bank_name: Option<String>,
553
554    /// Uniquely identifies this particular bank account.
555    ///
556    /// You can use this attribute to check whether two bank accounts are the same.
557    pub fingerprint: Option<String>,
558
559    /// Institution number of the bank account.
560    pub institution_number: Option<String>,
561
562    /// Last four digits of the bank account number.
563    pub last4: Option<String>,
564
565    /// ID of the mandate used to make this payment.
566    #[serde(skip_serializing_if = "Option::is_none")]
567    pub mandate: Option<String>,
568
569    /// Transit number of the bank account.
570    pub transit_number: Option<String>,
571}
572
573#[derive(Clone, Debug, Default, Deserialize, Serialize)]
574pub struct PaymentMethodDetailsAffirm {}
575
576#[derive(Clone, Debug, Default, Deserialize, Serialize)]
577pub struct PaymentMethodDetailsAfterpayClearpay {
578    /// The Afterpay order ID associated with this payment intent.
579    pub order_id: Option<String>,
580
581    /// Order identifier shown to the merchant in Afterpay’s online portal.
582    pub reference: Option<String>,
583}
584
585#[derive(Clone, Debug, Default, Deserialize, Serialize)]
586pub struct PaymentMethodDetailsAuBecsDebit {
587    /// Bank-State-Branch number of the bank account.
588    pub bsb_number: Option<String>,
589
590    /// Uniquely identifies this particular bank account.
591    ///
592    /// You can use this attribute to check whether two bank accounts are the same.
593    pub fingerprint: Option<String>,
594
595    /// Last four digits of the bank account number.
596    pub last4: Option<String>,
597
598    /// ID of the mandate used to make this payment.
599    #[serde(skip_serializing_if = "Option::is_none")]
600    pub mandate: Option<String>,
601}
602
603#[derive(Clone, Debug, Default, Deserialize, Serialize)]
604pub struct PaymentMethodDetailsBacsDebit {
605    /// Uniquely identifies this particular bank account.
606    ///
607    /// You can use this attribute to check whether two bank accounts are the same.
608    pub fingerprint: Option<String>,
609
610    /// Last four digits of the bank account number.
611    pub last4: Option<String>,
612
613    /// ID of the mandate used to make this payment.
614    pub mandate: Option<String>,
615
616    /// Sort code of the bank account.
617    ///
618    /// (e.g., `10-20-30`).
619    pub sort_code: Option<String>,
620}
621
622#[derive(Clone, Debug, Default, Deserialize, Serialize)]
623pub struct PaymentMethodDetailsBancontact {
624    /// Bank code of bank associated with the bank account.
625    pub bank_code: Option<String>,
626
627    /// Name of the bank associated with the bank account.
628    pub bank_name: Option<String>,
629
630    /// Bank Identifier Code of the bank associated with the bank account.
631    pub bic: Option<String>,
632
633    /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
634    pub generated_sepa_debit: Option<Expandable<PaymentMethod>>,
635
636    /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
637    pub generated_sepa_debit_mandate: Option<Expandable<Mandate>>,
638
639    /// Last four characters of the IBAN.
640    pub iban_last4: Option<String>,
641
642    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
643    /// Can be one of `en`, `de`, `fr`, or `nl`.
644    pub preferred_language: Option<PaymentMethodDetailsBancontactPreferredLanguage>,
645
646    /// Owner's verified full name.
647    ///
648    /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement.
649    /// They cannot be set or mutated.
650    pub verified_name: Option<String>,
651}
652
653#[derive(Clone, Debug, Default, Deserialize, Serialize)]
654pub struct PaymentMethodDetailsBlik {}
655
656#[derive(Clone, Debug, Default, Deserialize, Serialize)]
657pub struct PaymentMethodDetailsBoleto {
658    /// The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers).
659    pub tax_id: String,
660}
661
662#[derive(Clone, Debug, Default, Deserialize, Serialize)]
663pub struct PaymentMethodDetailsCard {
664
665    /// The authorized amount.
666    pub amount_authorized: Option<i64>,
667
668    /// Card brand.
669    ///
670    /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
671    pub brand: Option<String>,
672
673    /// When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured.
674    #[serde(skip_serializing_if = "Option::is_none")]
675    pub capture_before: Option<Timestamp>,
676
677    /// Check results by Card networks on Card address and CVC at time of payment.
678    pub checks: Option<PaymentMethodDetailsCardChecks>,
679
680    /// Two-letter ISO code representing the country of the card.
681    ///
682    /// You could use this attribute to get a sense of the international breakdown of cards you've collected.
683    pub country: Option<String>,
684
685    /// A high-level description of the type of cards issued in this range.
686    ///
687    /// (For internal use only and not typically available in standard API requests.).
688    #[serde(skip_serializing_if = "Option::is_none")]
689    pub description: Option<String>,
690
691    /// Two-digit number representing the card's expiration month.
692    pub exp_month: i64,
693
694    /// Four-digit number representing the card's expiration year.
695    pub exp_year: i64,
696
697    #[serde(skip_serializing_if = "Option::is_none")]
698    pub extended_authorization: Option<PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization>,
699
700    /// Uniquely identifies this particular card number.
701    ///
702    /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
703    /// 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.*.
704    #[serde(skip_serializing_if = "Option::is_none")]
705    pub fingerprint: Option<String>,
706
707    /// Card funding type.
708    ///
709    /// Can be `credit`, `debit`, `prepaid`, or `unknown`.
710    pub funding: Option<String>,
711
712    /// Issuer identification number of the card.
713    ///
714    /// (For internal use only and not typically available in standard API requests.).
715    #[serde(skip_serializing_if = "Option::is_none")]
716    pub iin: Option<String>,
717
718    #[serde(skip_serializing_if = "Option::is_none")]
719    pub incremental_authorization: Option<PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization>,
720
721    /// Installment details for this payment (Mexico only).
722    ///
723    /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
724    pub installments: Option<PaymentMethodDetailsCardInstallments>,
725
726    /// The name of the card's issuing bank.
727    ///
728    /// (For internal use only and not typically available in standard API requests.).
729    #[serde(skip_serializing_if = "Option::is_none")]
730    pub issuer: Option<String>,
731
732    /// The last four digits of the card.
733    pub last4: Option<String>,
734
735    /// ID of the mandate used to make this payment or created by it.
736    pub mandate: Option<String>,
737
738    /// True if this payment was marked as MOTO and out of scope for SCA.
739    #[serde(skip_serializing_if = "Option::is_none")]
740    pub moto: Option<bool>,
741
742    #[serde(skip_serializing_if = "Option::is_none")]
743    pub multicapture: Option<PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture>,
744
745    /// Identifies which network this charge was processed on.
746    ///
747    /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
748    pub network: Option<String>,
749
750    /// If this card has network token credentials, this contains the details of the network token credentials.
751    #[serde(skip_serializing_if = "Option::is_none")]
752    pub network_token: Option<PaymentMethodDetailsCardNetworkToken>,
753
754    #[serde(skip_serializing_if = "Option::is_none")]
755    pub overcapture: Option<PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture>,
756
757    /// Populated if this transaction used 3D Secure authentication.
758    pub three_d_secure: Option<ThreeDSecureDetailsCharge>,
759
760    /// If this Card is part of a card wallet, this contains the details of the card wallet.
761    pub wallet: Option<PaymentMethodDetailsCardWallet>,
762}
763
764#[derive(Clone, Debug, Default, Deserialize, Serialize)]
765pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization {
766
767    /// Indicates whether or not the capture window is extended beyond the standard authorization.
768    pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus,
769}
770
771#[derive(Clone, Debug, Default, Deserialize, Serialize)]
772pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization {
773
774    /// Indicates whether or not the incremental authorization feature is supported.
775    pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus,
776}
777
778#[derive(Clone, Debug, Default, Deserialize, Serialize)]
779pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture {
780
781    /// The maximum amount that can be captured.
782    pub maximum_amount_capturable: i64,
783
784    /// Indicates whether or not the authorized amount can be over-captured.
785    pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus,
786}
787
788#[derive(Clone, Debug, Default, Deserialize, Serialize)]
789pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture {
790    /// Indicates whether or not multiple captures are supported.
791    pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus,
792}
793
794#[derive(Clone, Debug, Default, Deserialize, Serialize)]
795pub struct PaymentMethodDetailsCardChecks {
796    /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
797    pub address_line1_check: Option<String>,
798
799    /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
800    pub address_postal_code_check: Option<String>,
801
802    /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
803    pub cvc_check: Option<String>,
804}
805
806#[derive(Clone, Debug, Default, Deserialize, Serialize)]
807pub struct PaymentMethodDetailsCardInstallments {
808    /// Installment plan selected for the payment.
809    pub plan: Option<PaymentMethodDetailsCardInstallmentsPlan>,
810}
811
812#[derive(Clone, Debug, Default, Deserialize, Serialize)]
813pub struct PaymentMethodDetailsCardNetworkToken {
814    /// Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction.
815    pub used: bool,
816}
817
818#[derive(Clone, Debug, Default, Deserialize, Serialize)]
819pub struct PaymentMethodDetailsCardPresent {
820    /// The authorized amount.
821    pub amount_authorized: Option<i64>,
822
823    /// Card brand.
824    ///
825    /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
826    pub brand: Option<String>,
827
828    /// When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.
829    #[serde(skip_serializing_if = "Option::is_none")]
830    pub capture_before: Option<Timestamp>,
831
832    /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format.
833    ///
834    /// May include alphanumeric characters, special characters and first/last name separator (`/`).
835    /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card.
836    /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.
837    pub cardholder_name: Option<String>,
838
839    /// Two-letter ISO code representing the country of the card.
840    ///
841    /// You could use this attribute to get a sense of the international breakdown of cards you've collected.
842    pub country: Option<String>,
843
844    /// A high-level description of the type of cards issued in this range.
845    ///
846    /// (For internal use only and not typically available in standard API requests.).
847    #[serde(skip_serializing_if = "Option::is_none")]
848    pub description: Option<String>,
849
850    /// Authorization response cryptogram.
851    pub emv_auth_data: Option<String>,
852
853    /// Two-digit number representing the card's expiration month.
854    pub exp_month: i64,
855
856    /// Four-digit number representing the card's expiration year.
857    pub exp_year: i64,
858
859    /// Uniquely identifies this particular card number.
860    ///
861    /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
862    /// 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.*.
863    pub fingerprint: Option<String>,
864
865    /// Card funding type.
866    ///
867    /// Can be `credit`, `debit`, `prepaid`, or `unknown`.
868    pub funding: Option<String>,
869
870    /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions.
871    ///
872    /// Only present if it was possible to generate a card PaymentMethod.
873    pub generated_card: Option<String>,
874
875    /// Issuer identification number of the card.
876    ///
877    /// (For internal use only and not typically available in standard API requests.).
878    #[serde(skip_serializing_if = "Option::is_none")]
879    pub iin: Option<String>,
880
881    /// Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations.
882    ///
883    /// Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).
884    pub incremental_authorization_supported: bool,
885
886    /// The name of the card's issuing bank.
887    ///
888    /// (For internal use only and not typically available in standard API requests.).
889    #[serde(skip_serializing_if = "Option::is_none")]
890    pub issuer: Option<String>,
891
892    /// The last four digits of the card.
893    pub last4: Option<String>,
894
895    /// Identifies which network this charge was processed on.
896    ///
897    /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
898    pub network: Option<String>,
899
900    /// Details about payments collected offline.
901    pub offline: Option<PaymentMethodDetailsCardPresentOffline>,
902
903    /// Defines whether the authorized amount can be over-captured or not.
904    pub overcapture_supported: bool,
905
906    /// How card details were read in this transaction.
907    pub read_method: Option<PaymentMethodDetailsCardPresentReadMethod>,
908
909    /// A collection of fields required to be displayed on receipts.
910    ///
911    /// Only required for EMV transactions.
912    pub receipt: Option<PaymentMethodDetailsCardPresentReceipt>,
913}
914
915#[derive(Clone, Debug, Default, Deserialize, Serialize)]
916pub struct PaymentMethodDetailsCardPresentOffline {
917    /// Time at which the payment was collected while offline.
918    pub stored_at: Option<Timestamp>,
919}
920
921#[derive(Clone, Debug, Default, Deserialize, Serialize)]
922pub struct PaymentMethodDetailsCardPresentReceipt {
923    /// The type of account being debited or credited.
924    #[serde(skip_serializing_if = "Option::is_none")]
925    pub account_type: Option<PaymentMethodDetailsCardPresentReceiptAccountType>,
926
927    /// EMV tag 9F26, cryptogram generated by the integrated circuit chip.
928    pub application_cryptogram: Option<String>,
929
930    /// Mnenomic of the Application Identifier.
931    pub application_preferred_name: Option<String>,
932
933    /// Identifier for this transaction.
934    pub authorization_code: Option<String>,
935
936    /// EMV tag 8A.
937    ///
938    /// A code returned by the card issuer.
939    pub authorization_response_code: Option<String>,
940
941    /// How the cardholder verified ownership of the card.
942    pub cardholder_verification_method: Option<String>,
943
944    /// EMV tag 84.
945    ///
946    /// Similar to the application identifier stored on the integrated circuit chip.
947    pub dedicated_file_name: Option<String>,
948
949    /// The outcome of a series of EMV functions performed by the card reader.
950    pub terminal_verification_results: Option<String>,
951
952    /// An indication of various EMV functions performed during the transaction.
953    pub transaction_status_information: Option<String>,
954}
955
956#[derive(Clone, Debug, Default, Deserialize, Serialize)]
957pub struct PaymentMethodDetailsCardWallet {
958    #[serde(skip_serializing_if = "Option::is_none")]
959    pub amex_express_checkout: Option<PaymentMethodDetailsCardWalletAmexExpressCheckout>,
960
961    #[serde(skip_serializing_if = "Option::is_none")]
962    pub apple_pay: Option<PaymentMethodDetailsCardWalletApplePay>,
963
964    /// (For tokenized numbers only.) The last four digits of the device account number.
965    pub dynamic_last4: Option<String>,
966
967    #[serde(skip_serializing_if = "Option::is_none")]
968    pub google_pay: Option<PaymentMethodDetailsCardWalletGooglePay>,
969
970    #[serde(skip_serializing_if = "Option::is_none")]
971    pub link: Option<PaymentMethodDetailsCardWalletLink>,
972
973    #[serde(skip_serializing_if = "Option::is_none")]
974    pub masterpass: Option<PaymentMethodDetailsCardWalletMasterpass>,
975
976    #[serde(skip_serializing_if = "Option::is_none")]
977    pub samsung_pay: Option<PaymentMethodDetailsCardWalletSamsungPay>,
978
979    /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`.
980    ///
981    /// An additional hash is included on the Wallet subhash with a name matching this value.
982    /// It contains additional information specific to the card wallet type.
983    #[serde(rename = "type")]
984    pub type_: PaymentMethodDetailsCardWalletType,
985
986    #[serde(skip_serializing_if = "Option::is_none")]
987    pub visa_checkout: Option<PaymentMethodDetailsCardWalletVisaCheckout>,
988}
989
990#[derive(Clone, Debug, Default, Deserialize, Serialize)]
991pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {}
992
993#[derive(Clone, Debug, Default, Deserialize, Serialize)]
994pub struct PaymentMethodDetailsCardWalletLink {}
995
996#[derive(Clone, Debug, Default, Deserialize, Serialize)]
997pub struct PaymentMethodDetailsCardWalletMasterpass {
998    /// Owner's verified billing address.
999    ///
1000    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1001    /// They cannot be set or mutated.
1002    pub billing_address: Option<Address>,
1003
1004    /// Owner's verified email.
1005    ///
1006    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1007    /// They cannot be set or mutated.
1008    pub email: Option<String>,
1009
1010    /// Owner's verified full name.
1011    ///
1012    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1013    /// They cannot be set or mutated.
1014    pub name: Option<String>,
1015
1016    /// Owner's verified shipping address.
1017    ///
1018    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1019    /// They cannot be set or mutated.
1020    pub shipping_address: Option<Address>,
1021}
1022
1023#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1024pub struct PaymentMethodDetailsCardWalletSamsungPay {}
1025
1026#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1027pub struct PaymentMethodDetailsCardWalletVisaCheckout {
1028    /// Owner's verified billing address.
1029    ///
1030    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1031    /// They cannot be set or mutated.
1032    pub billing_address: Option<Address>,
1033
1034    /// Owner's verified email.
1035    ///
1036    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1037    /// They cannot be set or mutated.
1038    pub email: Option<String>,
1039
1040    /// Owner's verified full name.
1041    ///
1042    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1043    /// They cannot be set or mutated.
1044    pub name: Option<String>,
1045
1046    /// Owner's verified shipping address.
1047    ///
1048    /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement.
1049    /// They cannot be set or mutated.
1050    pub shipping_address: Option<Address>,
1051}
1052
1053#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1054pub struct PaymentMethodDetailsCashapp {
1055    /// A unique and immutable identifier assigned by Cash App to every buyer.
1056    pub buyer_id: Option<String>,
1057
1058    /// A public identifier for buyers using Cash App.
1059    pub cashtag: Option<String>,
1060}
1061
1062#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1063pub struct PaymentMethodDetailsCustomerBalance {}
1064
1065#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1066pub struct PaymentMethodDetailsEps {
1067    /// The customer's bank.
1068    ///
1069    /// 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`.
1070    pub bank: Option<PaymentMethodDetailsEpsBank>,
1071
1072    /// Owner's verified full name.
1073    ///
1074    /// Values are verified or provided by EPS directly (if supported) at the time of authorization or settlement.
1075    /// They cannot be set or mutated. EPS rarely provides this information so the attribute is usually empty.
1076    pub verified_name: Option<String>,
1077}
1078
1079#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1080pub struct PaymentMethodDetailsFpx {
1081    /// Account holder type, if provided.
1082    ///
1083    /// Can be one of `individual` or `company`.
1084    pub account_holder_type: Option<PaymentMethodDetailsFpxAccountHolderType>,
1085
1086    /// The customer's bank.
1087    ///
1088    /// 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`.
1089    pub bank: PaymentMethodDetailsFpxBank,
1090
1091    /// Unique transaction id generated by FPX for every request from the merchant.
1092    pub transaction_id: Option<String>,
1093}
1094
1095#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1096pub struct PaymentMethodDetailsGiropay {
1097    /// Bank code of bank associated with the bank account.
1098    pub bank_code: Option<String>,
1099
1100    /// Name of the bank associated with the bank account.
1101    pub bank_name: Option<String>,
1102
1103    /// Bank Identifier Code of the bank associated with the bank account.
1104    pub bic: Option<String>,
1105
1106    /// Owner's verified full name.
1107    ///
1108    /// Values are verified or provided by Giropay directly (if supported) at the time of authorization or settlement.
1109    /// They cannot be set or mutated. Giropay rarely provides this information so the attribute is usually empty.
1110    pub verified_name: Option<String>,
1111}
1112
1113#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1114pub struct PaymentMethodDetailsGrabpay {
1115    /// Unique transaction id generated by GrabPay.
1116    pub transaction_id: Option<String>,
1117}
1118
1119#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1120pub struct PaymentMethodDetailsIdeal {
1121    /// The customer's bank.
1122    ///
1123    /// 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`.
1124    pub bank: Option<PaymentMethodDetailsIdealBank>,
1125
1126    /// The Bank Identifier Code of the customer's bank.
1127    pub bic: Option<PaymentMethodDetailsIdealBic>,
1128
1129    /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
1130    pub generated_sepa_debit: Option<Expandable<PaymentMethod>>,
1131
1132    /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
1133    pub generated_sepa_debit_mandate: Option<Expandable<Mandate>>,
1134
1135    /// Last four characters of the IBAN.
1136    pub iban_last4: Option<String>,
1137
1138    /// Owner's verified full name.
1139    ///
1140    /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement.
1141    /// They cannot be set or mutated.
1142    pub verified_name: Option<String>,
1143}
1144
1145#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1146pub struct PaymentMethodDetailsInteracPresent {
1147    /// Card brand.
1148    ///
1149    /// Can be `interac`, `mastercard` or `visa`.
1150    pub brand: Option<String>,
1151
1152    /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format.
1153    ///
1154    /// May include alphanumeric characters, special characters and first/last name separator (`/`).
1155    /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card.
1156    /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.
1157    pub cardholder_name: Option<String>,
1158
1159    /// Two-letter ISO code representing the country of the card.
1160    ///
1161    /// You could use this attribute to get a sense of the international breakdown of cards you've collected.
1162    pub country: Option<String>,
1163
1164    /// A high-level description of the type of cards issued in this range.
1165    ///
1166    /// (For internal use only and not typically available in standard API requests.).
1167    #[serde(skip_serializing_if = "Option::is_none")]
1168    pub description: Option<String>,
1169
1170    /// Authorization response cryptogram.
1171    pub emv_auth_data: Option<String>,
1172
1173    /// Two-digit number representing the card's expiration month.
1174    pub exp_month: i64,
1175
1176    /// Four-digit number representing the card's expiration year.
1177    pub exp_year: i64,
1178
1179    /// Uniquely identifies this particular card number.
1180    ///
1181    /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
1182    /// 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.*.
1183    pub fingerprint: Option<String>,
1184
1185    /// Card funding type.
1186    ///
1187    /// Can be `credit`, `debit`, `prepaid`, or `unknown`.
1188    pub funding: Option<String>,
1189
1190    /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions.
1191    ///
1192    /// Only present if it was possible to generate a card PaymentMethod.
1193    pub generated_card: Option<String>,
1194
1195    /// Issuer identification number of the card.
1196    ///
1197    /// (For internal use only and not typically available in standard API requests.).
1198    #[serde(skip_serializing_if = "Option::is_none")]
1199    pub iin: Option<String>,
1200
1201    /// The name of the card's issuing bank.
1202    ///
1203    /// (For internal use only and not typically available in standard API requests.).
1204    #[serde(skip_serializing_if = "Option::is_none")]
1205    pub issuer: Option<String>,
1206
1207    /// The last four digits of the card.
1208    pub last4: Option<String>,
1209
1210    /// Identifies which network this charge was processed on.
1211    ///
1212    /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
1213    pub network: Option<String>,
1214
1215    /// EMV tag 5F2D.
1216    ///
1217    /// Preferred languages specified by the integrated circuit chip.
1218    pub preferred_locales: Option<Vec<String>>,
1219
1220    /// How card details were read in this transaction.
1221    pub read_method: Option<PaymentMethodDetailsInteracPresentReadMethod>,
1222
1223    /// A collection of fields required to be displayed on receipts.
1224    ///
1225    /// Only required for EMV transactions.
1226    pub receipt: Option<PaymentMethodDetailsInteracPresentReceipt>,
1227}
1228
1229#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1230pub struct PaymentMethodDetailsInteracPresentReceipt {
1231    /// The type of account being debited or credited.
1232    #[serde(skip_serializing_if = "Option::is_none")]
1233    pub account_type: Option<PaymentMethodDetailsInteracPresentReceiptAccountType>,
1234
1235    /// EMV tag 9F26, cryptogram generated by the integrated circuit chip.
1236    pub application_cryptogram: Option<String>,
1237
1238    /// Mnenomic of the Application Identifier.
1239    pub application_preferred_name: Option<String>,
1240
1241    /// Identifier for this transaction.
1242    pub authorization_code: Option<String>,
1243
1244    /// EMV tag 8A.
1245    ///
1246    /// A code returned by the card issuer.
1247    pub authorization_response_code: Option<String>,
1248
1249    /// How the cardholder verified ownership of the card.
1250    pub cardholder_verification_method: Option<String>,
1251
1252    /// EMV tag 84.
1253    ///
1254    /// Similar to the application identifier stored on the integrated circuit chip.
1255    pub dedicated_file_name: Option<String>,
1256
1257    /// The outcome of a series of EMV functions performed by the card reader.
1258    pub terminal_verification_results: Option<String>,
1259
1260    /// An indication of various EMV functions performed during the transaction.
1261    pub transaction_status_information: Option<String>,
1262}
1263
1264#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1265pub struct PaymentMethodDetailsKlarna {
1266    /// The Klarna payment method used for this transaction.
1267    /// Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments`.
1268    pub payment_method_category: Option<String>,
1269
1270    /// Preferred language of the Klarna authorization page that the customer is redirected to.
1271    /// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH`.
1272    pub preferred_locale: Option<String>,
1273}
1274
1275#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1276pub struct PaymentMethodDetailsKonbini {
1277    /// If the payment succeeded, this contains the details of the convenience store where the payment was completed.
1278    pub store: Option<PaymentMethodDetailsKonbiniStore>,
1279}
1280
1281#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1282pub struct PaymentMethodDetailsKonbiniStore {
1283    /// The name of the convenience store chain where the payment was completed.
1284    pub chain: Option<PaymentMethodDetailsKonbiniStoreChain>,
1285}
1286
1287#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1288pub struct PaymentMethodDetailsLink {
1289    /// Two-letter ISO code representing the funding source country beneath the Link payment.
1290    /// You could use this attribute to get a sense of international fees.
1291    pub country: Option<String>,
1292}
1293
1294#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1295pub struct PaymentMethodDetailsMultibanco {
1296    /// Entity number associated with this Multibanco payment.
1297    pub entity: Option<String>,
1298
1299    /// Reference number associated with this Multibanco payment.
1300    pub reference: Option<String>,
1301}
1302
1303#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1304pub struct PaymentMethodDetailsOxxo {
1305    /// OXXO reference number.
1306    pub number: Option<String>,
1307}
1308
1309#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1310pub struct PaymentMethodDetailsP24 {
1311    /// The customer's bank.
1312    ///
1313    /// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`.
1314    pub bank: Option<PaymentMethodDetailsP24Bank>,
1315
1316    /// Unique reference for this Przelewy24 payment.
1317    pub reference: Option<String>,
1318
1319    /// Owner's verified full name.
1320    ///
1321    /// Values are verified or provided by Przelewy24 directly (if supported) at the time of authorization or settlement.
1322    /// They cannot be set or mutated. Przelewy24 rarely provides this information so the attribute is usually empty.
1323    pub verified_name: Option<String>,
1324}
1325
1326#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1327pub struct PaymentMethodDetailsPaynow {
1328    /// Reference number associated with this PayNow payment.
1329    pub reference: Option<String>,
1330}
1331
1332#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1333pub struct PaymentMethodDetailsPaypal {
1334    /// Owner's email.
1335    ///
1336    /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement.
1337    /// They cannot be set or mutated.
1338    pub payer_email: Option<String>,
1339
1340    /// PayPal account PayerID.
1341    ///
1342    /// This identifier uniquely identifies the PayPal customer.
1343    pub payer_id: Option<String>,
1344
1345    /// Owner's full name.
1346    ///
1347    /// Values provided by PayPal directly (if supported) at the time of authorization or settlement.
1348    /// They cannot be set or mutated.
1349    pub payer_name: Option<String>,
1350
1351    /// The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction.
1352    pub seller_protection: Option<PaypalSellerProtection>,
1353
1354    /// A unique ID generated by PayPal for this transaction.
1355    pub transaction_id: Option<String>,
1356}
1357
1358#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1359pub struct PaymentMethodDetailsPix {
1360    /// Unique transaction id generated by BCB.
1361    #[serde(skip_serializing_if = "Option::is_none")]
1362    pub bank_transaction_id: Option<String>,
1363}
1364
1365#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1366pub struct PaymentMethodDetailsPromptpay {
1367    /// Bill reference generated by PromptPay.
1368    pub reference: Option<String>,
1369}
1370
1371#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1372pub struct PaymentMethodDetailsRevolutPay {}
1373
1374#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1375pub struct PaymentMethodDetailsSepaCreditTransfer {
1376    /// Name of the bank associated with the bank account.
1377    pub bank_name: Option<String>,
1378
1379    /// Bank Identifier Code of the bank associated with the bank account.
1380    pub bic: Option<String>,
1381
1382    /// IBAN of the bank account to transfer funds to.
1383    pub iban: Option<String>,
1384}
1385
1386#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1387pub struct PaymentMethodDetailsSepaDebit {
1388    /// Bank code of bank associated with the bank account.
1389    pub bank_code: Option<String>,
1390
1391    /// Branch code of bank associated with the bank account.
1392    pub branch_code: Option<String>,
1393
1394    /// Two-letter ISO code representing the country the bank account is located in.
1395    pub country: Option<String>,
1396
1397    /// Uniquely identifies this particular bank account.
1398    ///
1399    /// You can use this attribute to check whether two bank accounts are the same.
1400    pub fingerprint: Option<String>,
1401
1402    /// Last four characters of the IBAN.
1403    pub last4: Option<String>,
1404
1405    /// Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge.
1406    ///
1407    /// Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve).
1408    pub mandate: Option<String>,
1409}
1410
1411#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1412pub struct PaymentMethodDetailsSofort {
1413    /// Bank code of bank associated with the bank account.
1414    pub bank_code: Option<String>,
1415
1416    /// Name of the bank associated with the bank account.
1417    pub bank_name: Option<String>,
1418
1419    /// Bank Identifier Code of the bank associated with the bank account.
1420    pub bic: Option<String>,
1421
1422    /// Two-letter ISO code representing the country the bank account is located in.
1423    pub country: Option<String>,
1424
1425    /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge.
1426    pub generated_sepa_debit: Option<Expandable<PaymentMethod>>,
1427
1428    /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge.
1429    pub generated_sepa_debit_mandate: Option<Expandable<Mandate>>,
1430
1431    /// Last four characters of the IBAN.
1432    pub iban_last4: Option<String>,
1433
1434    /// Preferred language of the SOFORT authorization page that the customer is redirected to.
1435    /// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl`.
1436    pub preferred_language: Option<PaymentMethodDetailsSofortPreferredLanguage>,
1437
1438    /// Owner's verified full name.
1439    ///
1440    /// Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement.
1441    /// They cannot be set or mutated.
1442    pub verified_name: Option<String>,
1443}
1444
1445#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1446pub struct PaymentMethodDetailsStripeAccount {}
1447
1448#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1449pub struct PaymentMethodDetailsSwish {
1450    /// Uniquely identifies the payer's Swish account.
1451    ///
1452    /// You can use this attribute to check whether two Swish transactions were paid for by the same payer.
1453    pub fingerprint: Option<String>,
1454
1455    /// Payer bank reference number for the payment.
1456    pub payment_reference: Option<String>,
1457
1458    /// The last four digits of the Swish account phone number.
1459    pub verified_phone_last4: Option<String>,
1460}
1461
1462#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1463pub struct PaymentMethodDetailsUsBankAccount {
1464    /// Account holder type: individual or company.
1465    pub account_holder_type: Option<PaymentMethodDetailsUsBankAccountAccountHolderType>,
1466
1467    /// Account type: checkings or savings.
1468    ///
1469    /// Defaults to checking if omitted.
1470    pub account_type: Option<PaymentMethodDetailsUsBankAccountAccountType>,
1471
1472    /// Name of the bank associated with the bank account.
1473    pub bank_name: Option<String>,
1474
1475    /// Uniquely identifies this particular bank account.
1476    ///
1477    /// You can use this attribute to check whether two bank accounts are the same.
1478    pub fingerprint: Option<String>,
1479
1480    /// Last four digits of the bank account number.
1481    pub last4: Option<String>,
1482
1483    /// Routing number of the bank account.
1484    pub routing_number: Option<String>,
1485}
1486
1487#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1488pub struct PaymentMethodDetailsWechat {}
1489
1490#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1491pub struct PaymentMethodDetailsWechatPay {
1492    /// Uniquely identifies this particular WeChat Pay account.
1493    ///
1494    /// You can use this attribute to check whether two WeChat accounts are the same.
1495    pub fingerprint: Option<String>,
1496
1497    /// Transaction ID of this particular WeChat Pay transaction.
1498    pub transaction_id: Option<String>,
1499}
1500
1501#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1502pub struct PaymentMethodDetailsZip {}
1503
1504#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1505pub struct PaypalSellerProtection {
1506    /// An array of conditions that are covered for the transaction, if applicable.
1507    pub dispute_categories: Option<Vec<PaypalSellerProtectionDisputeCategories>>,
1508
1509    /// Indicates whether the transaction is eligible for PayPal's seller protection.
1510    pub status: PaypalSellerProtectionStatus,
1511}
1512
1513#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1514pub struct Rule {
1515    /// The action taken on the payment.
1516    pub action: String,
1517
1518    /// Unique identifier for the object.
1519    pub id: String,
1520
1521    /// The predicate to evaluate the payment against.
1522    pub predicate: String,
1523}
1524
1525#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1526pub struct ThreeDSecureDetailsCharge {
1527    /// For authenticated transactions: how the customer was authenticated by
1528    /// the issuing bank.
1529    pub authentication_flow: Option<ThreeDSecureDetailsChargeAuthenticationFlow>,
1530
1531    /// The Electronic Commerce Indicator (ECI).
1532    ///
1533    /// A protocol-level field indicating what degree of authentication was performed.
1534    pub electronic_commerce_indicator: Option<ThreeDSecureDetailsChargeElectronicCommerceIndicator>,
1535
1536    /// The exemption requested via 3DS and accepted by the issuer at authentication time.
1537    pub exemption_indicator: Option<ThreeDSecureDetailsChargeExemptionIndicator>,
1538
1539    /// Whether Stripe requested the value of `exemption_indicator` in the transaction.
1540    ///
1541    /// This will depend on the outcome of Stripe's internal risk assessment.
1542    #[serde(skip_serializing_if = "Option::is_none")]
1543    pub exemption_indicator_applied: Option<bool>,
1544
1545    /// Indicates the outcome of 3D Secure authentication.
1546    pub result: Option<ThreeDSecureDetailsChargeResult>,
1547
1548    /// Additional information about why 3D Secure succeeded or failed based
1549    /// on the `result`.
1550    pub result_reason: Option<ThreeDSecureDetailsChargeResultReason>,
1551
1552    /// The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID
1553    /// (dsTransId) for this payment.
1554    pub transaction_id: Option<String>,
1555
1556    /// The version of 3D Secure that was used.
1557    pub version: Option<ThreeDSecureDetailsChargeVersion>,
1558}
1559
1560/// The parameters for `Charge::create`.
1561#[derive(Clone, Debug, Serialize, Default)]
1562pub struct CreateCharge<'a> {
1563    /// Amount intended to be collected by this payment.
1564    ///
1565    /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
1566    /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
1567    /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
1568    #[serde(skip_serializing_if = "Option::is_none")]
1569    pub amount: Option<i64>,
1570
1571    #[serde(skip_serializing_if = "Option::is_none")]
1572    pub application_fee: Option<i64>,
1573
1574    /// A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account.
1575    ///
1576    /// The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee.
1577    /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees).
1578    #[serde(skip_serializing_if = "Option::is_none")]
1579    pub application_fee_amount: Option<i64>,
1580
1581    /// Whether to immediately capture the charge.
1582    ///
1583    /// Defaults to `true`.
1584    /// When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later.
1585    /// Uncaptured charges expire after a set number of days (7 by default).
1586    /// For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation.
1587    #[serde(skip_serializing_if = "Option::is_none")]
1588    pub capture: Option<bool>,
1589
1590    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
1591    ///
1592    /// Must be a [supported currency](https://stripe.com/docs/currencies).
1593    #[serde(skip_serializing_if = "Option::is_none")]
1594    pub currency: Option<Currency>,
1595
1596    /// The ID of an existing customer that will be charged in this request.
1597    #[serde(skip_serializing_if = "Option::is_none")]
1598    pub customer: Option<CustomerId>,
1599
1600    /// An arbitrary string which you can attach to a `Charge` object.
1601    ///
1602    /// It is displayed when in the web interface alongside the charge.
1603    /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing.
1604    #[serde(skip_serializing_if = "Option::is_none")]
1605    pub description: Option<&'a str>,
1606
1607    #[serde(skip_serializing_if = "Option::is_none")]
1608    pub destination: Option<DestinationSpecs>,
1609
1610    /// Specifies which fields in the response should be expanded.
1611    #[serde(skip_serializing_if = "Expand::is_empty")]
1612    pub expand: &'a [&'a str],
1613
1614    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1615    ///
1616    /// This can be useful for storing additional information about the object in a structured format.
1617    /// Individual keys can be unset by posting an empty value to them.
1618    /// All keys can be unset by posting an empty value to `metadata`.
1619    #[serde(skip_serializing_if = "Option::is_none")]
1620    pub metadata: Option<Metadata>,
1621
1622    /// The Stripe account ID for which these funds are intended.
1623    ///
1624    /// Automatically set if you use the `destination` parameter.
1625    /// For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of).
1626    #[serde(skip_serializing_if = "Option::is_none")]
1627    pub on_behalf_of: Option<&'a str>,
1628
1629    /// Options to configure Radar.
1630    ///
1631    /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
1632    #[serde(skip_serializing_if = "Option::is_none")]
1633    pub radar_options: Option<CreateChargeRadarOptions>,
1634
1635    /// The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent.
1636    ///
1637    /// The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges.
1638    /// If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address.
1639    /// If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
1640    #[serde(skip_serializing_if = "Option::is_none")]
1641    pub receipt_email: Option<&'a str>,
1642
1643    /// Shipping information for the charge.
1644    ///
1645    /// Helps prevent fraud on charges for physical goods.
1646    #[serde(skip_serializing_if = "Option::is_none")]
1647    pub shipping: Option<Shipping>,
1648
1649    /// A payment source to be charged.
1650    ///
1651    /// This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account).
1652    /// For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer.
1653    #[serde(skip_serializing_if = "Option::is_none")]
1654    pub source: Option<ChargeSourceParams>,
1655
1656    /// For card charges, use `statement_descriptor_suffix` instead.
1657    ///
1658    /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements.
1659    /// Must contain at least one letter, maximum 22 characters.
1660    #[serde(skip_serializing_if = "Option::is_none")]
1661    pub statement_descriptor: Option<&'a str>,
1662
1663    /// Provides information about the charge that customers see on their statements.
1664    ///
1665    /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor.
1666    /// Maximum 22 characters for the concatenated descriptor.
1667    #[serde(skip_serializing_if = "Option::is_none")]
1668    pub statement_descriptor_suffix: Option<&'a str>,
1669
1670    /// An optional dictionary including the account to automatically transfer to as part of a destination charge.
1671    ///
1672    /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details.
1673    #[serde(skip_serializing_if = "Option::is_none")]
1674    pub transfer_data: Option<TransferDataParams>,
1675
1676    /// A string that identifies this transaction as part of a group.
1677    ///
1678    /// For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options).
1679    #[serde(skip_serializing_if = "Option::is_none")]
1680    pub transfer_group: Option<&'a str>,
1681}
1682
1683impl<'a> CreateCharge<'a> {
1684    pub fn new() -> Self {
1685        CreateCharge {
1686            amount: Default::default(),
1687            application_fee: Default::default(),
1688            application_fee_amount: Default::default(),
1689            capture: Default::default(),
1690            currency: Default::default(),
1691            customer: Default::default(),
1692            description: Default::default(),
1693            destination: Default::default(),
1694            expand: Default::default(),
1695            metadata: Default::default(),
1696            on_behalf_of: Default::default(),
1697            radar_options: Default::default(),
1698            receipt_email: Default::default(),
1699            shipping: Default::default(),
1700            source: Default::default(),
1701            statement_descriptor: Default::default(),
1702            statement_descriptor_suffix: Default::default(),
1703            transfer_data: Default::default(),
1704            transfer_group: Default::default(),
1705        }
1706    }
1707}
1708
1709/// The parameters for `Charge::list`.
1710#[derive(Clone, Debug, Serialize, Default)]
1711pub struct ListCharges<'a> {
1712    #[serde(skip_serializing_if = "Option::is_none")]
1713    pub created: Option<RangeQuery<Timestamp>>,
1714
1715    /// Only return charges for the customer specified by this customer ID.
1716    #[serde(skip_serializing_if = "Option::is_none")]
1717    pub customer: Option<CustomerId>,
1718
1719    /// A cursor for use in pagination.
1720    ///
1721    /// `ending_before` is an object ID that defines your place in the list.
1722    /// 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.
1723    #[serde(skip_serializing_if = "Option::is_none")]
1724    pub ending_before: Option<ChargeId>,
1725
1726    /// Specifies which fields in the response should be expanded.
1727    #[serde(skip_serializing_if = "Expand::is_empty")]
1728    pub expand: &'a [&'a str],
1729
1730    /// A limit on the number of objects to be returned.
1731    ///
1732    /// Limit can range between 1 and 100, and the default is 10.
1733    #[serde(skip_serializing_if = "Option::is_none")]
1734    pub limit: Option<u64>,
1735
1736    /// Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID.
1737    #[serde(skip_serializing_if = "Option::is_none")]
1738    pub payment_intent: Option<PaymentIntentId>,
1739
1740    /// A cursor for use in pagination.
1741    ///
1742    /// `starting_after` is an object ID that defines your place in the list.
1743    /// 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.
1744    #[serde(skip_serializing_if = "Option::is_none")]
1745    pub starting_after: Option<ChargeId>,
1746
1747    /// Only return charges for this transfer group.
1748    #[serde(skip_serializing_if = "Option::is_none")]
1749    pub transfer_group: Option<&'a str>,
1750}
1751
1752impl<'a> ListCharges<'a> {
1753    pub fn new() -> Self {
1754        ListCharges {
1755            created: Default::default(),
1756            customer: Default::default(),
1757            ending_before: Default::default(),
1758            expand: Default::default(),
1759            limit: Default::default(),
1760            payment_intent: Default::default(),
1761            starting_after: Default::default(),
1762            transfer_group: Default::default(),
1763        }
1764    }
1765}
1766impl Paginable for ListCharges<'_> {
1767    type O = Charge;
1768    fn set_last(&mut self, item: Self::O) {
1769        self.starting_after = Some(item.id());
1770    }
1771}
1772/// The parameters for `Charge::update`.
1773#[derive(Clone, Debug, Serialize, Default)]
1774pub struct UpdateCharge<'a> {
1775    /// The ID of an existing customer that will be associated with this request.
1776    ///
1777    /// This field may only be updated if there is no existing associated customer with this charge.
1778    #[serde(skip_serializing_if = "Option::is_none")]
1779    pub customer: Option<CustomerId>,
1780
1781    /// An arbitrary string which you can attach to a charge object.
1782    ///
1783    /// It is displayed when in the web interface alongside the charge.
1784    /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing.
1785    #[serde(skip_serializing_if = "Option::is_none")]
1786    pub description: Option<&'a str>,
1787
1788    /// Specifies which fields in the response should be expanded.
1789    #[serde(skip_serializing_if = "Expand::is_empty")]
1790    pub expand: &'a [&'a str],
1791
1792    /// A set of key-value pairs you can attach to a charge giving information about its riskiness.
1793    ///
1794    /// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`.
1795    /// If you believe a charge is safe, include a `user_report` key with a value of `safe`.
1796    /// Stripe will use the information you send to improve our fraud detection algorithms.
1797    #[serde(skip_serializing_if = "Option::is_none")]
1798    pub fraud_details: Option<FraudDetailsParams>,
1799
1800    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1801    ///
1802    /// This can be useful for storing additional information about the object in a structured format.
1803    /// Individual keys can be unset by posting an empty value to them.
1804    /// All keys can be unset by posting an empty value to `metadata`.
1805    #[serde(skip_serializing_if = "Option::is_none")]
1806    pub metadata: Option<Metadata>,
1807
1808    /// This is the email address that the receipt for this charge will be sent to.
1809    ///
1810    /// If this field is updated, then a new email receipt will be sent to the updated address.
1811    #[serde(skip_serializing_if = "Option::is_none")]
1812    pub receipt_email: Option<&'a str>,
1813
1814    /// Shipping information for the charge.
1815    ///
1816    /// Helps prevent fraud on charges for physical goods.
1817    #[serde(skip_serializing_if = "Option::is_none")]
1818    pub shipping: Option<Shipping>,
1819
1820    /// A string that identifies this transaction as part of a group.
1821    ///
1822    /// `transfer_group` may only be provided if it has not been set.
1823    /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details.
1824    #[serde(skip_serializing_if = "Option::is_none")]
1825    pub transfer_group: Option<&'a str>,
1826}
1827
1828impl<'a> UpdateCharge<'a> {
1829    pub fn new() -> Self {
1830        UpdateCharge {
1831            customer: Default::default(),
1832            description: Default::default(),
1833            expand: Default::default(),
1834            fraud_details: Default::default(),
1835            metadata: Default::default(),
1836            receipt_email: Default::default(),
1837            shipping: Default::default(),
1838            transfer_group: Default::default(),
1839        }
1840    }
1841}
1842
1843#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1844pub struct CreateChargeRadarOptions {
1845    /// 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.
1846    #[serde(skip_serializing_if = "Option::is_none")]
1847    pub session: Option<String>,
1848}
1849
1850#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1851pub struct FraudDetailsParams {
1852    /// Either `safe` or `fraudulent`.
1853    pub user_report: FraudDetailsParamsUserReport,
1854}
1855
1856#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1857pub struct TransferDataParams {
1858    /// The amount transferred to the destination account, if specified.
1859    ///
1860    /// By default, the entire charge amount is transferred to the destination account.
1861    #[serde(skip_serializing_if = "Option::is_none")]
1862    pub amount: Option<i64>,
1863
1864    /// ID of an existing, connected Stripe account.
1865    pub destination: String,
1866}
1867
1868/// An enum representing the possible values of an `Charge`'s `status` field.
1869#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1870#[serde(rename_all = "snake_case")]
1871pub enum ChargeStatus {
1872    Failed,
1873    Pending,
1874    Succeeded,
1875}
1876
1877impl ChargeStatus {
1878    pub fn as_str(self) -> &'static str {
1879        match self {
1880            ChargeStatus::Failed => "failed",
1881            ChargeStatus::Pending => "pending",
1882            ChargeStatus::Succeeded => "succeeded",
1883        }
1884    }
1885}
1886
1887impl AsRef<str> for ChargeStatus {
1888    fn as_ref(&self) -> &str {
1889        self.as_str()
1890    }
1891}
1892
1893impl std::fmt::Display for ChargeStatus {
1894    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1895        self.as_str().fmt(f)
1896    }
1897}
1898impl std::default::Default for ChargeStatus {
1899    fn default() -> Self {
1900        Self::Failed
1901    }
1902}
1903
1904/// An enum representing the possible values of an `FraudDetailsParams`'s `user_report` field.
1905#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1906#[serde(rename_all = "snake_case")]
1907pub enum FraudDetailsParamsUserReport {
1908    Fraudulent,
1909    Safe,
1910}
1911
1912impl FraudDetailsParamsUserReport {
1913    pub fn as_str(self) -> &'static str {
1914        match self {
1915            FraudDetailsParamsUserReport::Fraudulent => "fraudulent",
1916            FraudDetailsParamsUserReport::Safe => "safe",
1917        }
1918    }
1919}
1920
1921impl AsRef<str> for FraudDetailsParamsUserReport {
1922    fn as_ref(&self) -> &str {
1923        self.as_str()
1924    }
1925}
1926
1927impl std::fmt::Display for FraudDetailsParamsUserReport {
1928    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1929        self.as_str().fmt(f)
1930    }
1931}
1932impl std::default::Default for FraudDetailsParamsUserReport {
1933    fn default() -> Self {
1934        Self::Fraudulent
1935    }
1936}
1937
1938/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization`'s `status` field.
1939#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1940#[serde(rename_all = "snake_case")]
1941pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus
1942{
1943    Disabled,
1944    Enabled,
1945}
1946
1947impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus {
1948    pub fn as_str(self) -> &'static str {
1949        match self {
1950            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::Disabled => "disabled",
1951            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::Enabled => "enabled",
1952        }
1953    }
1954}
1955
1956impl AsRef<str> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus {
1957    fn as_ref(&self) -> &str {
1958        self.as_str()
1959    }
1960}
1961
1962impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus {
1963    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1964        self.as_str().fmt(f)
1965    }
1966}
1967impl std::default::Default for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus {
1968    fn default() -> Self {
1969        Self::Disabled
1970    }
1971}
1972
1973/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization`'s `status` field.
1974#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1975#[serde(rename_all = "snake_case")]
1976pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus
1977{
1978    Available,
1979    Unavailable,
1980}
1981
1982impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus {
1983    pub fn as_str(self) -> &'static str {
1984        match self {
1985            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::Available => "available",
1986            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::Unavailable => "unavailable",
1987        }
1988    }
1989}
1990
1991impl AsRef<str> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus {
1992    fn as_ref(&self) -> &str {
1993        self.as_str()
1994    }
1995}
1996
1997impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus {
1998    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1999        self.as_str().fmt(f)
2000    }
2001}
2002impl std::default::Default for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus {
2003    fn default() -> Self {
2004        Self::Available
2005    }
2006}
2007
2008/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture`'s `status` field.
2009#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2010#[serde(rename_all = "snake_case")]
2011pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus
2012{
2013    Available,
2014    Unavailable,
2015}
2016
2017impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus {
2018    pub fn as_str(self) -> &'static str {
2019        match self {
2020            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::Available => "available",
2021            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::Unavailable => "unavailable",
2022        }
2023    }
2024}
2025
2026impl AsRef<str> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus {
2027    fn as_ref(&self) -> &str {
2028        self.as_str()
2029    }
2030}
2031
2032impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus {
2033    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2034        self.as_str().fmt(f)
2035    }
2036}
2037impl std::default::Default for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus {
2038    fn default() -> Self {
2039        Self::Available
2040    }
2041}
2042
2043/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture`'s `status` field.
2044#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2045#[serde(rename_all = "snake_case")]
2046pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus {
2047    Available,
2048    Unavailable,
2049}
2050
2051impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus {
2052    pub fn as_str(self) -> &'static str {
2053        match self {
2054            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::Available => "available",
2055            PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::Unavailable => "unavailable",
2056        }
2057    }
2058}
2059
2060impl AsRef<str> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus {
2061    fn as_ref(&self) -> &str {
2062        self.as_str()
2063    }
2064}
2065
2066impl std::fmt::Display
2067    for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus
2068{
2069    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2070        self.as_str().fmt(f)
2071    }
2072}
2073impl std::default::Default
2074    for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus
2075{
2076    fn default() -> Self {
2077        Self::Available
2078    }
2079}
2080
2081/// An enum representing the possible values of an `PaymentMethodDetailsAchDebit`'s `account_holder_type` field.
2082#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2083#[serde(rename_all = "snake_case")]
2084pub enum PaymentMethodDetailsAchDebitAccountHolderType {
2085    Company,
2086    Individual,
2087}
2088
2089impl PaymentMethodDetailsAchDebitAccountHolderType {
2090    pub fn as_str(self) -> &'static str {
2091        match self {
2092            PaymentMethodDetailsAchDebitAccountHolderType::Company => "company",
2093            PaymentMethodDetailsAchDebitAccountHolderType::Individual => "individual",
2094        }
2095    }
2096}
2097
2098impl AsRef<str> for PaymentMethodDetailsAchDebitAccountHolderType {
2099    fn as_ref(&self) -> &str {
2100        self.as_str()
2101    }
2102}
2103
2104impl std::fmt::Display for PaymentMethodDetailsAchDebitAccountHolderType {
2105    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2106        self.as_str().fmt(f)
2107    }
2108}
2109impl std::default::Default for PaymentMethodDetailsAchDebitAccountHolderType {
2110    fn default() -> Self {
2111        Self::Company
2112    }
2113}
2114
2115/// An enum representing the possible values of an `PaymentMethodDetailsBancontact`'s `preferred_language` field.
2116#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2117#[serde(rename_all = "snake_case")]
2118pub enum PaymentMethodDetailsBancontactPreferredLanguage {
2119    De,
2120    En,
2121    Fr,
2122    Nl,
2123}
2124
2125impl PaymentMethodDetailsBancontactPreferredLanguage {
2126    pub fn as_str(self) -> &'static str {
2127        match self {
2128            PaymentMethodDetailsBancontactPreferredLanguage::De => "de",
2129            PaymentMethodDetailsBancontactPreferredLanguage::En => "en",
2130            PaymentMethodDetailsBancontactPreferredLanguage::Fr => "fr",
2131            PaymentMethodDetailsBancontactPreferredLanguage::Nl => "nl",
2132        }
2133    }
2134}
2135
2136impl AsRef<str> for PaymentMethodDetailsBancontactPreferredLanguage {
2137    fn as_ref(&self) -> &str {
2138        self.as_str()
2139    }
2140}
2141
2142impl std::fmt::Display for PaymentMethodDetailsBancontactPreferredLanguage {
2143    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2144        self.as_str().fmt(f)
2145    }
2146}
2147impl std::default::Default for PaymentMethodDetailsBancontactPreferredLanguage {
2148    fn default() -> Self {
2149        Self::De
2150    }
2151}
2152
2153/// An enum representing the possible values of an `PaymentMethodDetailsCardPresent`'s `read_method` field.
2154#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2155#[serde(rename_all = "snake_case")]
2156pub enum PaymentMethodDetailsCardPresentReadMethod {
2157    ContactEmv,
2158    ContactlessEmv,
2159    ContactlessMagstripeMode,
2160    MagneticStripeFallback,
2161    MagneticStripeTrack2,
2162}
2163
2164impl PaymentMethodDetailsCardPresentReadMethod {
2165    pub fn as_str(self) -> &'static str {
2166        match self {
2167            PaymentMethodDetailsCardPresentReadMethod::ContactEmv => "contact_emv",
2168            PaymentMethodDetailsCardPresentReadMethod::ContactlessEmv => "contactless_emv",
2169            PaymentMethodDetailsCardPresentReadMethod::ContactlessMagstripeMode => {
2170                "contactless_magstripe_mode"
2171            }
2172            PaymentMethodDetailsCardPresentReadMethod::MagneticStripeFallback => {
2173                "magnetic_stripe_fallback"
2174            }
2175            PaymentMethodDetailsCardPresentReadMethod::MagneticStripeTrack2 => {
2176                "magnetic_stripe_track2"
2177            }
2178        }
2179    }
2180}
2181
2182impl AsRef<str> for PaymentMethodDetailsCardPresentReadMethod {
2183    fn as_ref(&self) -> &str {
2184        self.as_str()
2185    }
2186}
2187
2188impl std::fmt::Display for PaymentMethodDetailsCardPresentReadMethod {
2189    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2190        self.as_str().fmt(f)
2191    }
2192}
2193impl std::default::Default for PaymentMethodDetailsCardPresentReadMethod {
2194    fn default() -> Self {
2195        Self::ContactEmv
2196    }
2197}
2198
2199/// An enum representing the possible values of an `PaymentMethodDetailsCardPresentReceipt`'s `account_type` field.
2200#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2201#[serde(rename_all = "snake_case")]
2202pub enum PaymentMethodDetailsCardPresentReceiptAccountType {
2203    Checking,
2204    Credit,
2205    Prepaid,
2206    Unknown,
2207}
2208
2209impl PaymentMethodDetailsCardPresentReceiptAccountType {
2210    pub fn as_str(self) -> &'static str {
2211        match self {
2212            PaymentMethodDetailsCardPresentReceiptAccountType::Checking => "checking",
2213            PaymentMethodDetailsCardPresentReceiptAccountType::Credit => "credit",
2214            PaymentMethodDetailsCardPresentReceiptAccountType::Prepaid => "prepaid",
2215            PaymentMethodDetailsCardPresentReceiptAccountType::Unknown => "unknown",
2216        }
2217    }
2218}
2219
2220impl AsRef<str> for PaymentMethodDetailsCardPresentReceiptAccountType {
2221    fn as_ref(&self) -> &str {
2222        self.as_str()
2223    }
2224}
2225
2226impl std::fmt::Display for PaymentMethodDetailsCardPresentReceiptAccountType {
2227    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2228        self.as_str().fmt(f)
2229    }
2230}
2231impl std::default::Default for PaymentMethodDetailsCardPresentReceiptAccountType {
2232    fn default() -> Self {
2233        Self::Checking
2234    }
2235}
2236
2237/// An enum representing the possible values of an `PaymentMethodDetailsCardWallet`'s `type` field.
2238#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2239#[serde(rename_all = "snake_case")]
2240pub enum PaymentMethodDetailsCardWalletType {
2241    AmexExpressCheckout,
2242    ApplePay,
2243    GooglePay,
2244    Link,
2245    Masterpass,
2246    SamsungPay,
2247    VisaCheckout,
2248}
2249
2250impl PaymentMethodDetailsCardWalletType {
2251    pub fn as_str(self) -> &'static str {
2252        match self {
2253            PaymentMethodDetailsCardWalletType::AmexExpressCheckout => "amex_express_checkout",
2254            PaymentMethodDetailsCardWalletType::ApplePay => "apple_pay",
2255            PaymentMethodDetailsCardWalletType::GooglePay => "google_pay",
2256            PaymentMethodDetailsCardWalletType::Link => "link",
2257            PaymentMethodDetailsCardWalletType::Masterpass => "masterpass",
2258            PaymentMethodDetailsCardWalletType::SamsungPay => "samsung_pay",
2259            PaymentMethodDetailsCardWalletType::VisaCheckout => "visa_checkout",
2260        }
2261    }
2262}
2263
2264impl AsRef<str> for PaymentMethodDetailsCardWalletType {
2265    fn as_ref(&self) -> &str {
2266        self.as_str()
2267    }
2268}
2269
2270impl std::fmt::Display for PaymentMethodDetailsCardWalletType {
2271    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2272        self.as_str().fmt(f)
2273    }
2274}
2275impl std::default::Default for PaymentMethodDetailsCardWalletType {
2276    fn default() -> Self {
2277        Self::AmexExpressCheckout
2278    }
2279}
2280
2281/// An enum representing the possible values of an `PaymentMethodDetailsEps`'s `bank` field.
2282#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2283#[serde(rename_all = "snake_case")]
2284pub enum PaymentMethodDetailsEpsBank {
2285    ArzteUndApothekerBank,
2286    AustrianAnadiBankAg,
2287    BankAustria,
2288    BankhausCarlSpangler,
2289    BankhausSchelhammerUndSchatteraAg,
2290    BawagPskAg,
2291    BksBankAg,
2292    BrullKallmusBankAg,
2293    BtvVierLanderBank,
2294    CapitalBankGraweGruppeAg,
2295    DeutscheBankAg,
2296    Dolomitenbank,
2297    EasybankAg,
2298    ErsteBankUndSparkassen,
2299    HypoAlpeadriabankInternationalAg,
2300    HypoBankBurgenlandAktiengesellschaft,
2301    HypoNoeLbFurNiederosterreichUWien,
2302    HypoOberosterreichSalzburgSteiermark,
2303    HypoTirolBankAg,
2304    HypoVorarlbergBankAg,
2305    MarchfelderBank,
2306    OberbankAg,
2307    RaiffeisenBankengruppeOsterreich,
2308    SchoellerbankAg,
2309    SpardaBankWien,
2310    VolksbankGruppe,
2311    VolkskreditbankAg,
2312    VrBankBraunau,
2313}
2314
2315impl PaymentMethodDetailsEpsBank {
2316    pub fn as_str(self) -> &'static str {
2317        match self {
2318            PaymentMethodDetailsEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank",
2319            PaymentMethodDetailsEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag",
2320            PaymentMethodDetailsEpsBank::BankAustria => "bank_austria",
2321            PaymentMethodDetailsEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler",
2322            PaymentMethodDetailsEpsBank::BankhausSchelhammerUndSchatteraAg => {
2323                "bankhaus_schelhammer_und_schattera_ag"
2324            }
2325            PaymentMethodDetailsEpsBank::BawagPskAg => "bawag_psk_ag",
2326            PaymentMethodDetailsEpsBank::BksBankAg => "bks_bank_ag",
2327            PaymentMethodDetailsEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag",
2328            PaymentMethodDetailsEpsBank::BtvVierLanderBank => "btv_vier_lander_bank",
2329            PaymentMethodDetailsEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag",
2330            PaymentMethodDetailsEpsBank::DeutscheBankAg => "deutsche_bank_ag",
2331            PaymentMethodDetailsEpsBank::Dolomitenbank => "dolomitenbank",
2332            PaymentMethodDetailsEpsBank::EasybankAg => "easybank_ag",
2333            PaymentMethodDetailsEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen",
2334            PaymentMethodDetailsEpsBank::HypoAlpeadriabankInternationalAg => {
2335                "hypo_alpeadriabank_international_ag"
2336            }
2337            PaymentMethodDetailsEpsBank::HypoBankBurgenlandAktiengesellschaft => {
2338                "hypo_bank_burgenland_aktiengesellschaft"
2339            }
2340            PaymentMethodDetailsEpsBank::HypoNoeLbFurNiederosterreichUWien => {
2341                "hypo_noe_lb_fur_niederosterreich_u_wien"
2342            }
2343            PaymentMethodDetailsEpsBank::HypoOberosterreichSalzburgSteiermark => {
2344                "hypo_oberosterreich_salzburg_steiermark"
2345            }
2346            PaymentMethodDetailsEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag",
2347            PaymentMethodDetailsEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag",
2348            PaymentMethodDetailsEpsBank::MarchfelderBank => "marchfelder_bank",
2349            PaymentMethodDetailsEpsBank::OberbankAg => "oberbank_ag",
2350            PaymentMethodDetailsEpsBank::RaiffeisenBankengruppeOsterreich => {
2351                "raiffeisen_bankengruppe_osterreich"
2352            }
2353            PaymentMethodDetailsEpsBank::SchoellerbankAg => "schoellerbank_ag",
2354            PaymentMethodDetailsEpsBank::SpardaBankWien => "sparda_bank_wien",
2355            PaymentMethodDetailsEpsBank::VolksbankGruppe => "volksbank_gruppe",
2356            PaymentMethodDetailsEpsBank::VolkskreditbankAg => "volkskreditbank_ag",
2357            PaymentMethodDetailsEpsBank::VrBankBraunau => "vr_bank_braunau",
2358        }
2359    }
2360}
2361
2362impl AsRef<str> for PaymentMethodDetailsEpsBank {
2363    fn as_ref(&self) -> &str {
2364        self.as_str()
2365    }
2366}
2367
2368impl std::fmt::Display for PaymentMethodDetailsEpsBank {
2369    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2370        self.as_str().fmt(f)
2371    }
2372}
2373impl std::default::Default for PaymentMethodDetailsEpsBank {
2374    fn default() -> Self {
2375        Self::ArzteUndApothekerBank
2376    }
2377}
2378
2379/// An enum representing the possible values of an `PaymentMethodDetailsFpx`'s `account_holder_type` field.
2380#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2381#[serde(rename_all = "snake_case")]
2382pub enum PaymentMethodDetailsFpxAccountHolderType {
2383    Company,
2384    Individual,
2385}
2386
2387impl PaymentMethodDetailsFpxAccountHolderType {
2388    pub fn as_str(self) -> &'static str {
2389        match self {
2390            PaymentMethodDetailsFpxAccountHolderType::Company => "company",
2391            PaymentMethodDetailsFpxAccountHolderType::Individual => "individual",
2392        }
2393    }
2394}
2395
2396impl AsRef<str> for PaymentMethodDetailsFpxAccountHolderType {
2397    fn as_ref(&self) -> &str {
2398        self.as_str()
2399    }
2400}
2401
2402impl std::fmt::Display for PaymentMethodDetailsFpxAccountHolderType {
2403    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2404        self.as_str().fmt(f)
2405    }
2406}
2407impl std::default::Default for PaymentMethodDetailsFpxAccountHolderType {
2408    fn default() -> Self {
2409        Self::Company
2410    }
2411}
2412
2413/// An enum representing the possible values of an `PaymentMethodDetailsFpx`'s `bank` field.
2414#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2415#[serde(rename_all = "snake_case")]
2416pub enum PaymentMethodDetailsFpxBank {
2417    AffinBank,
2418    Agrobank,
2419    AllianceBank,
2420    Ambank,
2421    BankIslam,
2422    BankMuamalat,
2423    BankOfChina,
2424    BankRakyat,
2425    Bsn,
2426    Cimb,
2427    DeutscheBank,
2428    HongLeongBank,
2429    Hsbc,
2430    Kfh,
2431    Maybank2e,
2432    Maybank2u,
2433    Ocbc,
2434    PbEnterprise,
2435    PublicBank,
2436    Rhb,
2437    StandardChartered,
2438    Uob,
2439}
2440
2441impl PaymentMethodDetailsFpxBank {
2442    pub fn as_str(self) -> &'static str {
2443        match self {
2444            PaymentMethodDetailsFpxBank::AffinBank => "affin_bank",
2445            PaymentMethodDetailsFpxBank::Agrobank => "agrobank",
2446            PaymentMethodDetailsFpxBank::AllianceBank => "alliance_bank",
2447            PaymentMethodDetailsFpxBank::Ambank => "ambank",
2448            PaymentMethodDetailsFpxBank::BankIslam => "bank_islam",
2449            PaymentMethodDetailsFpxBank::BankMuamalat => "bank_muamalat",
2450            PaymentMethodDetailsFpxBank::BankOfChina => "bank_of_china",
2451            PaymentMethodDetailsFpxBank::BankRakyat => "bank_rakyat",
2452            PaymentMethodDetailsFpxBank::Bsn => "bsn",
2453            PaymentMethodDetailsFpxBank::Cimb => "cimb",
2454            PaymentMethodDetailsFpxBank::DeutscheBank => "deutsche_bank",
2455            PaymentMethodDetailsFpxBank::HongLeongBank => "hong_leong_bank",
2456            PaymentMethodDetailsFpxBank::Hsbc => "hsbc",
2457            PaymentMethodDetailsFpxBank::Kfh => "kfh",
2458            PaymentMethodDetailsFpxBank::Maybank2e => "maybank2e",
2459            PaymentMethodDetailsFpxBank::Maybank2u => "maybank2u",
2460            PaymentMethodDetailsFpxBank::Ocbc => "ocbc",
2461            PaymentMethodDetailsFpxBank::PbEnterprise => "pb_enterprise",
2462            PaymentMethodDetailsFpxBank::PublicBank => "public_bank",
2463            PaymentMethodDetailsFpxBank::Rhb => "rhb",
2464            PaymentMethodDetailsFpxBank::StandardChartered => "standard_chartered",
2465            PaymentMethodDetailsFpxBank::Uob => "uob",
2466        }
2467    }
2468}
2469
2470impl AsRef<str> for PaymentMethodDetailsFpxBank {
2471    fn as_ref(&self) -> &str {
2472        self.as_str()
2473    }
2474}
2475
2476impl std::fmt::Display for PaymentMethodDetailsFpxBank {
2477    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2478        self.as_str().fmt(f)
2479    }
2480}
2481impl std::default::Default for PaymentMethodDetailsFpxBank {
2482    fn default() -> Self {
2483        Self::AffinBank
2484    }
2485}
2486
2487/// An enum representing the possible values of an `PaymentMethodDetailsIdeal`'s `bank` field.
2488#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2489#[serde(rename_all = "snake_case")]
2490pub enum PaymentMethodDetailsIdealBank {
2491    AbnAmro,
2492    AsnBank,
2493    Bunq,
2494    Handelsbanken,
2495    Ing,
2496    Knab,
2497    Moneyou,
2498    N26,
2499    Nn,
2500    Rabobank,
2501    Regiobank,
2502    Revolut,
2503    SnsBank,
2504    TriodosBank,
2505    VanLanschot,
2506    Yoursafe,
2507}
2508
2509impl PaymentMethodDetailsIdealBank {
2510    pub fn as_str(self) -> &'static str {
2511        match self {
2512            PaymentMethodDetailsIdealBank::AbnAmro => "abn_amro",
2513            PaymentMethodDetailsIdealBank::AsnBank => "asn_bank",
2514            PaymentMethodDetailsIdealBank::Bunq => "bunq",
2515            PaymentMethodDetailsIdealBank::Handelsbanken => "handelsbanken",
2516            PaymentMethodDetailsIdealBank::Ing => "ing",
2517            PaymentMethodDetailsIdealBank::Knab => "knab",
2518            PaymentMethodDetailsIdealBank::Moneyou => "moneyou",
2519            PaymentMethodDetailsIdealBank::N26 => "n26",
2520            PaymentMethodDetailsIdealBank::Nn => "nn",
2521            PaymentMethodDetailsIdealBank::Rabobank => "rabobank",
2522            PaymentMethodDetailsIdealBank::Regiobank => "regiobank",
2523            PaymentMethodDetailsIdealBank::Revolut => "revolut",
2524            PaymentMethodDetailsIdealBank::SnsBank => "sns_bank",
2525            PaymentMethodDetailsIdealBank::TriodosBank => "triodos_bank",
2526            PaymentMethodDetailsIdealBank::VanLanschot => "van_lanschot",
2527            PaymentMethodDetailsIdealBank::Yoursafe => "yoursafe",
2528        }
2529    }
2530}
2531
2532impl AsRef<str> for PaymentMethodDetailsIdealBank {
2533    fn as_ref(&self) -> &str {
2534        self.as_str()
2535    }
2536}
2537
2538impl std::fmt::Display for PaymentMethodDetailsIdealBank {
2539    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2540        self.as_str().fmt(f)
2541    }
2542}
2543impl std::default::Default for PaymentMethodDetailsIdealBank {
2544    fn default() -> Self {
2545        Self::AbnAmro
2546    }
2547}
2548
2549/// An enum representing the possible values of an `PaymentMethodDetailsIdeal`'s `bic` field.
2550#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2551#[serde(rename_all = "snake_case")]
2552pub enum PaymentMethodDetailsIdealBic {
2553    #[serde(rename = "ABNANL2A")]
2554    Abnanl2a,
2555    #[serde(rename = "ASNBNL21")]
2556    Asnbnl21,
2557    #[serde(rename = "BITSNL2A")]
2558    Bitsnl2a,
2559    #[serde(rename = "BUNQNL2A")]
2560    Bunqnl2a,
2561    #[serde(rename = "FVLBNL22")]
2562    Fvlbnl22,
2563    #[serde(rename = "HANDNL2A")]
2564    Handnl2a,
2565    #[serde(rename = "INGBNL2A")]
2566    Ingbnl2a,
2567    #[serde(rename = "KNABNL2H")]
2568    Knabnl2h,
2569    #[serde(rename = "MOYONL21")]
2570    Moyonl21,
2571    #[serde(rename = "NNBANL2G")]
2572    Nnbanl2g,
2573    #[serde(rename = "NTSBDEB1")]
2574    Ntsbdeb1,
2575    #[serde(rename = "RABONL2U")]
2576    Rabonl2u,
2577    #[serde(rename = "RBRBNL21")]
2578    Rbrbnl21,
2579    #[serde(rename = "REVOIE23")]
2580    Revoie23,
2581    #[serde(rename = "REVOLT21")]
2582    Revolt21,
2583    #[serde(rename = "SNSBNL2A")]
2584    Snsbnl2a,
2585    #[serde(rename = "TRIONL2U")]
2586    Trionl2u,
2587}
2588
2589impl PaymentMethodDetailsIdealBic {
2590    pub fn as_str(self) -> &'static str {
2591        match self {
2592            PaymentMethodDetailsIdealBic::Abnanl2a => "ABNANL2A",
2593            PaymentMethodDetailsIdealBic::Asnbnl21 => "ASNBNL21",
2594            PaymentMethodDetailsIdealBic::Bitsnl2a => "BITSNL2A",
2595            PaymentMethodDetailsIdealBic::Bunqnl2a => "BUNQNL2A",
2596            PaymentMethodDetailsIdealBic::Fvlbnl22 => "FVLBNL22",
2597            PaymentMethodDetailsIdealBic::Handnl2a => "HANDNL2A",
2598            PaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A",
2599            PaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H",
2600            PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21",
2601            PaymentMethodDetailsIdealBic::Nnbanl2g => "NNBANL2G",
2602            PaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1",
2603            PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U",
2604            PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21",
2605            PaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23",
2606            PaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21",
2607            PaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A",
2608            PaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U",
2609        }
2610    }
2611}
2612
2613impl AsRef<str> for PaymentMethodDetailsIdealBic {
2614    fn as_ref(&self) -> &str {
2615        self.as_str()
2616    }
2617}
2618
2619impl std::fmt::Display for PaymentMethodDetailsIdealBic {
2620    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2621        self.as_str().fmt(f)
2622    }
2623}
2624impl std::default::Default for PaymentMethodDetailsIdealBic {
2625    fn default() -> Self {
2626        Self::Abnanl2a
2627    }
2628}
2629
2630/// An enum representing the possible values of an `PaymentMethodDetailsInteracPresent`'s `read_method` field.
2631#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2632#[serde(rename_all = "snake_case")]
2633pub enum PaymentMethodDetailsInteracPresentReadMethod {
2634    ContactEmv,
2635    ContactlessEmv,
2636    ContactlessMagstripeMode,
2637    MagneticStripeFallback,
2638    MagneticStripeTrack2,
2639}
2640
2641impl PaymentMethodDetailsInteracPresentReadMethod {
2642    pub fn as_str(self) -> &'static str {
2643        match self {
2644            PaymentMethodDetailsInteracPresentReadMethod::ContactEmv => "contact_emv",
2645            PaymentMethodDetailsInteracPresentReadMethod::ContactlessEmv => "contactless_emv",
2646            PaymentMethodDetailsInteracPresentReadMethod::ContactlessMagstripeMode => {
2647                "contactless_magstripe_mode"
2648            }
2649            PaymentMethodDetailsInteracPresentReadMethod::MagneticStripeFallback => {
2650                "magnetic_stripe_fallback"
2651            }
2652            PaymentMethodDetailsInteracPresentReadMethod::MagneticStripeTrack2 => {
2653                "magnetic_stripe_track2"
2654            }
2655        }
2656    }
2657}
2658
2659impl AsRef<str> for PaymentMethodDetailsInteracPresentReadMethod {
2660    fn as_ref(&self) -> &str {
2661        self.as_str()
2662    }
2663}
2664
2665impl std::fmt::Display for PaymentMethodDetailsInteracPresentReadMethod {
2666    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2667        self.as_str().fmt(f)
2668    }
2669}
2670impl std::default::Default for PaymentMethodDetailsInteracPresentReadMethod {
2671    fn default() -> Self {
2672        Self::ContactEmv
2673    }
2674}
2675
2676/// An enum representing the possible values of an `PaymentMethodDetailsInteracPresentReceipt`'s `account_type` field.
2677#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2678#[serde(rename_all = "snake_case")]
2679pub enum PaymentMethodDetailsInteracPresentReceiptAccountType {
2680    Checking,
2681    Savings,
2682    Unknown,
2683}
2684
2685impl PaymentMethodDetailsInteracPresentReceiptAccountType {
2686    pub fn as_str(self) -> &'static str {
2687        match self {
2688            PaymentMethodDetailsInteracPresentReceiptAccountType::Checking => "checking",
2689            PaymentMethodDetailsInteracPresentReceiptAccountType::Savings => "savings",
2690            PaymentMethodDetailsInteracPresentReceiptAccountType::Unknown => "unknown",
2691        }
2692    }
2693}
2694
2695impl AsRef<str> for PaymentMethodDetailsInteracPresentReceiptAccountType {
2696    fn as_ref(&self) -> &str {
2697        self.as_str()
2698    }
2699}
2700
2701impl std::fmt::Display for PaymentMethodDetailsInteracPresentReceiptAccountType {
2702    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2703        self.as_str().fmt(f)
2704    }
2705}
2706impl std::default::Default for PaymentMethodDetailsInteracPresentReceiptAccountType {
2707    fn default() -> Self {
2708        Self::Checking
2709    }
2710}
2711
2712/// An enum representing the possible values of an `PaymentMethodDetailsKonbiniStore`'s `chain` field.
2713#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2714#[serde(rename_all = "snake_case")]
2715pub enum PaymentMethodDetailsKonbiniStoreChain {
2716    Familymart,
2717    Lawson,
2718    Ministop,
2719    Seicomart,
2720}
2721
2722impl PaymentMethodDetailsKonbiniStoreChain {
2723    pub fn as_str(self) -> &'static str {
2724        match self {
2725            PaymentMethodDetailsKonbiniStoreChain::Familymart => "familymart",
2726            PaymentMethodDetailsKonbiniStoreChain::Lawson => "lawson",
2727            PaymentMethodDetailsKonbiniStoreChain::Ministop => "ministop",
2728            PaymentMethodDetailsKonbiniStoreChain::Seicomart => "seicomart",
2729        }
2730    }
2731}
2732
2733impl AsRef<str> for PaymentMethodDetailsKonbiniStoreChain {
2734    fn as_ref(&self) -> &str {
2735        self.as_str()
2736    }
2737}
2738
2739impl std::fmt::Display for PaymentMethodDetailsKonbiniStoreChain {
2740    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2741        self.as_str().fmt(f)
2742    }
2743}
2744impl std::default::Default for PaymentMethodDetailsKonbiniStoreChain {
2745    fn default() -> Self {
2746        Self::Familymart
2747    }
2748}
2749
2750/// An enum representing the possible values of an `PaymentMethodDetailsP24`'s `bank` field.
2751#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2752#[serde(rename_all = "snake_case")]
2753pub enum PaymentMethodDetailsP24Bank {
2754    AliorBank,
2755    BankMillennium,
2756    BankNowyBfgSa,
2757    BankPekaoSa,
2758    BankiSpbdzielcze,
2759    Blik,
2760    BnpParibas,
2761    Boz,
2762    CitiHandlowy,
2763    CreditAgricole,
2764    Envelobank,
2765    EtransferPocztowy24,
2766    GetinBank,
2767    Ideabank,
2768    Ing,
2769    Inteligo,
2770    MbankMtransfer,
2771    NestPrzelew,
2772    NoblePay,
2773    PbacZIpko,
2774    PlusBank,
2775    SantanderPrzelew24,
2776    TmobileUsbugiBankowe,
2777    ToyotaBank,
2778    Velobank,
2779    VolkswagenBank,
2780}
2781
2782impl PaymentMethodDetailsP24Bank {
2783    pub fn as_str(self) -> &'static str {
2784        match self {
2785            PaymentMethodDetailsP24Bank::AliorBank => "alior_bank",
2786            PaymentMethodDetailsP24Bank::BankMillennium => "bank_millennium",
2787            PaymentMethodDetailsP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa",
2788            PaymentMethodDetailsP24Bank::BankPekaoSa => "bank_pekao_sa",
2789            PaymentMethodDetailsP24Bank::BankiSpbdzielcze => "banki_spbdzielcze",
2790            PaymentMethodDetailsP24Bank::Blik => "blik",
2791            PaymentMethodDetailsP24Bank::BnpParibas => "bnp_paribas",
2792            PaymentMethodDetailsP24Bank::Boz => "boz",
2793            PaymentMethodDetailsP24Bank::CitiHandlowy => "citi_handlowy",
2794            PaymentMethodDetailsP24Bank::CreditAgricole => "credit_agricole",
2795            PaymentMethodDetailsP24Bank::Envelobank => "envelobank",
2796            PaymentMethodDetailsP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24",
2797            PaymentMethodDetailsP24Bank::GetinBank => "getin_bank",
2798            PaymentMethodDetailsP24Bank::Ideabank => "ideabank",
2799            PaymentMethodDetailsP24Bank::Ing => "ing",
2800            PaymentMethodDetailsP24Bank::Inteligo => "inteligo",
2801            PaymentMethodDetailsP24Bank::MbankMtransfer => "mbank_mtransfer",
2802            PaymentMethodDetailsP24Bank::NestPrzelew => "nest_przelew",
2803            PaymentMethodDetailsP24Bank::NoblePay => "noble_pay",
2804            PaymentMethodDetailsP24Bank::PbacZIpko => "pbac_z_ipko",
2805            PaymentMethodDetailsP24Bank::PlusBank => "plus_bank",
2806            PaymentMethodDetailsP24Bank::SantanderPrzelew24 => "santander_przelew24",
2807            PaymentMethodDetailsP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe",
2808            PaymentMethodDetailsP24Bank::ToyotaBank => "toyota_bank",
2809            PaymentMethodDetailsP24Bank::Velobank => "velobank",
2810            PaymentMethodDetailsP24Bank::VolkswagenBank => "volkswagen_bank",
2811        }
2812    }
2813}
2814
2815impl AsRef<str> for PaymentMethodDetailsP24Bank {
2816    fn as_ref(&self) -> &str {
2817        self.as_str()
2818    }
2819}
2820
2821impl std::fmt::Display for PaymentMethodDetailsP24Bank {
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 PaymentMethodDetailsP24Bank {
2827    fn default() -> Self {
2828        Self::AliorBank
2829    }
2830}
2831
2832/// An enum representing the possible values of an `PaymentMethodDetailsSofort`'s `preferred_language` field.
2833#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2834#[serde(rename_all = "snake_case")]
2835pub enum PaymentMethodDetailsSofortPreferredLanguage {
2836    De,
2837    En,
2838    Es,
2839    Fr,
2840    It,
2841    Nl,
2842    Pl,
2843}
2844
2845impl PaymentMethodDetailsSofortPreferredLanguage {
2846    pub fn as_str(self) -> &'static str {
2847        match self {
2848            PaymentMethodDetailsSofortPreferredLanguage::De => "de",
2849            PaymentMethodDetailsSofortPreferredLanguage::En => "en",
2850            PaymentMethodDetailsSofortPreferredLanguage::Es => "es",
2851            PaymentMethodDetailsSofortPreferredLanguage::Fr => "fr",
2852            PaymentMethodDetailsSofortPreferredLanguage::It => "it",
2853            PaymentMethodDetailsSofortPreferredLanguage::Nl => "nl",
2854            PaymentMethodDetailsSofortPreferredLanguage::Pl => "pl",
2855        }
2856    }
2857}
2858
2859impl AsRef<str> for PaymentMethodDetailsSofortPreferredLanguage {
2860    fn as_ref(&self) -> &str {
2861        self.as_str()
2862    }
2863}
2864
2865impl std::fmt::Display for PaymentMethodDetailsSofortPreferredLanguage {
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 PaymentMethodDetailsSofortPreferredLanguage {
2871    fn default() -> Self {
2872        Self::De
2873    }
2874}
2875
2876/// An enum representing the possible values of an `PaymentMethodDetailsUsBankAccount`'s `account_holder_type` field.
2877#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2878#[serde(rename_all = "snake_case")]
2879pub enum PaymentMethodDetailsUsBankAccountAccountHolderType {
2880    Company,
2881    Individual,
2882}
2883
2884impl PaymentMethodDetailsUsBankAccountAccountHolderType {
2885    pub fn as_str(self) -> &'static str {
2886        match self {
2887            PaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company",
2888            PaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual",
2889        }
2890    }
2891}
2892
2893impl AsRef<str> for PaymentMethodDetailsUsBankAccountAccountHolderType {
2894    fn as_ref(&self) -> &str {
2895        self.as_str()
2896    }
2897}
2898
2899impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountHolderType {
2900    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2901        self.as_str().fmt(f)
2902    }
2903}
2904impl std::default::Default for PaymentMethodDetailsUsBankAccountAccountHolderType {
2905    fn default() -> Self {
2906        Self::Company
2907    }
2908}
2909
2910/// An enum representing the possible values of an `PaymentMethodDetailsUsBankAccount`'s `account_type` field.
2911#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2912#[serde(rename_all = "snake_case")]
2913pub enum PaymentMethodDetailsUsBankAccountAccountType {
2914    Checking,
2915    Savings,
2916}
2917
2918impl PaymentMethodDetailsUsBankAccountAccountType {
2919    pub fn as_str(self) -> &'static str {
2920        match self {
2921            PaymentMethodDetailsUsBankAccountAccountType::Checking => "checking",
2922            PaymentMethodDetailsUsBankAccountAccountType::Savings => "savings",
2923        }
2924    }
2925}
2926
2927impl AsRef<str> for PaymentMethodDetailsUsBankAccountAccountType {
2928    fn as_ref(&self) -> &str {
2929        self.as_str()
2930    }
2931}
2932
2933impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountType {
2934    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2935        self.as_str().fmt(f)
2936    }
2937}
2938impl std::default::Default for PaymentMethodDetailsUsBankAccountAccountType {
2939    fn default() -> Self {
2940        Self::Checking
2941    }
2942}
2943
2944/// An enum representing the possible values of an `PaypalSellerProtection`'s `dispute_categories` field.
2945#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2946#[serde(rename_all = "snake_case")]
2947pub enum PaypalSellerProtectionDisputeCategories {
2948    Fraudulent,
2949    ProductNotReceived,
2950}
2951
2952impl PaypalSellerProtectionDisputeCategories {
2953    pub fn as_str(self) -> &'static str {
2954        match self {
2955            PaypalSellerProtectionDisputeCategories::Fraudulent => "fraudulent",
2956            PaypalSellerProtectionDisputeCategories::ProductNotReceived => "product_not_received",
2957        }
2958    }
2959}
2960
2961impl AsRef<str> for PaypalSellerProtectionDisputeCategories {
2962    fn as_ref(&self) -> &str {
2963        self.as_str()
2964    }
2965}
2966
2967impl std::fmt::Display for PaypalSellerProtectionDisputeCategories {
2968    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2969        self.as_str().fmt(f)
2970    }
2971}
2972impl std::default::Default for PaypalSellerProtectionDisputeCategories {
2973    fn default() -> Self {
2974        Self::Fraudulent
2975    }
2976}
2977
2978/// An enum representing the possible values of an `PaypalSellerProtection`'s `status` field.
2979#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2980#[serde(rename_all = "snake_case")]
2981pub enum PaypalSellerProtectionStatus {
2982    Eligible,
2983    NotEligible,
2984    PartiallyEligible,
2985}
2986
2987impl PaypalSellerProtectionStatus {
2988    pub fn as_str(self) -> &'static str {
2989        match self {
2990            PaypalSellerProtectionStatus::Eligible => "eligible",
2991            PaypalSellerProtectionStatus::NotEligible => "not_eligible",
2992            PaypalSellerProtectionStatus::PartiallyEligible => "partially_eligible",
2993        }
2994    }
2995}
2996
2997impl AsRef<str> for PaypalSellerProtectionStatus {
2998    fn as_ref(&self) -> &str {
2999        self.as_str()
3000    }
3001}
3002
3003impl std::fmt::Display for PaypalSellerProtectionStatus {
3004    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3005        self.as_str().fmt(f)
3006    }
3007}
3008impl std::default::Default for PaypalSellerProtectionStatus {
3009    fn default() -> Self {
3010        Self::Eligible
3011    }
3012}
3013
3014/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `authentication_flow` field.
3015#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3016#[serde(rename_all = "snake_case")]
3017pub enum ThreeDSecureDetailsChargeAuthenticationFlow {
3018    Challenge,
3019    Frictionless,
3020}
3021
3022impl ThreeDSecureDetailsChargeAuthenticationFlow {
3023    pub fn as_str(self) -> &'static str {
3024        match self {
3025            ThreeDSecureDetailsChargeAuthenticationFlow::Challenge => "challenge",
3026            ThreeDSecureDetailsChargeAuthenticationFlow::Frictionless => "frictionless",
3027        }
3028    }
3029}
3030
3031impl AsRef<str> for ThreeDSecureDetailsChargeAuthenticationFlow {
3032    fn as_ref(&self) -> &str {
3033        self.as_str()
3034    }
3035}
3036
3037impl std::fmt::Display for ThreeDSecureDetailsChargeAuthenticationFlow {
3038    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3039        self.as_str().fmt(f)
3040    }
3041}
3042impl std::default::Default for ThreeDSecureDetailsChargeAuthenticationFlow {
3043    fn default() -> Self {
3044        Self::Challenge
3045    }
3046}
3047
3048/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `electronic_commerce_indicator` field.
3049#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3050#[serde(rename_all = "snake_case")]
3051pub enum ThreeDSecureDetailsChargeElectronicCommerceIndicator {
3052    #[serde(rename = "01")]
3053    V01,
3054    #[serde(rename = "02")]
3055    V02,
3056    #[serde(rename = "05")]
3057    V05,
3058    #[serde(rename = "06")]
3059    V06,
3060    #[serde(rename = "07")]
3061    V07,
3062}
3063
3064impl ThreeDSecureDetailsChargeElectronicCommerceIndicator {
3065    pub fn as_str(self) -> &'static str {
3066        match self {
3067            ThreeDSecureDetailsChargeElectronicCommerceIndicator::V01 => "01",
3068            ThreeDSecureDetailsChargeElectronicCommerceIndicator::V02 => "02",
3069            ThreeDSecureDetailsChargeElectronicCommerceIndicator::V05 => "05",
3070            ThreeDSecureDetailsChargeElectronicCommerceIndicator::V06 => "06",
3071            ThreeDSecureDetailsChargeElectronicCommerceIndicator::V07 => "07",
3072        }
3073    }
3074}
3075
3076impl AsRef<str> for ThreeDSecureDetailsChargeElectronicCommerceIndicator {
3077    fn as_ref(&self) -> &str {
3078        self.as_str()
3079    }
3080}
3081
3082impl std::fmt::Display for ThreeDSecureDetailsChargeElectronicCommerceIndicator {
3083    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3084        self.as_str().fmt(f)
3085    }
3086}
3087impl std::default::Default for ThreeDSecureDetailsChargeElectronicCommerceIndicator {
3088    fn default() -> Self {
3089        Self::V01
3090    }
3091}
3092
3093/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `exemption_indicator` field.
3094#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3095#[serde(rename_all = "snake_case")]
3096pub enum ThreeDSecureDetailsChargeExemptionIndicator {
3097    LowRisk,
3098    None,
3099}
3100
3101impl ThreeDSecureDetailsChargeExemptionIndicator {
3102    pub fn as_str(self) -> &'static str {
3103        match self {
3104            ThreeDSecureDetailsChargeExemptionIndicator::LowRisk => "low_risk",
3105            ThreeDSecureDetailsChargeExemptionIndicator::None => "none",
3106        }
3107    }
3108}
3109
3110impl AsRef<str> for ThreeDSecureDetailsChargeExemptionIndicator {
3111    fn as_ref(&self) -> &str {
3112        self.as_str()
3113    }
3114}
3115
3116impl std::fmt::Display for ThreeDSecureDetailsChargeExemptionIndicator {
3117    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3118        self.as_str().fmt(f)
3119    }
3120}
3121impl std::default::Default for ThreeDSecureDetailsChargeExemptionIndicator {
3122    fn default() -> Self {
3123        Self::LowRisk
3124    }
3125}
3126
3127/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `result` field.
3128#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3129#[serde(rename_all = "snake_case")]
3130pub enum ThreeDSecureDetailsChargeResult {
3131    AttemptAcknowledged,
3132    Authenticated,
3133    Exempted,
3134    Failed,
3135    NotSupported,
3136    ProcessingError,
3137}
3138
3139impl ThreeDSecureDetailsChargeResult {
3140    pub fn as_str(self) -> &'static str {
3141        match self {
3142            ThreeDSecureDetailsChargeResult::AttemptAcknowledged => "attempt_acknowledged",
3143            ThreeDSecureDetailsChargeResult::Authenticated => "authenticated",
3144            ThreeDSecureDetailsChargeResult::Exempted => "exempted",
3145            ThreeDSecureDetailsChargeResult::Failed => "failed",
3146            ThreeDSecureDetailsChargeResult::NotSupported => "not_supported",
3147            ThreeDSecureDetailsChargeResult::ProcessingError => "processing_error",
3148        }
3149    }
3150}
3151
3152impl AsRef<str> for ThreeDSecureDetailsChargeResult {
3153    fn as_ref(&self) -> &str {
3154        self.as_str()
3155    }
3156}
3157
3158impl std::fmt::Display for ThreeDSecureDetailsChargeResult {
3159    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3160        self.as_str().fmt(f)
3161    }
3162}
3163impl std::default::Default for ThreeDSecureDetailsChargeResult {
3164    fn default() -> Self {
3165        Self::AttemptAcknowledged
3166    }
3167}
3168
3169/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `result_reason` field.
3170#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3171#[serde(rename_all = "snake_case")]
3172pub enum ThreeDSecureDetailsChargeResultReason {
3173    Abandoned,
3174    Bypassed,
3175    Canceled,
3176    CardNotEnrolled,
3177    NetworkNotSupported,
3178    ProtocolError,
3179    Rejected,
3180}
3181
3182impl ThreeDSecureDetailsChargeResultReason {
3183    pub fn as_str(self) -> &'static str {
3184        match self {
3185            ThreeDSecureDetailsChargeResultReason::Abandoned => "abandoned",
3186            ThreeDSecureDetailsChargeResultReason::Bypassed => "bypassed",
3187            ThreeDSecureDetailsChargeResultReason::Canceled => "canceled",
3188            ThreeDSecureDetailsChargeResultReason::CardNotEnrolled => "card_not_enrolled",
3189            ThreeDSecureDetailsChargeResultReason::NetworkNotSupported => "network_not_supported",
3190            ThreeDSecureDetailsChargeResultReason::ProtocolError => "protocol_error",
3191            ThreeDSecureDetailsChargeResultReason::Rejected => "rejected",
3192        }
3193    }
3194}
3195
3196impl AsRef<str> for ThreeDSecureDetailsChargeResultReason {
3197    fn as_ref(&self) -> &str {
3198        self.as_str()
3199    }
3200}
3201
3202impl std::fmt::Display for ThreeDSecureDetailsChargeResultReason {
3203    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3204        self.as_str().fmt(f)
3205    }
3206}
3207impl std::default::Default for ThreeDSecureDetailsChargeResultReason {
3208    fn default() -> Self {
3209        Self::Abandoned
3210    }
3211}
3212
3213/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `version` field.
3214#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3215#[serde(rename_all = "snake_case")]
3216pub enum ThreeDSecureDetailsChargeVersion {
3217    #[serde(rename = "1.0.2")]
3218    V1_0_2,
3219    #[serde(rename = "2.1.0")]
3220    V2_1_0,
3221    #[serde(rename = "2.2.0")]
3222    V2_2_0,
3223}
3224
3225impl ThreeDSecureDetailsChargeVersion {
3226    pub fn as_str(self) -> &'static str {
3227        match self {
3228            ThreeDSecureDetailsChargeVersion::V1_0_2 => "1.0.2",
3229            ThreeDSecureDetailsChargeVersion::V2_1_0 => "2.1.0",
3230            ThreeDSecureDetailsChargeVersion::V2_2_0 => "2.2.0",
3231        }
3232    }
3233}
3234
3235impl AsRef<str> for ThreeDSecureDetailsChargeVersion {
3236    fn as_ref(&self) -> &str {
3237        self.as_str()
3238    }
3239}
3240
3241impl std::fmt::Display for ThreeDSecureDetailsChargeVersion {
3242    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3243        self.as_str().fmt(f)
3244    }
3245}
3246impl std::default::Default for ThreeDSecureDetailsChargeVersion {
3247    fn default() -> Self {
3248        Self::V1_0_2
3249    }
3250}
3251
3252#[derive(Clone, Debug, Default, Deserialize, Serialize)]
3253pub struct DestinationSpecs {
3254    /// ID of an existing, connected Stripe account.
3255    pub account: String,
3256    /// The amount to transfer to the destination account without creating an `Application Fee` object.
3257    ///
3258    /// Cannot be combined with the `application_fee` parameter.
3259    /// Must be less than or equal to the charge amount.
3260    #[serde(skip_serializing_if = "Option::is_none")]
3261    pub amount: Option<i32>,
3262}